diff options
author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-06-03 14:03:27 +0100 |
---|---|---|
committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-06-09 18:34:33 +0100 |
commit | 21b9bc2dcd3a82202808de1d1c74cdef86e1fec1 (patch) | |
tree | 18c572dd1383dd62f64ee3a0dc9c6ae04ceeb491 /units/ethernet | |
parent | 078485c68547aacdcbc49afb7cd3f3b4f0e859b7 (diff) |
ethernet: static config job networkd/nm support
Convert the old check-{if}-static script to python. Add support for doing the same type of test when the interface is managed by networkd. Allow check the address that was assigned through a config variable.
Diffstat (limited to 'units/ethernet')
-rw-r--r-- | units/ethernet/jobs.pxu | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/units/ethernet/jobs.pxu b/units/ethernet/jobs.pxu index 6a48955e..b31fc155 100644 --- a/units/ethernet/jobs.pxu +++ b/units/ethernet/jobs.pxu @@ -434,12 +434,14 @@ _description: This job is intended to be used on particular devices where an interface has been identified for configuration with a static IP address. As such, this is not suitable for inclusion in the ethernet nested test plans, but should be - specifically included where required. + specifically included where required. To check the address assigned to the + interface set the expected value in STATIC_IP_{{ interface.upper() }}. category_id: com.canonical.plainbox::ethernet plugin: shell estimated_duration: 2s -command: check_static {{ interface }} +command: check_static.py nm {{ interface }} requires: + net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'NetworkManager' {%- if __on_ubuntucore__ %} snap.name == 'network-manager' connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' @@ -447,6 +449,26 @@ requires: executable.name == 'nmcli' {% endif -%} +unit: template +template-resource: device +template-filter: device.category == 'NETWORK' and device.interface != 'UNKNOWN' +template-engine: jinja2 +template-unit: job +id: ethernet/check-{{ interface }}-static-configuration-np +_summary: Check that {{ interface }} has a static configuration +_description: + This job is intended to be used on particular devices where an interface has + been identified for configuration with a static IP address. As such, this is + not suitable for inclusion in the ethernet nested test plans, but should be + specifically included where required. To check the address assigned to the + interface set the expected value in STATIC_IP_{{ interface.upper() }}. +category_id: com.canonical.plainbox::ethernet +plugin: shell +estimated_duration: 2s +command: check_static.py networkd {{ interface }} +requires: + net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'networkd' + plugin: shell category_id: com.canonical.plainbox::ethernet id: after-suspend-ethernet/network_resume_time_auto |