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 | 55796b89a14c34ed68233ba576c6007c2e199fef (patch) | |
tree | 6d09d78f2f56b3f5906c0aa6dd55129fe87f485f /units | |
parent | 76a2513c90b66b0846ec706feb7a8f1a4f5e2769 (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')
-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 6a48955..b31fc15 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 |