From 7712afd90de9a2b4f6d91f3fbea77de20d6ed40e Mon Sep 17 00:00:00 2001 From: Kate Case Date: Wed, 12 Oct 2022 14:06:05 -0400 Subject: Remove tests for net_* modules (#278) --- changelogs/fragments/net_mods.yaml | 3 ++ .../vyos_interface/tests/cli/net_interface.yaml | 55 ---------------------- .../vyos_linkagg/tests/cli/net_linkagg.yaml | 30 ------------ .../targets/vyos_lldp/tests/cli/net_lldp.yaml | 22 --------- .../tests/cli/net_lldp_interface.yaml | 25 ---------- .../vyos_logging/tests/cli/net_logging.yaml | 38 --------------- .../tests/cli/net_static_route.yaml | 32 ------------- .../targets/vyos_system/tests/cli/net_system.yaml | 30 ------------ 8 files changed, 3 insertions(+), 232 deletions(-) create mode 100644 changelogs/fragments/net_mods.yaml delete mode 100644 tests/integration/targets/vyos_interface/tests/cli/net_interface.yaml delete mode 100644 tests/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml delete mode 100644 tests/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml delete mode 100644 tests/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml delete mode 100644 tests/integration/targets/vyos_logging/tests/cli/net_logging.yaml delete mode 100644 tests/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml delete mode 100644 tests/integration/targets/vyos_system/tests/cli/net_system.yaml diff --git a/changelogs/fragments/net_mods.yaml b/changelogs/fragments/net_mods.yaml new file mode 100644 index 0000000..d93c9ee --- /dev/null +++ b/changelogs/fragments/net_mods.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Remove tests for to-be-removed net_* modules (https://github.com/ansible-collections/ansible.netcommon/pull/458). diff --git a/tests/integration/targets/vyos_interface/tests/cli/net_interface.yaml b/tests/integration/targets/vyos_interface/tests/cli/net_interface.yaml deleted file mode 100644 index 045daa2..0000000 --- a/tests/integration/targets/vyos_interface/tests/cli/net_interface.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- debug: msg="START vyos cli/net_interface.yaml on connection={{ ansible_connection - }}" - -- name: Run vyos lsmod command - register: lsmod_out - vyos.vyos.vyos_command: - commands: - - lsmod - -- name: Set up - delete interface - ansible.netcommon.net_interface: - name: eth1 - state: absent - -- name: Create interface using platform agnostic module - register: result - ansible.netcommon.net_interface: - name: eth1 - state: present - description: test-interface - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1" in result.commands' - - "\"set interfaces ethernet eth1 description 'test-interface'\" in result.commands" - -- name: Configure interface params using platform agnostic module - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - ansible.netcommon.net_interface: - name: eth1 - state: present - description: test-interface-1 - speed: 100 - duplex: half - mtu: 256 - -- assert: - that: - - result.changed == true - - "\"set interfaces ethernet eth1 description 'test-interface-1'\" in result.commands" - - '"set interfaces ethernet eth1 speed 100" in result.commands' - - '"set interfaces ethernet eth1 duplex half" in result.commands' - - '"set interfaces ethernet eth1 mtu 256" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: teardown - delete interface - ansible.netcommon.net_interface: - name: eth1 - state: absent - -- debug: msg="END vyos cli/net_interface.yaml on connection={{ ansible_connection - }}" diff --git a/tests/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml b/tests/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml deleted file mode 100644 index 8178f92..0000000 --- a/tests/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- debug: msg="START vyos cli/net_linkagg.yaml on connection={{ ansible_connection - }}" - -- name: Remove linkagg - set - ansible.netcommon.net_linkagg: - name: bond0 - state: absent - -- name: Create linkagg using platform agnostic module - register: result - ansible.netcommon.net_linkagg: - name: bond0 - members: - - eth1 - state: present - -- assert: - that: - - result.changed == true - - '"set interfaces bonding bond0 mode 802.3ad" in result.commands' - - '"set interfaces ethernet eth1 bond-group bond0" in result.commands' - -- name: Remove linkagg - teardown - ansible.netcommon.net_linkagg: - name: bond0 - state: absent - -- debug: msg="END vyos cli/net_linkagg.yaml on connection={{ ansible_connection - }}" diff --git a/tests/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml b/tests/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml deleted file mode 100644 index d19b126..0000000 --- a/tests/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- debug: msg="START vyos cli/net_lldp.yaml on connection={{ ansible_connection }}" - -- name: Make sure LLDP is not running - setup - vyos.vyos.vyos_config: - lines: delete service lldp - -- name: Enable LLDP service using platform agnostic module - register: result - ansible.netcommon.net_lldp: - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp" in result.commands' - -- name: Make sure LLDP is not running - teardown - vyos.vyos.vyos_config: - lines: delete service lldp - -- debug: msg="END vyos cli/net_lldp.yaml on connection={{ ansible_connection }}" diff --git a/tests/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml b/tests/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml deleted file mode 100644 index 98fc93a..0000000 --- a/tests/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- debug: msg="START vyos cli/net_lldp_interface.yaml on connection={{ ansible_connection - }}" - -- name: Make sure LLDP is not running - setup - vyos.vyos.vyos_config: - lines: delete service lldp - -- name: Create LLDP configuration using platform agnostic module - register: result - ansible.netcommon.net_lldp_interface: - name: eth1 - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp interface eth1" in result.commands' - -- name: Make sure LLDP is not running - teardown - vyos.vyos.vyos_config: - lines: delete service lldp - -- debug: msg="END vyos cli/net_lldp_interface.yaml on connection={{ ansible_connection - }}" diff --git a/tests/integration/targets/vyos_logging/tests/cli/net_logging.yaml b/tests/integration/targets/vyos_logging/tests/cli/net_logging.yaml deleted file mode 100644 index f8bda74..0000000 --- a/tests/integration/targets/vyos_logging/tests/cli/net_logging.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: msg="START vyos cli/net_logging.yaml on connection={{ ansible_connection - }}" - -- name: delete logging - setup - register: result - ansible.netcommon.net_logging: - dest: file - name: test - facility: all - level: notice - state: absent - -- name: file logging using platform agnostic module - register: result - ansible.netcommon.net_logging: - dest: file - name: test - facility: all - level: notice - state: present - -- assert: - that: - - result.changed == true - - '"set system syslog file test facility all level notice" in result.commands' - -- name: delete logging - teardown - register: result - ansible.netcommon.net_logging: - dest: file - name: test - facility: all - level: notice - state: absent - -- debug: msg="END vyos cli/net_logging.yaml on connection={{ ansible_connection - }}" diff --git a/tests/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml b/tests/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml deleted file mode 100644 index c53c838..0000000 --- a/tests/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- debug: msg="START vyos cli/net_static_route.yaml on connection={{ ansible_connection - }}" - -- name: delete static route - setup - register: result - ansible.netcommon.net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - state: absent - -- name: create static route using platform agnostic module - register: result - ansible.netcommon.net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - state: present - -- assert: - that: - - result.changed == true - - '"set protocols static route 172.24.0.0/24 next-hop 192.168.42.64" in result.commands' - -- name: delete static route - teardown - register: result - ansible.netcommon.net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - state: absent - -- debug: msg="END vyos cli/net_static_route.yaml on connection={{ ansible_connection - }}" diff --git a/tests/integration/targets/vyos_system/tests/cli/net_system.yaml b/tests/integration/targets/vyos_system/tests/cli/net_system.yaml deleted file mode 100644 index 758ba40..0000000 --- a/tests/integration/targets/vyos_system/tests/cli/net_system.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- debug: msg="START vyos cli/net_system.yaml on connection={{ ansible_connection - }}" - -- name: setup - ignore_errors: true - vyos.vyos.vyos_config: - lines: - - delete system name-server 192.0.2.1 - match: none - -- name: configure name servers using platform agnostic module - register: result - ansible.netcommon.net_system: - name_servers: - - 192.0.2.1 - -- assert: - that: - - result.changed == true - - result.commands[0] is search("set system name-server '192.0.2.1'") - -- name: setup - ignore_errors: true - vyos.vyos.vyos_config: - lines: - - delete system name-server 192.0.2.1 - match: none - -- debug: msg="END vyos cli/net_system.yaml on connection={{ ansible_connection }}" -- cgit v1.2.3