diff --git a/test/integration/platform_agnostic.yaml b/test/integration/platform_agnostic.yaml deleted file mode 100644 index b7f2c78f23e..00000000000 --- a/test/integration/platform_agnostic.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -- hosts: platform_agnostic - gather_facts: no - connection: local - - vars: - limit_to: "*" - debug: false - - -# Run the tests within blocks allows the next module to be tested if the previous one fails. -# This is done to allow https://github.com/ansible/dci-partner-ansible/ to run the full set of tests. - - - tasks: - - set_fact: - test_failed: false - - block: - - include_role: - name: net_system - when: "limit_to in ['*', 'net_system']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_banner - when: "limit_to in ['*', 'net_banner']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_user - when: "limit_to in ['*', 'net_user']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_vlan - when: "limit_to in ['*', 'net_vlan']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_vrf - when: "limit_to in ['*', 'net_vrf']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_interface - when: "limit_to in ['*', 'net_interface']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_static_route - when: "limit_to in ['*', 'net_static_route']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_logging - when: "limit_to in ['*', 'net_logging']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_linkagg - when: "limit_to in ['*', 'net_linkagg']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_lldp - when: "limit_to in ['*', 'net_lldp']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_lldp_interface - when: "limit_to in ['*', 'net_lldp_interface']" - rescue: - - set_fact: test_failed=true - - - block: - - include_role: - name: net_l3_interface - when: "limit_to in ['*', 'net_l3_interface']" - rescue: - - set_fact: test_failed=true - -########### - - name: Has any previous test failed? - fail: - msg: "One or more tests failed, check log for details" - when: test_failed diff --git a/test/integration/targets/eos_banner/tests/cli/net_banner.yaml b/test/integration/targets/eos_banner/tests/cli/net_banner.yaml new file mode 100644 index 00000000000..01b6dd8b350 --- /dev/null +++ b/test/integration/targets/eos_banner/tests/cli/net_banner.yaml @@ -0,0 +1,39 @@ +--- +- debug: msg="START eos cli/net_banner.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Remove previous motd banner (setup) + eos_config: + lines: no banner motd + authorize: yes + provider: "{{ cli }}" + become: yes + + +- name: create motd + net_banner: + banner: motd + text: this is my motd banner configure by net_banner + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - "result.changed == true" + - "'this is my motd banner configure by net_banner' in result.commands" + # Ensure sessions contains epoc. Will fail after 18th May 2033 + - "'ansible_1' in result.session_name" + +- name: Remove previous motd banner (teardown) + eos_config: + lines: no banner motd + authorize: yes + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_banner.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_interface/tests/cli/net_interface.yaml b/test/integration/targets/eos_interface/tests/cli/net_interface.yaml new file mode 100644 index 00000000000..55a7402de82 --- /dev/null +++ b/test/integration/targets/eos_interface/tests/cli/net_interface.yaml @@ -0,0 +1,56 @@ +--- +- debug: msg="START eos cli/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Set test interface + set_fact: + test_interface_1: ethernet1 + +- name: Configure interface (setup) + net_interface: + name: "{{ test_interface_1 }}" + description: test-interface-1 + mtu: 1800 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- name: Configure interface description using platform agnostic module + net_interface: + name: "{{ test_interface_1 }}" + description: test-interface-initial + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface {{ test_interface_1 }}" in result.commands' + - '"description test-interface-initial" in result.commands' + +- name: Confgure interface parameters + net_interface: + name: "{{ test_interface_1 }}" + description: test-interface + mtu: 2000 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface {{ test_interface_1 }}" in result.commands' + - '"description test-interface" in result.commands' + - '"mtu 2000" in result.commands' + +- debug: msg="END eos cli/net_interface.yaml on connection={{ ansible_connection }}" \ No newline at end of file diff --git a/test/integration/targets/eos_l3_interface/tests/cli/net_l3_interface.yaml b/test/integration/targets/eos_l3_interface/tests/cli/net_l3_interface.yaml new file mode 100644 index 00000000000..59d4c145389 --- /dev/null +++ b/test/integration/targets/eos_l3_interface/tests/cli/net_l3_interface.yaml @@ -0,0 +1,45 @@ +--- +- debug: msg="START eos cli/net_l3_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Set test interface + set_fact: + test_interface_1: ethernet1 + +- name: Delete interface ipv4 and ipv6 address(setup) + net_l3_interface: + name: "{{ test_interface_1 }}" + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- name: Configure interface ipv4 address using platform agnostic module + net_l3_interface: + name: "{{ test_interface_1 }}" + ipv4: 192.108.0.1/24 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface {{ test_interface_1 }}" in result.commands' + - '"ip address 192.108.0.1/24" in result.commands' + +- name: Delete interface ipv4 and ipv6 address(teardown) + net_l3_interface: + name: "{{ test_interface_1 }}" + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- debug: msg="END eos cli/net_l3_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_logging/tests/cli/net_logging.yaml b/test/integration/targets/eos_logging/tests/cli/net_logging.yaml new file mode 100644 index 00000000000..be94f1a7a80 --- /dev/null +++ b/test/integration/targets/eos_logging/tests/cli/net_logging.yaml @@ -0,0 +1,42 @@ +--- +- debug: msg="START eos cli/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Delete/disable host logging- setup + net_logging: + dest: host + name: 172.16.0.1 + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- name: Set up host logging using platform agnostic module + net_logging: + dest: host + name: 172.16.0.1 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"logging host 172.16.0.1" in result.commands' + +- name: Delete/disable host logging- teardown + net_logging: + dest: host + name: 172.16.0.1 + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- debug: msg="END eos cli/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_static_route/tests/cli/net_static_route.yaml b/test/integration/targets/eos_static_route/tests/cli/net_static_route.yaml new file mode 100644 index 00000000000..5c0b70dd7ab --- /dev/null +++ b/test/integration/targets/eos_static_route/tests/cli/net_static_route.yaml @@ -0,0 +1,38 @@ +--- +- debug: msg="START eos cli/net_static_route.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove config used in test + eos_config: + lines: + - no ip route 192.168.3.0/24 192.168.0.1 + authorize: yes + provider: "{{ cli }}" + become: yes + +- name: configure static route using platform agnostic module + net_static_route: + address: 192.168.3.0/24 + next_hop: 192.168.0.1 + admin_distance: 2 + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - "result.changed == true" + - "'ip route 192.168.3.0/24 192.168.0.1 2' in result.commands" + +- name: teardown - remove config used in test + eos_config: + lines: + - no ip route 192.168.3.0/24 192.168.0.1 + authorize: yes + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_static_route.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_system/tests/cli/net_system.yaml b/test/integration/targets/eos_system/tests/cli/net_system.yaml new file mode 100644 index 00000000000..863e956ebee --- /dev/null +++ b/test/integration/targets/eos_system/tests/cli/net_system.yaml @@ -0,0 +1,40 @@ +--- +- debug: msg="START eos cli/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup + eos_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + become: yes + +- name: configure domain_list using platform agnostic module + net_system: + domain_list: + - ansible.com + - redhat.com + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - result.changed == true + - "'ip domain-list ansible.com' in result.commands" + - "'ip domain-list redhat.com' in result.commands" + +- name: teardown + eos_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_user/tests/cli/net_user.yaml b/test/integration/targets/eos_user/tests/cli/net_user.yaml new file mode 100644 index 00000000000..e3cf836e269 --- /dev/null +++ b/test/integration/targets/eos_user/tests/cli/net_user.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START eos cli/net_user.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Set Up + eos_config: + lines: + - no username ansibletest1 + provider: "{{ cli }}" + become: yes + +- name: Create user with role using platform agnostic module + net_user: + name: ansibletest1 + privilege: 15 + role: network-operator + state: present + configured_password: test1 + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"username" in result.commands[0]' + - '"secret" in result.commands[0]' + - '"role network-operator" in result.commands[1]' + - '"privilege 15" in result.commands[2]' + +- name: Teardown + eos_config: + lines: + - no username ansibletest1 + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_user.yaml on connection={{ ansible_connection }}" \ No newline at end of file diff --git a/test/integration/targets/eos_vlan/tests/cli/net_vlan.yaml b/test/integration/targets/eos_vlan/tests/cli/net_vlan.yaml new file mode 100644 index 00000000000..4b8c886d8ca --- /dev/null +++ b/test/integration/targets/eos_vlan/tests/cli/net_vlan.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START eos cli/net_vlan.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove vlans used in test + eos_config: + lines: + - no vlan 4000 + authorize: yes + provider: "{{ cli }}" + become: yes + +- name: Create vlan using platform agnostic vlan module + net_vlan: + vlan_id: 4000 + name: vlan-4000 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - "result.changed == true" + - "'vlan 4000' in result.commands" + - "'name vlan-4000' in result.commands" + # Ensure sessions contains epoc. Will fail after 18th May 2033 + - "'ansible_1' in result.session_name" + +- name: setup - remove vlans used in test + eos_config: + lines: + - no vlan 4000 + authorize: yes + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_vlan.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/eos_vrf/tests/cli/net_vrf.yaml b/test/integration/targets/eos_vrf/tests/cli/net_vrf.yaml new file mode 100644 index 00000000000..708fabada8f --- /dev/null +++ b/test/integration/targets/eos_vrf/tests/cli/net_vrf.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START eos cli/net_vrf.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove vrf + net_vrf: + name: test + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + +- name: Create vrf using platform agnostic vrf module + net_vrf: + name: test + rd: 1:200 + state: present + authorize: yes + provider: "{{ cli }}" + become: yes + register: result + +- assert: + that: + - "result.changed == true" + - "'vrf definition test' in result.commands" + - "'rd 1:200' in result.commands" + # Ensure sessions contains epoc. Will fail after 18th May 2033 + - "'ansible_1' in result.session_name" + +- name: teardown - remove vrf + net_vrf: + name: test + state: absent + authorize: yes + provider: "{{ cli }}" + become: yes + +- debug: msg="END eos cli/net_vrf.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_banner/tests/cli/net_banner.yml b/test/integration/targets/ios_banner/tests/cli/net_banner.yml new file mode 100644 index 00000000000..49e98f631d7 --- /dev/null +++ b/test/integration/targets/ios_banner/tests/cli/net_banner.yml @@ -0,0 +1,32 @@ +--- +- debug: msg="START ios cli/net_banner.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove login + net_banner: + banner: login + state: absent + authorize: yes + +- name: Set login + net_banner: + banner: login + text: this is my login banner confgiured by net_banner + state: present + authorize: yes + register: result + +- assert: + that: + - "result.changed == true" + - "'banner login @\nthis is my login banner confgiured by net_banner\n@' in result.commands" + +- name: teardown - remove login + net_banner: + banner: login + state: absent + authorize: yes + +- debug: msg="END ios cli/net_banner.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_interface/tests/cli/net_interface.yaml b/test/integration/targets/ios_interface/tests/cli/net_interface.yaml new file mode 100644 index 00000000000..244e4b1fd53 --- /dev/null +++ b/test/integration/targets/ios_interface/tests/cli/net_interface.yaml @@ -0,0 +1,80 @@ +--- +- debug: msg="START ios cli/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Run show version + ios_command: + commands: show version + authorize: yes + register: show_version_result + +- block: + - name: Set test interface to GigabitEthernet0/1 as we are on Cisco IOS + set_fact: test_interface=GigabitEthernet0/1 + - name: Set test interface 2 to GigabitEthernet0/2 as we are on Cisco IOS + set_fact: test_interface2=GigabitEthernet0/2 + when: "'Cisco IOS' in show_version_result.stdout[0]" + +- block: + - name: Set test interface to GigabitEthernet2 as we are on Cisco IOS-XE + set_fact: test_interface=GigabitEthernet2 + - name: Disable autonegotiation on GigabitEthernet2 + ios_config: + lines: + - no negotiation auto + parents: int GigabitEthernet2 + authorize: yes + + - name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE + set_fact: test_interface2=GigabitEthernet3 + - name: Disable autonegotiation on GigabitEthernet3 + ios_config: + lines: + - no negotiation auto + parents: int GigabitEthernet3 + authorize: yes + when: "'Cisco IOS-XE' in show_version_result.stdout[0]" + +- name: Configure interface (setup) + net_interface: + name: "{{ test_interface }}" + description: test-interface-1 + speed: 1000 + mtu: 1800 + state: present + authorize: yes + register: result + +- name: Configure interface using platform agnostic module + net_interface: + name: "{{ test_interface }}" + description: test-interface-initial + state: present + authorize: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface {{ test_interface }}" in result.commands' + - '"description test-interface-initial" in result.commands' + +- name: Confgure interface parameters using platform agnostic module + net_interface: + name: "{{ test_interface }}" + description: test-interface + mtu: 2000 + state: present + authorize: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface {{ test_interface }}" in result.commands' + - '"description test-interface" in result.commands' + - '"mtu 2000" in result.commands' + +- debug: msg="START ios cli/net_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_logging/tests/cli/net_logging.yaml b/test/integration/targets/ios_logging/tests/cli/net_logging.yaml new file mode 100644 index 00000000000..37cf071d509 --- /dev/null +++ b/test/integration/targets/ios_logging/tests/cli/net_logging.yaml @@ -0,0 +1,36 @@ +--- +- debug: msg="START ios cli/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Remove host logging - setup + net_logging: + dest: host + name: 172.16.0.1 + state: absent + authorize: yes + +- name: Set up host logging using platform agnostic module + net_logging: + dest: host + name: 172.16.0.1 + facility: local7 + state: present + authorize: yes + register: result + +- assert: + that: + - 'result.changed == true' + - '"logging host 172.16.0.1" in result.commands' + - '"logging facility local7" in result.commands' + +- name: Remove host logging - teardown + net_logging: + dest: host + name: 172.16.0.1 + state: absent + authorize: yes + +- debug: msg="END ios cli/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml b/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml new file mode 100644 index 00000000000..0311f5bf469 --- /dev/null +++ b/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START ios cli/net_static_route.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: delete static route - setup + net_static_route: + prefix: 172.16.31.0 + mask: 255.255.255.0 + next_hop: 10.0.0.8 + admin_distance: 2 + state: absent + authorize: yes + register: result + +- name: create static route using platform agnostic module + net_static_route: + prefix: 172.16.31.0 + mask: 255.255.255.0 + next_hop: 10.0.0.8 + state: present + authorize: yes + register: result + +- assert: + that: + - 'result.changed == true' + - 'result.commands == ["ip route 172.16.31.0 255.255.255.0 10.0.0.8 1"]' + +- name: delete static route - teardown + net_static_route: + prefix: 172.16.31.0 + mask: 255.255.255.0 + next_hop: 10.0.0.8 + admin_distance: 2 + state: absent + authorize: yes + register: result + +- debug: msg="END ios cli/net_static_route.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/net_system.yaml b/test/integration/targets/ios_system/tests/cli/net_system.yaml new file mode 100644 index 00000000000..e63d87ed229 --- /dev/null +++ b/test/integration/targets/ios_system/tests/cli/net_system.yaml @@ -0,0 +1,37 @@ +--- +- debug: msg="START ios cli/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup + ios_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + authorize: yes + +- name: configure domain_search using platform agnostic module + net_system: + domain_search: + - ansible.com + - redhat.com + authorize: yes + register: result + +- assert: + that: + - result.changed == true + - "'ip domain list ansible.com' in result.commands" + - "'ip domain list redhat.com' in result.commands" + +- name: teardown + ios_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + authorize: yes + +- debug: msg="END ios cli/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/iosxr_interface/tests/cli/net_interface.yaml b/test/integration/targets/iosxr_interface/tests/cli/net_interface.yaml new file mode 100644 index 00000000000..7beef4440c4 --- /dev/null +++ b/test/integration/targets/iosxr_interface/tests/cli/net_interface.yaml @@ -0,0 +1,54 @@ +--- +- debug: msg="START iosxr cli/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Setup interface + net_interface: + name: GigabitEthernet0/0/0/2 + state: absent + provider: "{{ cli }}" + register: result + + +- name: Confgure interface using platform agnostic module + net_interface: + name: GigabitEthernet0/0/0/2 + description: test-interface-initial + state: present + provider: "{{ cli }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface GigabitEthernet0/0/0/2 description test-interface-initial" in result.commands' + +- name: Confgure interface parameters using platform agnostic module + net_interface: + name: GigabitEthernet0/0/0/2 + description: test-interface + speed: 100 + duplex: half + mtu: 512 + state: present + provider: "{{ cli }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"interface GigabitEthernet0/0/0/2 description test-interface" in result.commands' + - '"interface GigabitEthernet0/0/0/2 speed 100" in result.commands' + - '"interface GigabitEthernet0/0/0/2 duplex half" in result.commands' + - '"interface GigabitEthernet0/0/0/2 mtu 512" in result.commands' + +- name: Teardown interface + net_interface: + name: GigabitEthernet0/0/0/2 + state: absent + provider: "{{ cli }}" + register: result + +- debug: msg="END iosxr cli/net_interface.yaml on connection={{ ansible_connection }}" \ No newline at end of file diff --git a/test/integration/targets/iosxr_interface/tests/netconf/net_interface.yaml b/test/integration/targets/iosxr_interface/tests/netconf/net_interface.yaml new file mode 100644 index 00000000000..14e0bcdc6d4 --- /dev/null +++ b/test/integration/targets/iosxr_interface/tests/netconf/net_interface.yaml @@ -0,0 +1,54 @@ +--- +- debug: msg="START iosxr netconf/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Enable Netconf service + iosxr_netconf: + netconf_port: 830 + netconf_vrf: 'default' + state: present + register: result + +- name: Setup interface + net_interface: + name: GigabitEthernet0/0/0/1 + state: absent + provider: "{{ netconf }}" + register: result + + +- name: Confgure interface using platform agnostic module + net_interface: + name: GigabitEthernet0/0/0/1 + description: test-interface-initial + state: present + provider: "{{ netconf }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"GigabitEthernet0/0/0/1" in result.xml[0]' + +- name: Confgure interface parameters using platform agnostic module + net_interface: + name: GigabitEthernet0/0/0/1 + description: test-interface + speed: 100 + duplex: half + mtu: 512 + state: present + provider: "{{ netconf }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"GigabitEthernet0/0/0/1" in result.xml[0]' + - '"test-interface" in result.xml[0]' + - '"100" in result.xml[0]' + - '"512" in result.xml[0]' + +- debug: msg="END iosxr netconf/net_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/iosxr_logging/tests/cli/net_logging.yaml b/test/integration/targets/iosxr_logging/tests/cli/net_logging.yaml new file mode 100644 index 00000000000..89ec0472309 --- /dev/null +++ b/test/integration/targets/iosxr_logging/tests/cli/net_logging.yaml @@ -0,0 +1,34 @@ +--- +- debug: msg="START iosxr cli/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Remove host logging - setup + net_logging: + dest: hostnameprefix + name: 172.16.0.1 + state: absent + provider: "{{ cli }}" + +- name: Set up host logging using platform agnostic module + net_logging: + dest: hostnameprefix + name: 172.16.0.1 + state: present + provider: "{{ cli }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"logging hostnameprefix 172.16.0.1" in result.commands' + +- name: Remove host logging - teardown + net_logging: + dest: hostnameprefix + name: 172.16.0.1 + state: absent + provider: "{{ cli }}" + +- debug: msg="END iosxr cli/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/iosxr_system/tests/cli/net_system.yaml b/test/integration/targets/iosxr_system/tests/cli/net_system.yaml new file mode 100644 index 00000000000..d76c17cd7ad --- /dev/null +++ b/test/integration/targets/iosxr_system/tests/cli/net_system.yaml @@ -0,0 +1,37 @@ +--- +- debug: msg="START iosxr cli/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup + iosxr_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + +- name: configure domain_search using platform agnostic module + net_system: + domain_search: + - ansible.com + - redhat.com + provider: "{{ cli }}" + register: result + +- assert: + that: + - result.changed == true + - "'domain list ansible.com' in result.commands" + - "'domain list redhat.com' in result.commands" + +- name: setup + iosxr_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + +- debug: msg="END iosxr cli/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_banner/tests/netconf/net_banner.yml b/test/integration/targets/junos_banner/tests/netconf/net_banner.yml new file mode 100644 index 00000000000..a59c0d70af9 --- /dev/null +++ b/test/integration/targets/junos_banner/tests/netconf/net_banner.yml @@ -0,0 +1,35 @@ +--- +- debug: msg="START junos net_banner netconf/net_banner.yaml on connection={{ ansible_connection }}" + +- name: setup - remove login banner + net_banner: + banner: login + state: absent + provider: "{{ netconf }}" + +- name: Create login banner + net_banner: + banner: login + text: this is my login banner configured by net_banner + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'this is my login banner configured by net_banner' in config.xml" + +- name: teardown - remove login banner + net_banner: + banner: login + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos net_banner netconf/net_banner.yaml on connection={{ ansible_connection }}" \ No newline at end of file diff --git a/test/integration/targets/junos_interface/tests/netconf/net_interface.yaml b/test/integration/targets/junos_interface/tests/netconf/net_interface.yaml new file mode 100644 index 00000000000..5b3bba2ba66 --- /dev/null +++ b/test/integration/targets/junos_interface/tests/netconf/net_interface.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START junos netconf/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful + +- name: setup remove interface + net_interface: + name: ge-0/0/1 + description: test-interface + state: absent + provider: "{{ netconf }}" + +- name: Create interface using platform agnostic module + net_interface: + name: ge-0/0/1 + description: test-interface + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'ge-0/0/1' in config.xml" + - "'test-interface' in config.xml" + +- name: teardown remove interface + net_interface: + name: ge-0/0/1 + description: test-interface + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_l3_interface/tests/netconf/net_l3_interface.yaml b/test/integration/targets/junos_l3_interface/tests/netconf/net_l3_interface.yaml new file mode 100644 index 00000000000..80c6d30f557 --- /dev/null +++ b/test/integration/targets/junos_l3_interface/tests/netconf/net_l3_interface.yaml @@ -0,0 +1,46 @@ +--- +- debug: msg="START junos netconf/net_l3_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove interface address + net_l3_interface: + name: ge-0/0/1 + ipv4: 1.1.1.1 + ipv6: fd5d:12c9:2201:1::1 + state: absent + provider: "{{ netconf }}" + +- name: Configure interface address using platform agnostic module + net_l3_interface: + name: ge-0/0/1 + ipv4: 1.1.1.1 + ipv6: fd5d:12c9:2201:1::1 + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'1.1.1.1/32' in config.xml" + - "'fd5d:12c9:2201:1::1/128' in config.xml" + - result.diff.prepared is search("\+ *address 1.1.1.1/32") + - result.diff.prepared is search("\+ *address fd5d:12c9:2201:1::1/128") + +- name: teardown - remove interface address + net_l3_interface: + name: ge-0/0/1 + ipv4: 1.1.1.1 + ipv6: fd5d:12c9:2201:1::1 + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_l3_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_linkagg/tests/netconf/net_linkagg.yaml b/test/integration/targets/junos_linkagg/tests/netconf/net_linkagg.yaml new file mode 100644 index 00000000000..9e4531aa262 --- /dev/null +++ b/test/integration/targets/junos_linkagg/tests/netconf/net_linkagg.yaml @@ -0,0 +1,55 @@ +--- +- debug: msg="START junos netconf/net_linkagg.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove linkagg + net_linkagg: + name: ae0 + members: + - ge-0/0/6 + - ge-0/0/7 + mode: active + device_count: 4 + state: absent + provider: "{{ netconf }}" + +- name: configure linkagg using platform agnostic module + net_linkagg: + name: ae0 + members: + - ge-0/0/6 + - ge-0/0/7 + mode: active + device_count: 4 + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'ae0' in config.xml" + - "'4' in config.xml" + - "'ae0' in config.xml" + - "'' in config.xml" + +- name: teardown - remove linkagg + net_linkagg: + name: ae0 + members: + - ge-0/0/6 + - ge-0/0/7 + mode: active + device_count: 4 + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_linkagg.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_lldp/tests/netconf/net_lldp.yaml b/test/integration/targets/junos_lldp/tests/netconf/net_lldp.yaml new file mode 100644 index 00000000000..4b5d3682516 --- /dev/null +++ b/test/integration/targets/junos_lldp/tests/netconf/net_lldp.yaml @@ -0,0 +1,27 @@ +--- +- debug: msg="START junos netconf/net_lldp.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - Disable lldp - setup + net_lldp: + state: absent + provider: "{{ netconf }}" + +- name: Enable lldp using platform agnostic module + net_lldp: + state: present + provider: "{{ netconf }}" + register: result + +- assert: + that: + - "result.changed == true" + +- name: setup - Disable lldp - teardown + net_lldp: + state: absent + provider: "{{ netconf }}" + +- debug: msg="START junos netconf/net_lldp.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_lldp_interface/tests/netconf/net_lldp_interface.yaml b/test/integration/targets/junos_lldp_interface/tests/netconf/net_lldp_interface.yaml new file mode 100644 index 00000000000..e1219654b63 --- /dev/null +++ b/test/integration/targets/junos_lldp_interface/tests/netconf/net_lldp_interface.yaml @@ -0,0 +1,31 @@ +--- +- debug: msg="START junos netconf/net_lldp_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - Remove lldp interface configuration + net_lldp_interface: + name: ge-0/0/5 + state: absent + provider: "{{ netconf }}" + +- name: lldp interface configuration using platform agnostic module + net_lldp_interface: + name: ge-0/0/5 + state: present + provider: "{{ netconf }}" + register: result + +- assert: + that: + - "result.changed == true" + - result.diff.prepared is search("\+ *interface ge-0/0/5") + +- name: teardown - Remove lldp interface configuration + net_lldp_interface: + name: ge-0/0/5 + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_lldp_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_logging/tests/netconf/net_logging.yaml b/test/integration/targets/junos_logging/tests/netconf/net_logging.yaml new file mode 100644 index 00000000000..648f5a275ec --- /dev/null +++ b/test/integration/targets/junos_logging/tests/netconf/net_logging.yaml @@ -0,0 +1,48 @@ +--- +- debug: msg="START junos netconf/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove file logging + net_logging: + dest: file + name: test + facility: pfe + level: error + state: absent + provider: "{{ netconf }}" + +- name: Create file logging using platform agnostic module + net_logging: + dest: file + name: test_file + facility: pfe + level: error + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'test_file' in config.xml" + - "'pfe' in config.xml" + - "'' in config.xml" + +- name: teardown - remove file logging + net_logging: + dest: file + name: test + facility: pfe + level: error + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_static_route/tests/netconf/net_static_route.yaml b/test/integration/targets/junos_static_route/tests/netconf/net_static_route.yaml new file mode 100644 index 00000000000..abebe625dc8 --- /dev/null +++ b/test/integration/targets/junos_static_route/tests/netconf/net_static_route.yaml @@ -0,0 +1,46 @@ +--- +- debug: msg="START junos netconf/net_static_route.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove static route + net_static_route: + address: 1.1.1.0/24 + state: absent + provider: "{{ netconf }}" + +- name: Confgiure static route using platform agnostic module + net_static_route: + address: 1.1.1.0/24 + next_hop: 3.3.3.3 + preference: 10 + qualified_next_hop: 5.5.5.5 + qualified_preference: 30 + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'1.1.1.0/24' in config.xml" + - "'3.3.3.3' in config.xml" + - "'' in config.xml" + - "'5.5.5.5' in config.xml" + - "'30' in config.xml" + - "'10' in config.xml" + +- name: setup - remove static route + net_static_route: + address: 1.1.1.0/24 + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_static_route.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_system/tests/netconf/net_system.yaml b/test/integration/targets/junos_system/tests/netconf/net_system.yaml new file mode 100644 index 00000000000..03c25d62eb6 --- /dev/null +++ b/test/integration/targets/junos_system/tests/netconf/net_system.yaml @@ -0,0 +1,37 @@ +--- +- debug: msg="START junos netconf/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove hostname + net_system: + hostname: vsrx01 + state: absent + provider: "{{ netconf }}" + +- name: Set hostname using platform agnostic module + net_system: + hostname: vsrx01 + state: present + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'vsrx01' in config.xml" + +- name: teardown - remove hostname + net_system: + hostname: vsrx01 + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_user/tests/netconf/net_user.yaml b/test/integration/targets/junos_user/tests/netconf/net_user.yaml new file mode 100644 index 00000000000..3017d738aa0 --- /dev/null +++ b/test/integration/targets/junos_user/tests/netconf/net_user.yaml @@ -0,0 +1,41 @@ +--- +- debug: msg="START junos netconf/net_user.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove user + net_user: + name: test_user + state: absent + provider: "{{ netconf }}" + +- name: Create user with platform agnostic module + net_user: + name: test_user + state: present + full_name: test_user + role: operator + provider: "{{ netconf }}" + register: result + +- name: Get running configuration + junos_rpc: + rpc: get-configuration + provider: "{{ netconf }}" + register: config + +- assert: + that: + - "result.changed == true" + - "'test_user' in config.xml" + - "'test_user' in config.xml" + - "'operator' in config.xml" + +- name: teardown - remove user + net_user: + name: test_user + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_user.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_vlan/tests/netconf/net_vlan.yaml b/test/integration/targets/junos_vlan/tests/netconf/net_vlan.yaml new file mode 100644 index 00000000000..07df93b56aa --- /dev/null +++ b/test/integration/targets/junos_vlan/tests/netconf/net_vlan.yaml @@ -0,0 +1,30 @@ +--- +- debug: msg="START junos netconf/net_vlan.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove vlan + net_vlan: + name: test-vlan + description: test vlan + state: absent + provider: "{{ netconf }}" + +- name: Create vlan using platform agnostic vlan module + net_vlan: + vlan_id: 100 + name: test-vlan + state: present + description: test vlan + provider: "{{ netconf }}" + register: result + +- name: teardown - remove vlan + net_vlan: + name: test-vlan + description: test vlan + state: absent + provider: "{{ netconf }}" + +- debug: msg="END junos netconf/net_vlan.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/junos_vrf/tests/netconf/net_vrf.yaml b/test/integration/targets/junos_vrf/tests/netconf/net_vrf.yaml new file mode 100644 index 00000000000..c6f3cdb8587 --- /dev/null +++ b/test/integration/targets/junos_vrf/tests/netconf/net_vrf.yaml @@ -0,0 +1,43 @@ +--- +- debug: msg="START junos netconf/net_vrf.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup - remove vrf + net_vrf: + name: test-1 + state: absent + provider: "{{ netconf }}" + +- name: Configure vrf and its parameter using platform agnostic vrf module + net_vrf: + name: test-1 + description: test-vrf-1 + interfaces: + - ge-0/0/6 + - ge-0/0/5 + rd: 3.3.3.3:10 + target: target:65513:111 + state: present + provider: "{{ netconf }}" + register: result + +- assert: + that: + - "result.changed == true" + - result.diff.prepared is search("\+ *test-1") + - result.diff.prepared is search("\+ *description test-vrf-1") + - result.diff.prepared is search("\+ *instance-type vrf") + - result.diff.prepared is search("\+ *interface ge-0/0/5.0") + - result.diff.prepared is search("\+ *interface ge-0/0/6.0") + - result.diff.prepared is search("\+ *route-distinguisher 3.3.3.3:10") + - result.diff.prepared is search("\+ *vrf-target target:65513:111") + +- name: teardown - remove vrf + net_vrf: + name: test-1 + state: absent + provider: "{{ netconf }}" + +- debug: msg="START junos netconf/net_vrf.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/net_banner/aliases b/test/integration/targets/net_banner/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_banner/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_banner/defaults/main.yaml b/test/integration/targets/net_banner/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_banner/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_banner/tasks/cli.yaml b/test/integration/targets/net_banner/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_banner/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_banner/tasks/main.yaml b/test/integration/targets/net_banner/tasks/main.yaml deleted file mode 100644 index 1bf87081a97..00000000000 --- a/test/integration/targets/net_banner/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } \ No newline at end of file diff --git a/test/integration/targets/net_banner/tasks/netconf.yaml b/test/integration/targets/net_banner/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_banner/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_banner/tests/cli/basic-login.yaml b/test/integration/targets/net_banner/tests/cli/basic-login.yaml deleted file mode 100644 index ed5cda1bdb1..00000000000 --- a/test/integration/targets/net_banner/tests/cli/basic-login.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/ios/basic-login.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/eos/basic-login.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_banner/tests/cli/basic-motd.yaml b/test/integration/targets/net_banner/tests/cli/basic-motd.yaml deleted file mode 100644 index a195a89a871..00000000000 --- a/test/integration/targets/net_banner/tests/cli/basic-motd.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/ios/basic-motd.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/eos/basic-motd.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_banner/tests/cli/basic-no-login.yaml b/test/integration/targets/net_banner/tests/cli/basic-no-login.yaml deleted file mode 100644 index d0c514418c1..00000000000 --- a/test/integration/targets/net_banner/tests/cli/basic-no-login.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/ios/basic-no-login.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/eos/basic-no-login.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_banner/tests/eos/basic-login.yaml b/test/integration/targets/net_banner/tests/eos/basic-login.yaml deleted file mode 100644 index 62ba626dbb3..00000000000 --- a/test/integration/targets/net_banner/tests/eos/basic-login.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- - -- name: setup - remove login - net_banner: - banner: login - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Set login - net_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'this is my login banner' in result.commands" - - "'that has a multiline' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Set login again (idempotent) - net_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/eos/basic-motd.yaml b/test/integration/targets/net_banner/tests/eos/basic-motd.yaml deleted file mode 100644 index 10ff402d5ae..00000000000 --- a/test/integration/targets/net_banner/tests/eos/basic-motd.yaml +++ /dev/null @@ -1,92 +0,0 @@ ---- - -- name: setup - remove motd - net_banner: - banner: motd - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Set motd - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'this is my motd banner' in result.commands" - - "'that has a multiline' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Set motd again (idempotent) - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - -- name: Remove motd - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'no banner motd' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Remove motd again (idempotent) - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/eos/basic-no-login.yaml b/test/integration/targets/net_banner/tests/eos/basic-no-login.yaml deleted file mode 100644 index 91b1321bb82..00000000000 --- a/test/integration/targets/net_banner/tests/eos/basic-no-login.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: Setup - net_banner: - banner: login - text: | - Junk login banner - over multiple lines - state: present - authorize: yes - provider: "{{ cli }}" - -- name: remove login - net_banner: - banner: login - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'no banner login' in result.commands" # does this break due to "contains?" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: remove login (idempotent) - net_banner: - banner: login - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/ios/basic-login.yaml b/test/integration/targets/net_banner/tests/ios/basic-login.yaml deleted file mode 100644 index 44da3283881..00000000000 --- a/test/integration/targets/net_banner/tests/ios/basic-login.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- - -- name: setup - remove login - ios_banner: - banner: login - state: absent - authorize: yes - -- name: Set login - net_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - authorize: yes - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'banner login @\nthis is my login banner\nthat has a multiline\nstring\n@' in result.commands" - -- name: Set login again (idempotent) - net_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - authorize: yes - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/ios/basic-motd.yaml b/test/integration/targets/net_banner/tests/ios/basic-motd.yaml deleted file mode 100644 index ab8585200ed..00000000000 --- a/test/integration/targets/net_banner/tests/ios/basic-motd.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- name: setup - remove motd - ios_banner: - banner: motd - state: absent - authorize: yes - -- name: Set motd - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - authorize: yes - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'banner motd @\nthis is my motd banner\nthat has a multiline\nstring\n@' in result.commands" - -- name: Set motd again (idempotent) - net_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - authorize: yes - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/ios/basic-no-login.yaml b/test/integration/targets/net_banner/tests/ios/basic-no-login.yaml deleted file mode 100644 index b54da7725ab..00000000000 --- a/test/integration/targets/net_banner/tests/ios/basic-no-login.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: Setup - ios_banner: - banner: login - text: | - Junk login banner - over multiple lines - state: present - authorize: yes - -- name: remove login - net_banner: - banner: login - state: absent - authorize: yes - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'no banner login' in result.commands" # does this break due to "contains?" - -- name: remove login (idempotent) - net_banner: - banner: login - state: absent - authorize: yes - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_banner/tests/junos/basic.yaml b/test/integration/targets/net_banner/tests/junos/basic.yaml deleted file mode 100644 index 07014498123..00000000000 --- a/test/integration/targets/net_banner/tests/junos/basic.yaml +++ /dev/null @@ -1,112 +0,0 @@ ---- -- debug: msg="START net_banner junos/basic.yaml" - -- name: setup - remove login banner - net_banner: - banner: login - state: absent - provider: "{{ netconf }}" - -- name: Create login banner - net_banner: - banner: login - text: this is my login banner - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'this is my login banner' in config.xml" - -- name: Create login banner (idempotent) - net_banner: - banner: login - text: this is my login banner - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: delete login banner - net_banner: - banner: login - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'this is my login banner' not in config.xml" - -- name: setup - remove motd banner - net_banner: - banner: motd - state: absent - provider: "{{ netconf }}" - -- name: Create motd banner - junos_banner: - banner: motd - text: this is my motd banner - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'this is my motd banner' in config.xml" - -- name: Create motd banner (idempotent) - net_banner: - banner: motd - text: this is my motd banner - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: delete motd banner - net_banner: - banner: motd - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'this is my motd banner' not in config.xml" diff --git a/test/integration/targets/net_banner/tests/netconf/basic.yaml b/test/integration/targets/net_banner/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_banner/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_interface/aliases b/test/integration/targets/net_interface/aliases deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/integration/targets/net_interface/defaults/main.yaml b/test/integration/targets/net_interface/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_interface/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_interface/tasks/cli.yaml b/test/integration/targets/net_interface/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_interface/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_interface/tasks/main.yaml b/test/integration/targets/net_interface/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_interface/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_interface/tasks/netconf.yaml b/test/integration/targets/net_interface/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_interface/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_interface/tests/cli/basic.yaml b/test/integration/targets/net_interface/tests/cli/basic.yaml deleted file mode 100644 index 8a6f5347e67..00000000000 --- a/test/integration/targets/net_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- debug: msg="START cli/contains.yaml" - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' - -- include: "{{ role_path }}/tests/iosxr/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'iosxr' - -- include: "{{ role_path }}/tests/ios/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- debug: msg="END cli/contains.yaml" diff --git a/test/integration/targets/net_interface/tests/eos/basic.yaml b/test/integration/targets/net_interface/tests/eos/basic.yaml deleted file mode 100644 index a58390e16ca..00000000000 --- a/test/integration/targets/net_interface/tests/eos/basic.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- debug: msg="START net_interface eos/basic.yaml" \ No newline at end of file diff --git a/test/integration/targets/net_interface/tests/ios/basic.yaml b/test/integration/targets/net_interface/tests/ios/basic.yaml deleted file mode 100644 index 89693893834..00000000000 --- a/test/integration/targets/net_interface/tests/ios/basic.yaml +++ /dev/null @@ -1,261 +0,0 @@ ---- -- debug: msg="START net_interface cli/basic.yaml" - -- name: Run show version - ios_command: - commands: show version - authorize: yes - register: show_version_result - -- block: - - name: Set test interface to GigabitEthernet0/1 as we are on Cisco IOS - set_fact: test_interface=GigabitEthernet0/1 - - name: Set test interface 2 to GigabitEthernet0/2 as we are on Cisco IOS - set_fact: test_interface2=GigabitEthernet0/2 - when: "'Cisco IOS' in show_version_result.stdout[0]" - -- block: - - name: Set test interface to GigabitEthernet2 as we are on Cisco IOS-XE - set_fact: test_interface=GigabitEthernet2 - - name: Disable autonegotiation on GigabitEthernet2 - ios_config: - lines: - - no negotiation auto - parents: int GigabitEthernet2 - authorize: yes - - - name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE - set_fact: test_interface2=GigabitEthernet3 - - name: Disable autonegotiation on GigabitEthernet3 - ios_config: - lines: - - no negotiation auto - parents: int GigabitEthernet3 - authorize: yes - when: "'Cisco IOS-XE' in show_version_result.stdout[0]" - -- name: Configure interface (setup) - net_interface: - name: "{{ test_interface }}" - description: test-interface-1 - speed: 1000 - mtu: 1800 - state: present - authorize: yes - register: result - -- name: Configure interface - net_interface: - name: "{{ test_interface }}" - description: test-interface-initial - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"description test-interface-initial" in result.commands' - -- name: Confgure interface (idempotent) - net_interface: - name: "{{ test_interface }}" - description: test-interface-initial - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Confgure interface parameters - net_interface: - name: "{{ test_interface }}" - description: test-interface - mtu: 2000 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"description test-interface" in result.commands' - - '"mtu 2000" in result.commands' - -- name: Change interface parameters - net_interface: - name: "{{ test_interface }}" - description: test-interface-1 - mtu: 1800 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"description test-interface-1" in result.commands' - - '"mtu 1800" in result.commands' - -- name: Disable interface - net_interface: - name: "{{ test_interface }}" - enabled: False - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"shutdown" in result.commands' - -- name: Enable interface - net_interface: - name: "{{ test_interface }}" - enabled: True - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"no shutdown" in result.commands' - -- name: Confgure second interface (setup) - net_interface: - name: "{{ test_interface2 }}" - description: test-interface-initial - speed: 1000 - mtu: 1800 - state: present - authorize: yes - register: result - -- name: Add interface aggregate - net_interface: - aggregate: - - { name: "{{ test_interface }}", mtu: 2000, description: test-interface-1 } - - { name: "{{ test_interface2 }}", mtu: 2000, description: test-interface-2 } - speed: 1000 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"mtu 2000" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"description test-interface-2" in result.commands' - - '"mtu 2000" in result.commands' - -- name: Add interface aggregate (idempotent) - net_interface: - aggregate: - - { name: "{{ test_interface }}", mtu: 2000, description: test-interface-1 } - - { name: "{{ test_interface2 }}", mtu: 2000, description: test-interface-2 } - speed: 1000 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable interface aggregate - net_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - enabled: False - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"shutdown" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"shutdown" in result.commands' - -- name: Enable interface aggregate - net_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - enabled: True - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"no shutdown" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"no shutdown" in result.commands' - -- name: loopback interface setup - net_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - authorize: yes - -- name: Create loopback interface aggregate - net_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface Loopback9" in result.commands' - - '"interface Loopback10" in result.commands' - -- name: Delete loopback interface aggregate - net_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"no interface Loopback9" in result.commands' - - '"no interface Loopback10" in result.commands' - -- name: Delete loopback interface aggregate (idempotent) - net_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- debug: msg="END net_interface cli/basic.yaml" diff --git a/test/integration/targets/net_interface/tests/ios/intent.yaml b/test/integration/targets/net_interface/tests/ios/intent.yaml deleted file mode 100644 index 1029dc66699..00000000000 --- a/test/integration/targets/net_interface/tests/ios/intent.yaml +++ /dev/null @@ -1,161 +0,0 @@ ---- -- debug: msg="START net_interface ios/intent.yaml" - -- name: Run show version - ios_command: - commands: show version - authorize: yes - register: show_version_result - -- name: Set test interface to GigabitEthernet0/2 if we are on Cisco IOS - set_fact: test_interface=GigabitEthernet0/2 - when: "'Cisco IOS' in show_version_result.stdout[0]" - -- name: Set test interface to GigabitEthernet2 if we are on Cisco IOS-XE - set_fact: test_interface=GigabitEthernet2 - when: "'Cisco IOS-XE' in show_version_result.stdout[0]" - - -- name: Check intent arguments - net_interface: - name: "{{ test_interface }}" - state: up - tx_rate: ge(0) - rx_rate: le(0) - authorize: yes - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check intent arguments (failed condition) - net_interface: - name: "{{ test_interface }}" - state: down - tx_rate: gt(0) - rx_rate: lt(0) - authorize: yes - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - - "'tx_rate gt(0)' in result.failed_conditions" - - "'rx_rate lt(0)' in result.failed_conditions" - -- name: Config + intent - net_interface: - name: "{{ test_interface }}" - enabled: False - state: down - authorize: yes - register: result - -- assert: - that: - - "result.failed == false" - -- name: Config + intent (fail) - net_interface: - name: "{{ test_interface }}" - enabled: False - authorize: yes - state: up - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(up)' in result.failed_conditions" - -- name: Register show neighbors detail - ios_command: - commands: - - show lldp neighbors - authorize: yes - register: show_lldp_neighbors_result - -- block: - - name: Check neighbors intent arguments - net_interface: - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - authorize: yes - register: result - - - assert: - that: - - "result.failed == false" - - - name: Check neighbors intent arguments (failed condition) - net_interface: - name: Gi0/0 - neighbors: - - port: dummy_port - host: dummy_host - authorize: yes - ignore_errors: yes - register: result - - - assert: - that: - - "result.failed == true" - - "'host dummy_host' in result.failed_conditions" - - "'port dummy_port' in result.failed_conditions" - when: '"netdev" in show_lldp_neighbors_result.stdout' - -- name: Aggregate config + intent (pass) - net_interface: - aggregate: - - name: "{{ test_interface }}" - enabled: True - state: up - authorize: yes - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == false" - -- block: - - name: Aggregate neighbors intent (pass) - net_interface: - aggregate: - - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - authorize: yes - ignore_errors: yes - register: result - - - assert: - that: - - "result.failed == false" - - - name: Aggregate neighbors intent (fail) - net_interface: - aggregate: - - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - - port: dummy_port - host: dummy_host - authorize: yes - ignore_errors: yes - register: result - - - assert: - that: - - "result.failed == true" - - "'host dummy_host' in result.failed_conditions" - - "'port dummy_port' in result.failed_conditions" - when: "'netdev' in show_lldp_neighbors_result.stdout" diff --git a/test/integration/targets/net_interface/tests/iosxr/basic.yaml b/test/integration/targets/net_interface/tests/iosxr/basic.yaml deleted file mode 100644 index e3de5319786..00000000000 --- a/test/integration/targets/net_interface/tests/iosxr/basic.yaml +++ /dev/null @@ -1,242 +0,0 @@ ---- -- debug: msg="START net_interface iosxr/basic.yaml" - -- name: Setup interface - net_interface: - name: GigabitEthernet0/0/0/2 - state: absent - register: result - - -- name: Confgure interface - net_interface: - name: GigabitEthernet0/0/0/2 - description: test-interface-initial - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/2 description test-interface-initial" in result.commands' - -- name: Confgure interface (idempotent) - net_interface: - name: GigabitEthernet0/0/0/2 - description: test-interface-initial - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Confgure interface parameters - net_interface: - name: GigabitEthernet0/0/0/2 - description: test-interface - speed: 100 - duplex: half - mtu: 512 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/2 description test-interface" in result.commands' - - '"interface GigabitEthernet0/0/0/2 speed 100" in result.commands' - - '"interface GigabitEthernet0/0/0/2 duplex half" in result.commands' - - '"interface GigabitEthernet0/0/0/2 mtu 512" in result.commands' - -- name: Change interface parameters - net_interface: - name: GigabitEthernet0/0/0/2 - description: test-interface-1 - speed: 10 - duplex: full - mtu: 256 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/2 description test-interface-1" in result.commands' - - '"interface GigabitEthernet0/0/0/2 speed 10" in result.commands' - - '"interface GigabitEthernet0/0/0/2 duplex full" in result.commands' - - '"interface GigabitEthernet0/0/0/2 mtu 256" in result.commands' - -- name: Change interface parameters (idempotent) - net_interface: - name: GigabitEthernet0/0/0/2 - description: test-interface-1 - speed: 10 - duplex: full - mtu: 256 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable interface - net_interface: - name: GigabitEthernet0/0/0/2 - enabled: False - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/2 shutdown" in result.commands' - -- name: Enable interface - net_interface: - name: GigabitEthernet0/0/0/2 - enabled: True - register: result - -- assert: - that: - - 'result.changed == true' - - '"no interface GigabitEthernet0/0/0/2 shutdown" in result.commands' - -- name: Confgure second interface (setup) - net_interface: - name: GigabitEthernet0/0/0/3 - description: test-interface-initial - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/3 description test-interface-initial" in result.commands' - -- name: Delete interface aggregate (setup) - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/3 - - name: GigabitEthernet0/0/0/2 - state: absent - -- name: Add interface aggregate - net_interface: - aggregate: - - { name: GigabitEthernet0/0/0/3, mtu: 256, description: test-interface-1 } - - { name: GigabitEthernet0/0/0/2, mtu: 516, description: test-interface-2 } - speed: 100 - duplex: full - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/3 speed 100" in result.commands' - - '"interface GigabitEthernet0/0/0/3 description test-interface-1" in result.commands' - - '"interface GigabitEthernet0/0/0/3 duplex full" in result.commands' - - '"interface GigabitEthernet0/0/0/3 mtu 256" in result.commands' - - '"interface GigabitEthernet0/0/0/2 speed 100" in result.commands' - - '"interface GigabitEthernet0/0/0/2 description test-interface-2" in result.commands' - - '"interface GigabitEthernet0/0/0/2 duplex full" in result.commands' - - '"interface GigabitEthernet0/0/0/2 mtu 516" in result.commands' - - -- name: Add interface aggregate (idempotent) - net_interface: - aggregate: - - { name: GigabitEthernet0/0/0/3, mtu: 256, description: test-interface-1 } - - { name: GigabitEthernet0/0/0/2, mtu: 516, description: test-interface-2 } - speed: 100 - duplex: full - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable interface aggregate - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/3 - - name: GigabitEthernet0/0/0/2 - enabled: False - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/3 shutdown" in result.commands' - - '"interface GigabitEthernet0/0/0/2 shutdown" in result.commands' - -- name: Enable interface aggregate - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/3 - - name: GigabitEthernet0/0/0/2 - enabled: True - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"no interface GigabitEthernet0/0/0/3 shutdown" in result.commands' - - '"no interface GigabitEthernet0/0/0/2 shutdown" in result.commands' - -- name: interface aggregate (setup) - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/4 - - name: GigabitEthernet0/0/0/5 - description: test-interface-initial - register: result - -- name: Create interface aggregate - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/4 - description: test_interface_1 - - name: GigabitEthernet0/0/0/5 - description: test_interface_2 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface GigabitEthernet0/0/0/4 description test_interface_1" in result.commands' - - '"interface GigabitEthernet0/0/0/5 description test_interface_2" in result.commands' - -- name: Delete interface aggregate - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/4 - - name: GigabitEthernet0/0/0/5 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"no interface GigabitEthernet0/0/0/4" in result.commands' - - '"no interface GigabitEthernet0/0/0/5" in result.commands' - -- name: Delete interface aggregate (idempotent) - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/4 - - name: GigabitEthernet0/0/0/5 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- debug: msg="END net_interface iosxr/basic.yaml" diff --git a/test/integration/targets/net_interface/tests/iosxr/intent.yaml b/test/integration/targets/net_interface/tests/iosxr/intent.yaml deleted file mode 100644 index 8fa510dbf8b..00000000000 --- a/test/integration/targets/net_interface/tests/iosxr/intent.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- debug: msg="START net_interface iosxr/intent.yaml" - -- name: Setup (interface is up) - net_interface: - name: GigabitEthernet0/0/0/5 - description: test_interface_5 - enabled: True - state: present - register: result - -- name: Check intent arguments - net_interface: - name: GigabitEthernet0/0/0/5 - state: up - delay: 20 - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check intent arguments (failed condition) - net_interface: - name: GigabitEthernet0/0/0/5 - state: down - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - -- name: Config + intent - net_interface: - name: GigabitEthernet0/0/0/5 - enabled: False - state: down - delay: 20 - register: result - -- assert: - that: - - "result.failed == false" - -- name: Config + intent (fail) - net_interface: - name: GigabitEthernet0/0/0/5 - enabled: False - state: up - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(up)' in result.failed_conditions" - -- name: Aggregate config + intent (pass) - net_interface: - aggregate: - - name: GigabitEthernet0/0/0/5 - enabled: True - state: up - delay: 20 - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == false" diff --git a/test/integration/targets/net_interface/tests/junos/basic.yaml b/test/integration/targets/net_interface/tests/junos/basic.yaml deleted file mode 100644 index 2f5fb04eb6f..00000000000 --- a/test/integration/targets/net_interface/tests/junos/basic.yaml +++ /dev/null @@ -1,224 +0,0 @@ ---- -- debug: msg="START net_interface netconf/basic.yaml" - -- name: setup remove interface - net_interface: - name: ge-0/0/1 - description: test-interface - state: absent - provider: "{{ netconf }}" - -- name: Create interface - net_interface: - name: ge-0/0/1 - description: test-interface - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ge-0/0/1' in config.xml" - - "'test-interface' in config.xml" - -- name: Create interface (idempotent) - net_interface: - name: ge-0/0/1 - description: test-interface - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Configure interface attributes - net_interface: - name: ge-0/0/1 - description: test-interface - state: present - speed: 1g - mtu: 256 - duplex: full - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ge-0/0/1' in config.xml" - - "'full-duplex' in config.xml" - - "'256' in config.xml" - - "'1g' in config.xml" - - "'test-interface' in config.xml" - -- name: Disable interface - net_interface: - name: ge-0/0/1 - description: test-interface - enabled: False - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *disable") - -- name: Enable interface - net_interface: - name: ge-0/0/1 - description: test-interface - enabled: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *disable") - -- name: Delete interface - net_interface: - name: ge-0/0/1 - description: test-interface - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ge-0/0/1' not in config.xml" - -- name: Aggregate setup- delete interface ge-0/0/1 - net_interface: - name: ge-0/0/1 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Aggregate setup- delete interface ge-0/0/2 - net_interface: - name: ge-0/0/2 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Set interface on aggregate - net_interface: - aggregate: - - { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512} - - { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256} - duplex: full - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\+ *ge-0/0/1") - - result.diff.prepared is search("\+ *description test-interface-1") - - result.diff.prepared is search("\+ *speed 1g") - - result.diff.prepared is search("\+ *mtu 512") - - result.diff.prepared is search("\+ *link-mode full-duplex") - - result.diff.prepared is search("\+ *description test-interface-2") - - result.diff.prepared is search("\+ *speed 10m") - - result.diff.prepared is search("\+ * mtu 256") - - result.diff.prepared is search("\+ *link-mode full-duplex") - -- name: Set interface on aggregate (idempotent) - net_interface: - aggregate: - - { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512 } - - { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256 } - duplex: full - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable interface on aggregate - net_interface: - aggregate: - - name: ge-0/0/1 - - name: ge-0/0/2 - enabled: False - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\+ *disable") - -- name: Enable interface on aggregate - net_interface: - aggregate: - - name: ge-0/0/1 - - name: ge-0/0/2 - enabled: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\- *disable") - -- name: Delete interface on aggregate - net_interface: - aggregate: - - { name: ge-0/0/1, description: test-interface-1 } - - { name: ge-0/0/2, description: test-interface-2 } - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\- *ge-0/0/1") - - result.diff.prepared is search("\- *description test-interface-1") - - result.diff.prepared is search("\- *speed 1g") - - result.diff.prepared is search("\- *mtu 512") - - result.diff.prepared is search("\- *link-mode full-duplex") - - result.diff.prepared is search("\- *description test-interface-2") - - result.diff.prepared is search("\- *speed 10m") - - result.diff.prepared is search("\- * mtu 256") - - result.diff.prepared is search("\- *link-mode full-duplex") - -- name: Delete interface on aggregate (idempotent) - net_interface: - aggregate: - - name: ge-0/0/1 - - name: ge-0/0/2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_interface/tests/junos/intent.yaml b/test/integration/targets/net_interface/tests/junos/intent.yaml deleted file mode 100644 index 973cb5f9c7a..00000000000 --- a/test/integration/targets/net_interface/tests/junos/intent.yaml +++ /dev/null @@ -1,89 +0,0 @@ ---- -- debug: msg="START net_interface junos/intent.yaml" - -- name: get facts - junos_facts: - provider: "{{ netconf }}" - register: result - - -- name: Define interface name for vSRX - set_fact: - name: pp0 - when: result['ansible_facts']['ansible_net_model'] is search("vSRX*") - -- name: Define interface name for vQFX - set_fact: - name: gr-0/0/0 - when: result['ansible_facts']['ansible_net_model'] is search("vqfx*") - -- name: Check intent arguments - net_interface: - name: "{{ name }}" - state: up - tx_rate: ge(0) - rx_rate: le(0) - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check intent arguments (failed condition) - net_interface: - name: "{{ name }}" - state: down - tx_rate: gt(0) - rx_rate: lt(0) - provider: "{{ netconf }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - - "'tx_rate gt(0)' in result.failed_conditions" - - "'rx_rate lt(0)' in result.failed_conditions" - -- name: Config + intent - net_interface: - name: "{{ name }}" - enabled: False - state: down - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.failed == false" - - result.diff.prepared is search("\+ *disable") - -- name: Config + intent (fail) - net_interface: - name: "{{ name }}" - enabled: False - state: up - provider: "{{ netconf }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(up)' in result.failed_conditions" - -- name: Aggregate config + intent (pass) - net_interface: - aggregate: - - name: "{{ name }}" - enabled: True - state: up - provider: "{{ netconf }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == false" diff --git a/test/integration/targets/net_interface/tests/netconf/basic.yaml b/test/integration/targets/net_interface/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_interface/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_interface/tests/vyos/basic.yaml b/test/integration/targets/net_interface/tests/vyos/basic.yaml deleted file mode 100644 index a4b47a2d9dd..00000000000 --- a/test/integration/targets/net_interface/tests/vyos/basic.yaml +++ /dev/null @@ -1,223 +0,0 @@ ---- -- debug: msg="START net_interface vyos/basic.yaml" - -- name: Run vyos lsmod command - vyos_command: - commands: - - lsmod - register: lsmod_out - -- name: Set up - delete interface - net_interface: - name: eth1 - state: absent - -- name: Set up - Create interface - net_interface: - name: eth1 - state: present - description: test-interface - register: result - -- 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 - net_interface: - name: eth1 - state: present - description: test-interface-1 - speed: 100 - duplex: half - mtu: 256 - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - -- 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: Configure interface params (idempotent) - net_interface: - name: eth1 - state: present - description: test-interface-1 - speed: 100 - duplex: half - mtu: 256 - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- assert: - that: - - 'result.changed == false' - when: "'virtio' not in lsmod_out.stdout[0]" - -- name: Change interface params - net_interface: - name: eth1 - state: present - description: test-interface-2 - speed: 1000 - duplex: full - mtu: 512 - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- assert: - that: - - 'result.changed == true' - - '"set interfaces ethernet eth1 description test-interface-2" in result.commands' - - '"set interfaces ethernet eth1 speed 1000" in result.commands' - - '"set interfaces ethernet eth1 duplex full" in result.commands' - - '"set interfaces ethernet eth1 mtu 512" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Disable interface - net_interface: - name: eth1 - enabled: False - register: result - -- assert: - that: - - 'result.changed == true' - - '"set interfaces ethernet eth1 disable" in result.commands' - -- name: Enable interface - net_interface: - name: eth1 - enabled: True - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1 disable" in result.commands' - -- name: Delete interface - net_interface: - name: eth1 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1" in result.commands' - -- name: Delete interface (idempotent) - net_interface: - name: eth1 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Aggregate setup- delete interface - net_interface: - name: eth2 - state: absent - register: result - -- name: Set interface on aggregate - net_interface: - aggregate: - - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- 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 512" in result.commands' - - '"set interfaces ethernet eth2 description test-interface-2" in result.commands' - - '"set interfaces ethernet eth2 speed 1000" in result.commands' - - '"set interfaces ethernet eth2 duplex full" in result.commands' - - '"set interfaces ethernet eth2 mtu 256" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Set interface on aggregate (idempotent) - net_interface: - aggregate: - - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- assert: - that: - - 'result.changed == false' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Disable interface on aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - description: test-interface - enabled: False - register: result - -- assert: - that: - - 'result.changed == true' - - '"set interfaces ethernet eth1 disable" in result.commands' - - '"set interfaces ethernet eth2 disable" in result.commands' - -- name: Enable interface on aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - enabled: True - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1 disable" in result.commands' - - '"delete interfaces ethernet eth2 disable" in result.commands' - -- name: Delete interface aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1" in result.commands' - - '"delete interfaces ethernet eth2" in result.commands' - -- name: Delete interface aggregate (idempotent) - net_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - - -- debug: msg="END net_interface vyos/basic.yaml" diff --git a/test/integration/targets/net_interface/tests/vyos/intent.yaml b/test/integration/targets/net_interface/tests/vyos/intent.yaml deleted file mode 100644 index 73e5bd852c5..00000000000 --- a/test/integration/targets/net_interface/tests/vyos/intent.yaml +++ /dev/null @@ -1,137 +0,0 @@ ---- -- debug: msg="START net_interface vyos/intent.yaml" - -- name: Run vyos lsmod command - vyos_command: - commands: - - lsmod - register: lsmod_out - -- name: Setup (interface is up) - net_interface: - name: eth1 - enabled: True - state: present - register: result - -- name: Check intent arguments - net_interface: - name: eth1 - state: up - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check lldp neighbors intent arguments - net_interface: - name: eth0 - neighbors: - - port: eth0 - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - -- assert: - that: - - "result.failed == false" - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Check intent arguments (failed condition) - net_interface: - name: eth1 - state: down - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - -- name: Check lldp neighbors intent arguments (failed) - net_interface: - name: eth0 - neighbors: - - port: dummy_port - host: dummy_host - ignore_errors: yes - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - -- assert: - that: - - "result.failed == true" - - "'host dummy_host' in result.failed_conditions" - - "'port dummy_port' in result.failed_conditions" - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Config + intent - net_interface: - name: eth1 - enabled: False - state: down - register: result - -- assert: - that: - - "result.failed == false" - -- name: Config + intent (fail) - net_interface: - name: eth1 - enabled: False - state: up - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(up)' in result.failed_conditions" - -- name: Aggregate config + intent (pass) - net_interface: - aggregate: - - name: eth1 - enabled: True - state: up - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check lldp neighbors intent aggregate arguments - net_interface: - aggregate: - - name: eth0 - neighbors: - - port: eth0 - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - -- assert: - that: - - "result.failed == false" - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Check lldp neighbors intent aggregate arguments (failed) - net_interface: - aggregate: - - name: eth0 - neighbors: - - port: eth0 - - port: dummy_port - host: dummy_host - ignore_errors: yes - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - -- assert: - that: - - "result.failed == true" - - "'host dummy_host' in result.failed_conditions" - - "'port dummy_port' in result.failed_conditions" - when: "'virtio_net' not in lsmod_out.stdout[0]" diff --git a/test/integration/targets/net_l3_interface/aliases b/test/integration/targets/net_l3_interface/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_l3_interface/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_l3_interface/aliases.txt b/test/integration/targets/net_l3_interface/aliases.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/integration/targets/net_l3_interface/defaults/main.yaml b/test/integration/targets/net_l3_interface/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_l3_interface/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_l3_interface/tasks/main.yaml b/test/integration/targets/net_l3_interface/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_l3_interface/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_l3_interface/tasks/netconf.yaml b/test/integration/targets/net_l3_interface/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_l3_interface/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_l3_interface/tests/cli/basic.yaml b/test/integration/targets/net_l3_interface/tests/cli/basic.yaml deleted file mode 100644 index b1bec77f7ca..00000000000 --- a/test/integration/targets/net_l3_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_l3_interface/tests/eos/basic.yaml b/test/integration/targets/net_l3_interface/tests/eos/basic.yaml deleted file mode 100644 index 87457c3575d..00000000000 --- a/test/integration/targets/net_l3_interface/tests/eos/basic.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- debug: msg="START net_l3_interface eos/basic.yaml" \ No newline at end of file diff --git a/test/integration/targets/net_l3_interface/tests/junos/basic.yaml b/test/integration/targets/net_l3_interface/tests/junos/basic.yaml deleted file mode 100644 index 73da00d583b..00000000000 --- a/test/integration/targets/net_l3_interface/tests/junos/basic.yaml +++ /dev/null @@ -1,183 +0,0 @@ ---- -- debug: msg="START net_l3_interface junos/basic.yaml" - -- name: setup - remove interface address - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: absent - provider: "{{ netconf }}" - -- name: Configure interface address - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'1.1.1.1/32' in config.xml" - - "'fd5d:12c9:2201:1::1/128' in config.xml" - - result.diff.prepared is search("\+ *address 1.1.1.1/32") - - result.diff.prepared is search("\+ *address fd5d:12c9:2201:1::1/128") - -- name: Configure interface address (idempotent) - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete interface address - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'1.1.1.1/32' not in config.xml" - - "'fd5d:12c9:2201:1::1/128' not in config.xml" - - result.diff.prepared is search("\- *address 1.1.1.1/32") - - result.diff.prepared is search("\- *address fd5d:12c9:2201:1::1/128") - -- name: Delete interface address (idempotent) - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Aggregate setup- delete interface ge-0/0/1 - net_l3_interface: - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Aggregate setup- delete interface ge-0/0/2 - net_l3_interface: - name: ge-0/0/2 - ipv4: 2.2.2.2 - ipv6: fd5d:12c9:2201:2::2 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Configure l3 interface in aggregate - net_l3_interface: - aggregate: - - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - - name: ge-0/0/2 - ipv4: 2.2.2.2 - ipv6: fd5d:12c9:2201:2::2 - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - "'edit interfaces ge-0/0/1 unit 0 family inet' in result.diff.prepared" - - result.diff.prepared is search("\+ *address 1.1.1.1/32") - - "'edit interfaces ge-0/0/1 unit 0 family inet6' in result.diff.prepared" - - result.diff.prepared is search("\+ *address fd5d:12c9:2201:1::1/128") - - "'edit interfaces ge-0/0/2 unit 0 family inet' in result.diff.prepared" - - result.diff.prepared is search("\+ *address 2.2.2.2/32") - - "'edit interfaces ge-0/0/2 unit 0 family inet6' in result.diff.prepared" - - result.diff.prepared is search("\+ *address fd5d:12c9:2201:2::2/128") - -- name: Configure l3 interface in aggregate (idempotent) - net_l3_interface: - aggregate: - - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - - name: ge-0/0/2 - ipv4: 2.2.2.2 - ipv6: fd5d:12c9:2201:2::2 - active: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete l3 interface configuration - net_l3_interface: - aggregate: - - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - - name: ge-0/0/2 - ipv4: 2.2.2.2 - ipv6: fd5d:12c9:2201:2::2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - "'edit interfaces ge-0/0/1 unit 0 family inet' in result.diff.prepared" - - result.diff.prepared is search("\- *address 1.1.1.1/32") - - "'edit interfaces ge-0/0/1 unit 0 family inet6' in result.diff.prepared" - - result.diff.prepared is search("\- *address fd5d:12c9:2201:1::1/128") - - "'edit interfaces ge-0/0/2 unit 0 family inet' in result.diff.prepared" - - result.diff.prepared is search("\- *address 2.2.2.2/32") - - "'edit interfaces ge-0/0/2 unit 0 family inet6' in result.diff.prepared" - - result.diff.prepared is search("\- *address fd5d:12c9:2201:2::2/128") - -- name: Delete l3 interface configuration (idempotent) - net_l3_interface: - aggregate: - - name: ge-0/0/1 - ipv4: 1.1.1.1 - ipv6: fd5d:12c9:2201:1::1 - - name: ge-0/0/2 - ipv4: 2.2.2.2 - ipv6: fd5d:12c9:2201:2::2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_l3_interface/tests/netconf/basic.yaml b/test/integration/targets/net_l3_interface/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_l3_interface/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_linkagg/aliases b/test/integration/targets/net_linkagg/aliases deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/integration/targets/net_linkagg/tasks/cli.yaml b/test/integration/targets/net_linkagg/tasks/cli.yaml deleted file mode 100644 index d675462dd02..00000000000 --- a/test/integration/targets/net_linkagg/tasks/cli.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_linkagg/tasks/main.yaml b/test/integration/targets/net_linkagg/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_linkagg/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_linkagg/tasks/netconf.yaml b/test/integration/targets/net_linkagg/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_linkagg/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_linkagg/tests/cli/basic.yaml b/test/integration/targets/net_linkagg/tests/cli/basic.yaml deleted file mode 100644 index 29e7b06be12..00000000000 --- a/test/integration/targets/net_linkagg/tests/cli/basic.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' diff --git a/test/integration/targets/net_linkagg/tests/junos/basic.yaml b/test/integration/targets/net_linkagg/tests/junos/basic.yaml deleted file mode 100644 index 5db6560f19c..00000000000 --- a/test/integration/targets/net_linkagg/tests/junos/basic.yaml +++ /dev/null @@ -1,240 +0,0 @@ ---- -- debug: msg="START net_linkagg junos/basic.yaml" - -- name: setup - remove linkagg - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: absent - provider: "{{ netconf }}" - -- name: configure linkagg - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ae0' in config.xml" - - "'4' in config.xml" - - "'ae0' in config.xml" - - "'' in config.xml" - -- name: configure linkagg (idempotent) - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: configure lacp in passive - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: passive - device_count: 4 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' in config.xml" - -- name: delete lacp - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: off - device_count: 4 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' not in config.xml" - -- name: Change device count - net_linkagg: - name: ae0 - device_count: 2 - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'2' in config.xml" - -- name: Disable linkagg interface - net_linkagg: - name: ae0 - state: down - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *disable") - -- name: Enable linkagg interface - net_linkagg: - name: ae0 - state: up - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *disable") - -- name: Deactivate linkagg - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: present - active: False - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ae0' in config.xml" - - "'4' in config.xml" - - "'inactive: ae0' in result.diff.prepared" - -- name: Activate linkagg - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: present - active: True - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' in config.xml" - - "'ae0' in config.xml" - - "'active: device-count 4' in result.diff.prepared" - - "'active: ae0' in result.diff.prepared" - -- name: Delete linkagg - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' not in config.xml" - - "'ae0' not in config.xml" - - "'4' not in config.xml" - - "'ae0' not in config.xml" - -- name: Delete linkagg (idempotent) - net_linkagg: - name: ae0 - members: - - ge-0/0/6 - - ge-0/0/7 - mode: active - device_count: 4 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- debug: msg="END net_linkagg junos/basic.yaml" diff --git a/test/integration/targets/net_linkagg/tests/netconf/basic.yaml b/test/integration/targets/net_linkagg/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_linkagg/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_linkagg/tests/vyos/basic.yaml b/test/integration/targets/net_linkagg/tests/vyos/basic.yaml deleted file mode 100644 index 0ef35ebc2e3..00000000000 --- a/test/integration/targets/net_linkagg/tests/vyos/basic.yaml +++ /dev/null @@ -1,182 +0,0 @@ ---- -- name: Remove linkagg - net_linkagg: - name: bond0 - state: absent - -- name: Remove linkagg - net_linkagg: - name: bond1 - state: absent - -- name: Create linkagg - net_linkagg: - name: bond0 - members: - - eth1 - state: present - register: result - -- 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: Create linkagg again (idempotent) - net_linkagg: - name: bond0 - members: - - eth1 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Add linkagg member - net_linkagg: - name: bond0 - members: - - eth2 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set interfaces ethernet eth2 bond-group bond0" in result.commands' - -- name: Add linkagg member again (idempotent) - net_linkagg: - name: bond0 - members: - - eth2 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable linkagg - net_linkagg: - name: bond0 - state: down - register: result - -- assert: - that: - - 'result.changed == true' - - '"set interfaces bonding bond0 disable" in result.commands' - -- name: Disable linkagg again (idempotent) - net_linkagg: - name: bond0 - state: down - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Enable linkagg - net_linkagg: - name: bond0 - state: up - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces bonding bond0 disable" in result.commands[0]' - -- name: Enable linkagg again (idempotent) - net_linkagg: - name: bond0 - state: up - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Remove linkagg - net_linkagg: - name: bond0 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1 bond-group" in result.commands' - - '"delete interfaces ethernet eth2 bond-group" in result.commands' - - '"delete interfaces bonding bond0" in result.commands' - -- name: Remove linkagg again (idempotent) - net_linkagg: - name: bond0 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Create collection of linkagg definitions - net_linkagg: - aggregate: - - { name: bond0, members: [eth1] } - - { name: bond1, members: [eth2] } - state: present - register: result - -- 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' - - '"set interfaces bonding bond1 mode 802.3ad" in result.commands' - - '"set interfaces ethernet eth2 bond-group bond1" in result.commands' - -- name: Create collection of linkagg definitions again (idempotent) - net_linkagg: - aggregate: - - { name: bond0, members: [eth1] } - - { name: bond1, members: [eth2] } - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Remove collection of linkagg definitions - net_linkagg: - aggregate: - - name: bond0 - - name: bond1 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete interfaces ethernet eth1 bond-group" in result.commands' - - '"delete interfaces bonding bond0" in result.commands' - - '"delete interfaces ethernet eth2 bond-group" in result.commands' - - '"delete interfaces bonding bond1" in result.commands' - -- name: Remove collection of linkagg definitions again (idempotent) - net_linkagg: - aggregate: - - name: bond0 - - name: bond1 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_lldp/aliases b/test/integration/targets/net_lldp/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_lldp/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_lldp/defaults/main.yaml b/test/integration/targets/net_lldp/defaults/main.yaml deleted file mode 100644 index 9ef5ba51651..00000000000 --- a/test/integration/targets/net_lldp/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/net_lldp/tasks/cli.yaml b/test/integration/targets/net_lldp/tasks/cli.yaml deleted file mode 100644 index d675462dd02..00000000000 --- a/test/integration/targets/net_lldp/tasks/cli.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_lldp/tasks/main.yaml b/test/integration/targets/net_lldp/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_lldp/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_lldp/tasks/netconf.yaml b/test/integration/targets/net_lldp/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_lldp/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_lldp/tests/cli/basic.yaml b/test/integration/targets/net_lldp/tests/cli/basic.yaml deleted file mode 100644 index 29e7b06be12..00000000000 --- a/test/integration/targets/net_lldp/tests/cli/basic.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' diff --git a/test/integration/targets/net_lldp/tests/junos/basic.yaml b/test/integration/targets/net_lldp/tests/junos/basic.yaml deleted file mode 100644 index e79e0a63c4d..00000000000 --- a/test/integration/targets/net_lldp/tests/junos/basic.yaml +++ /dev/null @@ -1,117 +0,0 @@ ---- -- debug: msg="START net_lldp junos/basic.yaml" - -- name: setup - Disable lldp and remove it's configuration - net_lldp: - state: absent - provider: "{{ netconf }}" - -- name: Enable lldp - net_lldp: - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - -- name: Enable lldp (idempotent) - net_lldp: - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: configure lldp parameters and enable lldp - net_lldp: - interval: 10 - hold_multiplier: 5 - transmit_delay: 2 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *advertisement-interval 10") - - result.diff.prepared is search("\+ *transmit-delay 2") - - result.diff.prepared is search("\+ *hold-multiplier 5") - -- name: configure lldp parameters and enable lldp(idempotent) - net_lldp: - interval: 10 - hold_multiplier: 5 - transmit_delay: 2 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: configure lldp parameters and disable lldp - net_lldp: - interval: 10 - hold_multiplier: 5 - transmit_delay: 2 - state: disabled - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *disable") - - "'advertisement-interval 10;' not in result.diff.prepared" - - "'transmit-delay 2;' not in result.diff.prepared" - - "'hold-multiplier 5;' not in result.diff.prepared" - -- name: configure lldp parameters and enable lldp - net_lldp: - interval: 10 - hold_multiplier: 5 - transmit_delay: 2 - state: enabled - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *disable") - - "'advertisement-interval 10;' not in result.diff.prepared" - - "'transmit-delay 2;' not in result.diff.prepared" - - "'hold-multiplier 5;' not in result.diff.prepared" - -- name: Remove lldp configuration and diable lldp - net_lldp: - interval: 10 - hold_multiplier: 5 - transmit_delay: 2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *disable") - - result.diff.prepared is search("\- *advertisement-interval 10") - - result.diff.prepared is search("\- *transmit-delay 2") - - result.diff.prepared is search("\- *hold-multiplier 5") - -- name: Remove lldp (idempotent) - net_lldp: - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" diff --git a/test/integration/targets/net_lldp/tests/netconf/basic.yaml b/test/integration/targets/net_lldp/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_lldp/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_lldp/tests/vyos/basic.yaml b/test/integration/targets/net_lldp/tests/vyos/basic.yaml deleted file mode 100644 index 874a5287ed8..00000000000 --- a/test/integration/targets/net_lldp/tests/vyos/basic.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: Make sure LLDP is not running before tests - vyos_config: - lines: delete service lldp - -- name: Enable LLDP service - net_lldp: - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set service lldp" in result.commands' - -- name: Enable LLDP service again (idempotent) - net_lldp: - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable LLDP service - net_lldp: - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete service lldp" in result.commands' - -- name: - net_lldp: - state: absent - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_lldp_interface/aliases b/test/integration/targets/net_lldp_interface/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_lldp_interface/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_lldp_interface/defaults/main.yaml b/test/integration/targets/net_lldp_interface/defaults/main.yaml deleted file mode 100644 index 9ef5ba51651..00000000000 --- a/test/integration/targets/net_lldp_interface/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/net_lldp_interface/tasks/cli.yaml b/test/integration/targets/net_lldp_interface/tasks/cli.yaml deleted file mode 100644 index d675462dd02..00000000000 --- a/test/integration/targets/net_lldp_interface/tasks/cli.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_lldp_interface/tasks/main.yaml b/test/integration/targets/net_lldp_interface/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_lldp_interface/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_lldp_interface/tasks/netconf.yaml b/test/integration/targets/net_lldp_interface/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_lldp_interface/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_lldp_interface/tests/cli/basic.yaml b/test/integration/targets/net_lldp_interface/tests/cli/basic.yaml deleted file mode 100644 index 29e7b06be12..00000000000 --- a/test/integration/targets/net_lldp_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' diff --git a/test/integration/targets/net_lldp_interface/tests/junos/basic.yaml b/test/integration/targets/net_lldp_interface/tests/junos/basic.yaml deleted file mode 100644 index 185a50ce5af..00000000000 --- a/test/integration/targets/net_lldp_interface/tests/junos/basic.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -- debug: msg="START net_lldp_interface junos/basic.yaml" - -- name: setup - Remove lldp interface configuration - net_lldp_interface: - name: ge-0/0/5 - state: absent - provider: "{{ netconf }}" - -- name: lldp interface configuration - net_lldp_interface: - name: ge-0/0/5 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *interface ge-0/0/5") - -- name: lldp interface configuration (idempotent) - net_lldp_interface: - name: ge-0/0/5 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Deactivate lldp interface configuration - net_lldp_interface: - name: ge-0/0/5 - state: present - active: False - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("! *inactive[:] interface ge-0/0/5") - -- name: Activate lldp interface configuration - net_lldp_interface: - name: ge-0/0/5 - state: present - active: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("! *active[:] interface ge-0/0/5") - -- name: Disable lldp on particular interface - net_lldp_interface: - name: ge-0/0/5 - state: disabled - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *disable") - -- name: Enable lldp on particular interface - net_lldp_interface: - name: ge-0/0/5 - state: enabled - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *disable") - -- name: Delete lldp on particular interface - net_lldp_interface: - name: ge-0/0/5 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *interface ge-0/0/5") - -- name: Delete lldp on particular interface (idempotent) - net_lldp_interface: - name: ge-0/0/5 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- debug: msg="END net_lldp_interface junos/basic.yaml" diff --git a/test/integration/targets/net_lldp_interface/tests/netconf/basic.yaml b/test/integration/targets/net_lldp_interface/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_lldp_interface/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_lldp_interface/tests/vyos/basic.yaml b/test/integration/targets/net_lldp_interface/tests/vyos/basic.yaml deleted file mode 100644 index d9f8f4a156e..00000000000 --- a/test/integration/targets/net_lldp_interface/tests/vyos/basic.yaml +++ /dev/null @@ -1,165 +0,0 @@ ---- -- name: Make sure LLDP is not running before tests - vyos_config: - lines: delete service lldp - -- name: Create LLDP configuration - net_lldp_interface: - name: eth1 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set service lldp interface eth1" in result.commands' - -- name: Create LLDP configuration again (idempotent) - net_lldp_interface: - name: eth1 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable LLDP configuration - net_lldp_interface: - name: eth1 - state: disabled - register: result - -- assert: - that: - - 'result.changed == true' - - '"set service lldp interface eth1 disable" in result.commands' - -- name: Disable LLDP configuration again (idempotent) - net_lldp_interface: - name: eth1 - state: disabled - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Enable LLDP configuration - net_lldp_interface: - name: eth1 - state: enabled - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete service lldp interface eth1 disable" in result.commands' - -- name: Enable LLDP configuration again (idempotent) - net_lldp_interface: - name: eth1 - state: enabled - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete LLDP configuration - net_lldp_interface: - name: eth1 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete service lldp interface eth1" in result.commands' - -- name: Delete LLDP configuration again (idempotent) - net_lldp_interface: - name: eth1 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Create aggregate of LLDP interface configurations - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2 } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set service lldp interface eth1" in result.commands' - - '"set service lldp interface eth2" in result.commands' - -- name: Create aggregate of LLDP interface configurations again (idempotent) - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2 } - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Override LLDP interface configuration on aggregate - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2, state: disabled } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set service lldp interface eth2 disable" in result.commands' - -- name: Override LLDP interface configuration on aggregate again (idempotent) - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2, state: disabled } - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete aggregate of LLDP interface configurations - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2 } - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete service lldp interface eth1" in result.commands' - - '"delete service lldp interface eth2" in result.commands' - -- name: Delete aggregate of LLDP interface configurations (idempotent) - net_lldp_interface: - aggregate: - - { name: eth1 } - - { name: eth2 } - state: absent - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_logging/aliases b/test/integration/targets/net_logging/aliases deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/integration/targets/net_logging/defaults/main.yaml b/test/integration/targets/net_logging/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_logging/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_logging/tasks/cli.yaml b/test/integration/targets/net_logging/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_logging/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_logging/tasks/main.yaml b/test/integration/targets/net_logging/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_logging/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_logging/tasks/netconf.yaml b/test/integration/targets/net_logging/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_logging/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_logging/tests/cli/basic.yaml b/test/integration/targets/net_logging/tests/cli/basic.yaml deleted file mode 100644 index 1e5a3947f03..00000000000 --- a/test/integration/targets/net_logging/tests/cli/basic.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' - -- include: "{{ role_path }}/tests/ios/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/iosxr/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'iosxr' - -- include: "{{ role_path }}/tests/nxos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'nxos' diff --git a/test/integration/targets/net_logging/tests/eos/basic.yaml b/test/integration/targets/net_logging/tests/eos/basic.yaml deleted file mode 100644 index 6cec56e3aae..00000000000 --- a/test/integration/targets/net_logging/tests/eos/basic.yaml +++ /dev/null @@ -1,96 +0,0 @@ ---- -- name: Set up host logging - net_logging: - dest: host - name: 172.16.0.1 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging host 172.16.0.1" in result.commands' - -- name: Set up host logging again (idempotent) - net_logging: - dest: host - name: 172.16.0.1 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete/disable host logging - net_logging: - dest: host - name: 172.16.0.1 - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging host 172.16.0.1" in result.commands' - -- name: Delete/disable host logging (idempotent) - net_logging: - dest: host - name: 172.16.0.1 - state: absent - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Console logging with level warnings - net_logging: - dest: console - level: warnings - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging console warnings" in result.commands' - -- name: Configure monitor logging - net_logging: - dest: monitor - level: debugging - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging monitor debugging" in result.commands' - -- name: remove logging as collection tearDown - net_logging: - aggregate: - - { dest: console, level: warnings, state: absent } - - { dest: monitor, level: debugging, state: absent } - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging console" in result.commands' - - '"no logging monitor" in result.commands' diff --git a/test/integration/targets/net_logging/tests/ios/basic.yaml b/test/integration/targets/net_logging/tests/ios/basic.yaml deleted file mode 100644 index bfff77e4929..00000000000 --- a/test/integration/targets/net_logging/tests/ios/basic.yaml +++ /dev/null @@ -1,129 +0,0 @@ ---- -# ensure logging configs are empty -- name: Remove host logging - net_logging: - dest: host - name: 172.16.0.1 - state: absent - authorize: yes - -- name: Remove console - net_logging: - dest: console - level: warnings - state: absent - authorize: yes - -- name: Remove buffer - net_logging: - dest: buffered - size: 8000 - authorize: yes - state: absent - -# start tests -- name: Set up host logging - net_logging: - dest: host - name: 172.16.0.1 - facility: local7 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging host 172.16.0.1" in result.commands' - - '"logging facility local7" in result.commands' - -- name: Set up host logging again (idempotent) - net_logging: - dest: host - name: 172.16.0.1 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete/disable host logging - net_logging: - dest: host - name: 172.16.0.1 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging host 172.16.0.1" in result.commands' - -- name: Delete/disable host logging (idempotent) - net_logging: - dest: host - name: 172.16.0.1 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Console logging with level warnings - net_logging: - dest: console - level: warnings - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging console warnings" in result.commands' - -- name: Configure Buffer size - net_logging: - dest: buffered - size: 8000 - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging buffered 8000" in result.commands' - -- name: Change logging parameters using aggregate - net_logging: - aggregate: - - { dest: console, level: notifications } - - { dest: buffered, size: 9000 } - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging buffered 9000" in result.commands' - - '"logging console notifications" in result.commands' - -- name: remove logging as collection tearDown - net_logging: - aggregate: - - { dest: console, level: notifications } - - { dest: buffered, size: 9000 } - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging console" in result.commands' - - '"no logging buffered" in result.commands' diff --git a/test/integration/targets/net_logging/tests/iosxr/basic.yaml b/test/integration/targets/net_logging/tests/iosxr/basic.yaml deleted file mode 100644 index a2585e2864b..00000000000 --- a/test/integration/targets/net_logging/tests/iosxr/basic.yaml +++ /dev/null @@ -1,83 +0,0 @@ ---- -- name: Set up host logging - net_logging: - dest: hostnameprefix - name: 172.16.0.1 - state: present - register: result - -- assert: - that: - - 'result.chaned == true' - - '"logging hostnameprefix 172.16.0.1" in result.commands' - - '"logging facility local7" in result.commands' - -- name: Set up host logging again (idempotent) - net_logging: - dest: hostnameprefix - name: 172.16.0.1 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete/disable host logging - net_logging: - dest: hostnameprefix - name: 172.16.0.1 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging hostnameprefix 172.16.0.1" in result.commands' - -- name: Delete/disable host logging (idempotent) - net_logging: - dest: hostnameprefix - name: 172.16.0.1 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Console logging with level warnings - net_logging: - dest: console - level: warnings - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging console warnings" in result.commands' - -- name: Configure monitor logging - net_logging: - dest: monitor - level: debugging - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging monitor debugging" in result.commands' - -- name: remove logging as collection tearDown - net_logging: - aggregate: - - { dest: console, level: warnings, state: absent } - - { dest: monitor, level: debuggning, state: absent } - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging console" in result.commands' - - '"no logging monitor" in result.commands' diff --git a/test/integration/targets/net_logging/tests/junos/basic.yaml b/test/integration/targets/net_logging/tests/junos/basic.yaml deleted file mode 100644 index 10e6ce6469f..00000000000 --- a/test/integration/targets/net_logging/tests/junos/basic.yaml +++ /dev/null @@ -1,392 +0,0 @@ ---- -- debug: msg="START net_logging junos/basic.yaml" - -- name: setup - remove file logging - net_logging: - dest: file - name: test - facility: pfe - level: error - state: absent - provider: "{{ netconf }}" - -- name: Create file logging - net_logging: - dest: file - name: test_file - facility: pfe - level: error - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_file' in config.xml" - - "'pfe' in config.xml" - - "'' in config.xml" - -- name: Create file logging (idempotent) - net_logging: - dest: file - name: test_file - facility: pfe - level: error - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Deactivate logging configuration - net_logging: - dest: file - name: test_file - facility: pfe - level: error - state: present - active: False - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' in config.xml" - - "'' in config.xml" - -- name: Activate logging configuration - net_logging: - dest: file - name: test_file - facility: pfe - level: error - state: present - active: True - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_file' in config.xml" - - "'pfe' in config.xml" - - "'' in config.xml" - -- name: Delete logging configuration - net_logging: - dest: file - name: test_file - facility: pfe - level: error - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_file' not in config.xml" - -- name: Configure console logging - net_logging: - dest: console - facility: kernel - level: emergency - state: present - active: True - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' in config.xml" - - "'kernel' in config.xml" - - "'' in config.xml" - -- name: Configure console logging (idempotent) - net_logging: - dest: console - facility: kernel - level: emergency - state: present - active: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Disable console logging - net_logging: - dest: console - facility: kernel - level: emergency - state: present - active: False - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' in config.xml" - -- name: Delete console logging - net_logging: - dest: console - facility: kernel - level: emergency - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'' not in config.xml" - -- name: Configure logging parameters - net_logging: - size: 65536 - files: 40 - rotate_frequency: 20 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'64k' in config.xml" - - "'40' in config.xml" - - "'20' in config.xml" - -- name: Configure logging parameters (idempotent) - net_logging: - size: 65536 - files: 40 - rotate_frequency: 20 - state: present - active: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Disable logging parameters - net_logging: - size: 65536 - files: 40 - rotate_frequency: 20 - state: present - active: False - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'64k' in config.xml" - - "'40' in config.xml" - - "'20' in config.xml" - -- name: Activate logging parameters - net_logging: - size: 65536 - files: 40 - rotate_frequency: 20 - state: present - active: True - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'64k' in config.xml" - - "'40' in config.xml" - - "'20' in config.xml" - -- name: Delete logging parameters - net_logging: - size: 65536 - files: 40 - rotate_frequency: 20 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'64k' not in config.xml" - - "'40' not in config.xml" - - "'20' not in config.xml" - -- name: Seup file logging using aggregate - net_logging: - aggregate: - - {dest: file, name: test-1, facility: pfe, level: critical, state: absent} - - {dest: file, name: test-2, facility: kernel, level: emergency, state: absent} - provider: "{{ netconf }}" - register: result - -- name: Configure file logging using aggregate - net_logging: - aggregate: - - {dest: file, name: test-1, facility: pfe, level: critical, active: True} - - {dest: file, name: test-2, facility: kernel, level: emergency, active: True} - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\+ *file test-1") - - result.diff.prepared is search("\+ *pfe critical") - - result.diff.prepared is search("\+ *file test-2") - - result.diff.prepared is search("\+ *kernel emergency") - -- name: Deactivate file logging configuration using aggregate - net_logging: - aggregate: - - dest: file - name: test-1 - facility: pfe - level: critical - - dest: file - name: test-2 - facility: kernel - level: emergency - active: False - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("! *inactive[:] file test-1") - - result.diff.prepared is search("! *inactive[:] pfe") - - result.diff.prepared is search("! *inactive[:] file test-2") - - result.diff.prepared is search("! *inactive[:] kernel") - -- name: activate file logging configuration using aggregate - net_logging: - aggregate: - - { dest: file, name: test-1, facility: pfe, level: critical } - - { dest: file, name: test-2, facility: kernel, level: emergency } - active: True - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("! *active[:] file test-1") - - result.diff.prepared is search("! *active[:] pfe") - - result.diff.prepared is search("! *active[:] file test-2") - - result.diff.prepared is search("! *active[:] kernel") - -- name: Delete file logging using aggregate - net_logging: - aggregate: - - { dest: file, name: test-1, facility: pfe, level: critical } - - { dest: file, name: test-2, facility: kernel, level: emergency } - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\- *file test-1") - - result.diff.prepared is search("\- *pfe critical") - - result.diff.prepared is search("\- *file test-2") - - result.diff.prepared is search("\- *kernel emergency") - -- name: Delete file logging using aggregate (idempotent) - net_logging: - aggregate: - - { dest: file, name: test-1, facility: pfe, level: critical } - - { dest: file, name: test-2, facility: kernel, level: emergency } - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" diff --git a/test/integration/targets/net_logging/tests/netconf/basic.yaml b/test/integration/targets/net_logging/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_logging/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_logging/tests/nxos/basic.yaml b/test/integration/targets/net_logging/tests/nxos/basic.yaml deleted file mode 100644 index 24913161bd2..00000000000 --- a/test/integration/targets/net_logging/tests/nxos/basic.yaml +++ /dev/null @@ -1,90 +0,0 @@ ---- -- name: Set up console logging - net_logging: - dest: console - dest_level: 0 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging console 0" in result.commands' - -- name: Set up console logging again (idempotent) - net_logging: - dest: console - dest_level: 0 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Delete/disable console logging - net_logging: - dest: console - dest_level: 0 - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging console" in result.commands' - -- name: Delete/disable console logging (idempotent) - net_logging: - dest: console - dest_level: 0 - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Logfile logging with level - net_logging: - dest: logfile - name: test - dest_level: 0 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging logfile test 0" in result.commands' - -- name: Configure facility with level - net_logging: - facility: daemon - facility_level: 0 - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging level daemon 0" in result.commands' - -- name: remove logging as collection tearDown - net_logging: - aggregate: - - { dest: logfile, name: test, dest_level: 0, state: absent } - - { facility: daemon, facility_level: 0, state: absent } - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging logfile" in result.commands' - - '"no logging level daemon" in result.commands' diff --git a/test/integration/targets/net_logging/tests/vyos/basic.yaml b/test/integration/targets/net_logging/tests/vyos/basic.yaml deleted file mode 100644 index 8fda0847986..00000000000 --- a/test/integration/targets/net_logging/tests/vyos/basic.yaml +++ /dev/null @@ -1,124 +0,0 @@ ---- -- name: set-up logging - net_logging: - dest: console - facility: all - level: info - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set system syslog console facility all level info" in result.commands' - -- name: set-up logging again (idempotent) - net_logging: - dest: console - facility: all - level: info - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: file logging - net_logging: - dest: file - name: test - facility: all - level: notice - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set system syslog file test facility all level notice" in result.commands' - -- name: file logging again (idempotent) - net_logging: - dest: file - name: test - facility: all - level: notice - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: delete logging - net_logging: - dest: file - name: test - facility: all - level: notice - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete system syslog file test facility all level notice" in result.commands' - -- name: delete logging again (idempotent) - net_logging: - dest: file - name: test - facility: all - level: notice - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Add logging collections - net_logging: - aggregate: - - { dest: file, name: test1, facility: all, level: info } - - { dest: file, name: test2, facility: news, level: debug } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set system syslog file test1 facility all level info" in result.commands' - - '"set system syslog file test2 facility news level debug" in result.commands' - -- name: Add and remove logging collections with overrides - net_logging: - aggregate: - - { dest: console, facility: all, level: info } - - { dest: file, name: test1, facility: all, level: info, state: absent } - - { dest: console, facility: daemon, level: warning } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete system syslog file test1 facility all level info" in result.commands' - - '"set system syslog console facility daemon level warning" in result.commands' - -- name: Remove logging collections - net_logging: - aggregate: - - { dest: console, facility: all, level: info } - - { dest: console, facility: daemon, level: warning } - - { dest: file, name: test2, facility: news, level: debug } - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete system syslog console facility all level info" in result.commands' - - '"delete system syslog console facility daemon level warning" in result.commands' - - '"delete system syslog file test2 facility news level debug" in result.commands' diff --git a/test/integration/targets/net_static_route/aliases b/test/integration/targets/net_static_route/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_static_route/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_static_route/defaults/main.yaml b/test/integration/targets/net_static_route/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_static_route/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_static_route/tasks/cli.yaml b/test/integration/targets/net_static_route/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_static_route/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_static_route/tasks/main.yaml b/test/integration/targets/net_static_route/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_static_route/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_static_route/tasks/netconf.yaml b/test/integration/targets/net_static_route/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_static_route/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_static_route/tests/cli/basic.yaml b/test/integration/targets/net_static_route/tests/cli/basic.yaml deleted file mode 100644 index aab6114739a..00000000000 --- a/test/integration/targets/net_static_route/tests/cli/basic.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- include: "{{ role_path }}/tests/ios/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' - -- include: "{{ role_path }}/tests/vyos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_static_route/tests/eos/basic.yaml b/test/integration/targets/net_static_route/tests/eos/basic.yaml deleted file mode 100644 index 0d5b07f4478..00000000000 --- a/test/integration/targets/net_static_route/tests/eos/basic.yaml +++ /dev/null @@ -1,102 +0,0 @@ ---- -- name: setup - remove config used in test - net_static_route: - aggregate: - - { address: 192.168.3.0/24, next_hop: 192.168.0.1 } - - { address: 192.168.4.0/24, next_hop: 192.168.0.1 } - - { address: 192.168.5.0/24, next_hop: 192.168.0.1 } - authorize: yes - state: absent - provider: "{{ cli }}" - -- name: configure static route - net_static_route: &single_route - address: 192.168.3.0/24 - next_hop: 192.168.0.1 - admin_distance: 2 - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip route 192.168.3.0/24 192.168.0.1 2' in result.commands" - -- name: configure static route(Idempotence) - net_static_route: *single_route - register: result - -- assert: - that: - - "result.changed == false" - -- name: delete static route - net_static_route: &delete_single - address: 192.168.3.0/24 - next_hop: 192.168.0.1 - admin_distance: 2 - authorize: yes - provider: "{{ cli }}" - state: absent - register: result - -- assert: - that: - - "result.changed == true" - - "'no ip route 192.168.3.0/24 192.168.0.1' in result.commands" - -- name: delete static route - net_static_route: *delete_single - register: result - -- assert: - that: - - "result.changed == false" - -- name: configure static routes using aggregate - net_static_route: &configure_aggregate - aggregate: - - { address: 192.168.4.0/24, next_hop: 192.168.0.1 } - - { address: 192.168.5.0/24, next_hop: 192.168.0.1 } - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip route 192.168.4.0/24 192.168.0.1 1' in result.commands" - - "'ip route 192.168.5.0/24 192.168.0.1 1' in result.commands" - -- name: configure static routes using aggregate(Idemporence) - net_static_route: *configure_aggregate - register: result - -- assert: - that: - - "result.changed == false" - -- name: delete static routes using aggregate - net_static_route: &delete_aggregate - aggregate: - - { address: 192.168.4.0/24, next_hop: 192.168.0.1 } - - { address: 192.168.5.0/24, next_hop: 192.168.0.1 } - authorize: yes - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'no ip route 192.168.4.0/24 192.168.0.1' in result.commands" - - "'no ip route 192.168.5.0/24 192.168.0.1' in result.commands" - -- name: delete static routes using aggregate(Idempotence) - net_static_route: *delete_aggregate - register: result - -- assert: - that: - - "result.changed == false" diff --git a/test/integration/targets/net_static_route/tests/ios/basic.yaml b/test/integration/targets/net_static_route/tests/ios/basic.yaml deleted file mode 100644 index 665ef100c0f..00000000000 --- a/test/integration/targets/net_static_route/tests/ios/basic.yaml +++ /dev/null @@ -1,131 +0,0 @@ ---- -- debug: msg="START net_static_route ios/basic.yaml" - -- name: create static route - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["ip route 172.16.31.0 255.255.255.0 10.0.0.8 1"]' - -- name: create static route again (idempotent) - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: modify admin distance of static route - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 2 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["ip route 172.16.31.0 255.255.255.0 10.0.0.8 2"]' - -- name: modify admin distance of static route again (idempotent) - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 2 - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: delete static route - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 2 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["no ip route 172.16.31.0 255.255.255.0 10.0.0.8"]' - -- name: delete static route again (idempotent) - net_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 2 - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Add static route collections - net_static_route: - aggregate: - - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["ip route 172.16.32.0 255.255.255.0 10.0.0.8 1", "ip route 172.16.33.0 255.255.255.0 10.0.0.8 1"]' - -- name: Add and remove static route collections with overrides - net_static_route: - aggregate: - - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8, state: absent } - - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - state: present - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["no ip route 172.16.33.0 255.255.255.0 10.0.0.8", "ip route 172.16.34.0 255.255.255.0 10.0.0.8 1"]' - -- name: Remove static route collections - net_static_route: - aggregate: - - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - state: absent - authorize: yes - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["no ip route 172.16.32.0 255.255.255.0 10.0.0.8", "no ip route 172.16.34.0 255.255.255.0 10.0.0.8"]' diff --git a/test/integration/targets/net_static_route/tests/junos/basic.yaml b/test/integration/targets/net_static_route/tests/junos/basic.yaml deleted file mode 100644 index 7a89246d0b4..00000000000 --- a/test/integration/targets/net_static_route/tests/junos/basic.yaml +++ /dev/null @@ -1,134 +0,0 @@ ---- -- debug: msg="START net_static_route junos/basic.yaml" - -- name: setup - remove static route - net_static_route: - address: 1.1.1.0/24 - state: absent - provider: "{{ netconf }}" - -- name: Confgiure static route - net_static_route: - prefix: 1.1.1.0/24 - next_hop: 3.3.3.3 - admin_distance: 10 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'1.1.1.0/24' in config.xml" - - "'3.3.3.3' in config.xml" - -- name: Confgiure static route (idempotent) - net_static_route: - prefix: 1.1.1.0/24 - next_hop: 3.3.3.3 - admin_distance: 10 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete static route - net_static_route: - prefix: 1.1.1.0/24 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'1.1.1.0/24' not in config.xml" - -- name: Delete static route (idempotent) - net_static_route: - prefix: 1.1.1.0/24 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Setup static route for aggegrate - net_static_route: - aggregate: - - {address: 4.4.4.0/24, state: absent} - - {address: 5.5.5.0/24, state: absent} - provider: "{{ netconf }}" - -- name: Confgiure static route using aggegrate - net_static_route: - aggregate: - - {address: 4.4.4.0/24, next_hop: 3.3.3.3, preference: 10, qualified_next_hop: 5.5.5.5, qualified_preference: 30} - - {address: 5.5.5.0/24, next_hop: 6.6.6.6, preference: 11, qualified_next_hop: 7.7.7.7, qualified_preference: 12} - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\+ *route 4.4.4.0/24") - - result.diff.prepared is search("\+ *next-hop 3.3.3.3") - - result.diff.prepared is search("\+ *qualified-next-hop 5.5.5.5") - - result.diff.prepared is search("\+ *preference 30") - - result.diff.prepared is search("\+ *preference 10") - - result.diff.prepared is search("\+ *route 5.5.5.0/24") - - result.diff.prepared is search("\+ *next-hop 6.6.6.6") - - result.diff.prepared is search("\+ *qualified-next-hop 7.7.7.7") - - result.diff.prepared is search("\+ *preference 12") - - result.diff.prepared is search("\+ *preference 11") - -- name: Delete static route configuration using aggegrate - net_static_route: - aggregate: - - {address: 4.4.4.0/24, state: absent} - - {address: 5.5.5.0/24, state: absent} - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\- *route 4.4.4.0/24") - - result.diff.prepared is search("\- *next-hop 3.3.3.3") - - result.diff.prepared is search("\- *qualified-next-hop 5.5.5.5") - - result.diff.prepared is search("\- *preference 30") - - result.diff.prepared is search("\- *preference 10") - - result.diff.prepared is search("\- *route 5.5.5.0/24") - - result.diff.prepared is search("\- *next-hop 6.6.6.6") - - result.diff.prepared is search("\- *qualified-next-hop 7.7.7.7") - - result.diff.prepared is search("\- *preference 12") - - result.diff.prepared is search("\- *preference 11") - -- name: Delete static route configuration using aggegrate (idempotent) - net_static_route: - aggregate: - - {address: 4.4.4.0/24, state: absent} - - {address: 5.5.5.0/24, state: absent} - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" diff --git a/test/integration/targets/net_static_route/tests/netconf/basic.yaml b/test/integration/targets/net_static_route/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_static_route/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_static_route/tests/vyos/basic.yaml b/test/integration/targets/net_static_route/tests/vyos/basic.yaml deleted file mode 100644 index 7b06f619283..00000000000 --- a/test/integration/targets/net_static_route/tests/vyos/basic.yaml +++ /dev/null @@ -1,118 +0,0 @@ ---- -- name: create static route - net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set protocols static route 172.24.0.0/24 next-hop 192.168.42.64" in result.commands' - -- name: create static route again (idempotent) - net_static_route: - prefix: 172.24.0.0 - mask: 24 - next_hop: 192.168.42.64 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: modify admin distance of static route - net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set protocols static route 172.24.0.0/24 next-hop 192.168.42.64 distance 1" in result.commands' - -- name: modify admin distance of static route again (idempotent) - net_static_route: - prefix: 172.24.0.0 - mask: 24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: present - register: result - -- assert: - that: - - 'result.changed == false' - -- name: delete static route - net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete protocols static route 172.24.0.0/24" in result.commands' - -- name: delete static route again (idempotent) - net_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: absent - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Add static route collections - net_static_route: - aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"set protocols static route 172.24.1.0/24 next-hop 192.168.42.64" in result.commands' - - '"set protocols static route 172.24.2.0/24 next-hop 192.168.42.64" in result.commands' - -- name: Add and remove static route collections with overrides - net_static_route: - aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent } - - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete protocols static route 172.24.2.0/24" in result.commands' - - '"set protocols static route 172.24.3.0/24 next-hop 192.168.42.64" in result.commands' - -- name: Remove static route collections - net_static_route: - aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"delete protocols static route 172.24.1.0/24" in result.commands' - - '"delete protocols static route 172.24.3.0/24" in result.commands' diff --git a/test/integration/targets/net_system/aliases b/test/integration/targets/net_system/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_system/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_system/defaults/main.yaml b/test/integration/targets/net_system/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_system/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_system/tasks/cli.yaml b/test/integration/targets/net_system/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_system/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_system/tasks/main.yaml b/test/integration/targets/net_system/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_system/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_system/tasks/netconf.yaml b/test/integration/targets/net_system/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_system/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_system/tests/cli/set_name_servers.yaml b/test/integration/targets/net_system/tests/cli/set_name_servers.yaml deleted file mode 100644 index ad5fbf68238..00000000000 --- a/test/integration/targets/net_system/tests/cli/set_name_servers.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- debug: msg="START cli/set_name_servers.yaml" - -- include: "{{ role_path }}/tests/ios/set_name_servers.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'ios' - -- include: "{{ role_path }}/tests/iosxr/set_name_servers.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'iosxr' - -- include: "{{ role_path }}/tests/nxos/set_name_servers.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'nxos' - -- include: "{{ role_path }}/tests/eos/set_name_servers.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' - -- include: "{{ role_path }}/tests/vyos/set_name_servers.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'vyos' - -- debug: msg="END cli/set_name_servers.yaml" diff --git a/test/integration/targets/net_system/tests/eos/set_name_servers.yaml b/test/integration/targets/net_system/tests/eos/set_name_servers.yaml deleted file mode 100644 index 4cb1b516024..00000000000 --- a/test/integration/targets/net_system/tests/eos/set_name_servers.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -- debug: msg="START eos/set_name_servers.yaml" - -- name: setup - eos_config: - lines: - - no ip name-server - - vrf definition ansible - match: none - provider: "{{ cli }}" - -- name: configure name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 3 - - "'ip name-server 1.1.1.1' in result.commands" - - "'ip name-server 2.2.2.2' in result.commands" - - "'ip name-server 3.3.3.3' in result.commands" - -- name: verify name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: remove one - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 1 - - "'no ip name-server 3.3.3.3' in result.commands" - -- name: teardown - eos_config: - lines: - - no ip domain lookup source-interface - - no vrf definition ansible - match: none - provider: "{{ cli }}" - -- debug: msg="END eos/set_name_servers.yaml" diff --git a/test/integration/targets/net_system/tests/ios/set_name_servers.yaml b/test/integration/targets/net_system/tests/ios/set_name_servers.yaml deleted file mode 100644 index 5b1cb539146..00000000000 --- a/test/integration/targets/net_system/tests/ios/set_name_servers.yaml +++ /dev/null @@ -1,63 +0,0 @@ ---- -- debug: msg="START ios/set_name_servers.yaml" - -- name: setup - ios_config: - lines: - - no ip name-server - match: none - authorize: yes - - -- name: configure name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - authorize: yes - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 3 - - "'ip name-server 1.1.1.1' in result.commands" - - "'ip name-server 2.2.2.2' in result.commands" - - "'ip name-server 3.3.3.3' in result.commands" - -- name: verify name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - authorize: yes - register: result - -- assert: - that: - - result.changed == false - -- name: remove one - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - authorize: yes - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 1 - - "'no ip name-server 3.3.3.3' in result.commands" - -- name: teardown - ios_config: - lines: - - no ip domain lookup source-interface - match: none - authorize: yes - -- debug: msg="END ios/set_name_servers.yaml" diff --git a/test/integration/targets/net_system/tests/iosxr/set_name_servers.yaml b/test/integration/targets/net_system/tests/iosxr/set_name_servers.yaml deleted file mode 100644 index 339a83d5a47..00000000000 --- a/test/integration/targets/net_system/tests/iosxr/set_name_servers.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- debug: msg="START iosxr/set_name_servers.yaml" - -- name: setup - iosxr_config: - lines: - - no ip name-server 1.1.1.1 - - no ip name-server 2.2.2.2 - - no ip name-server 3.3.3.3 - match: none - -- name: configure name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 3 - - "'domain name-server 1.1.1.1' in result.commands" - - "'domain name-server 2.2.2.2' in result.commands" - - "'domain name-server 3.3.3.3' in result.commands" - -- name: verify name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - register: result - -- assert: - that: - - result.changed == false - -- name: remove one - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 1 - - "'no domain name-server 3.3.3.3' in result.commands" - -# FIXME: No teardown -# -- debug: msg="END iosxr/set_name_servers.yaml" diff --git a/test/integration/targets/net_system/tests/junos/basic.yaml b/test/integration/targets/net_system/tests/junos/basic.yaml deleted file mode 100644 index ab5c0678ee8..00000000000 --- a/test/integration/targets/net_system/tests/junos/basic.yaml +++ /dev/null @@ -1,248 +0,0 @@ ---- -- debug: msg="START net_system junos/basic.yaml" - -- name: setup - remove hostname - net_system: - hostname: vsrx01 - state: absent - provider: "{{ netconf }}" - -- name: Set hostname - net_system: - hostname: vsrx01 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'vsrx01' in config.xml" - -- name: Set hostname (idempotent) - net_system: - hostname: vsrx01 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete hostname configuration - net_system: - hostname: vsrx01 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'vsrx01' not in config.xml" - -- name: Teardown - set hostname - net_system: - hostname: vsrx01 - state: present - provider: "{{ netconf }}" - -- name: setup - remove domain name - net_system: - domain_name: ansible.com - state: absent - provider: "{{ netconf }}" - -- name: Set domain name - net_system: - domain_name: ansible.com - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ansible.com' in config.xml" - -- name: Set domain name (idempotent) - net_system: - domain_name: ansible.com - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete domain name - net_system: - domain_name: ansible.com - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'ansible.com' not in config.xml" - -- name: Teardown - set domain name - net_system: - domain_name: ansible.com - state: present - provider: "{{ netconf }}" - -- name: Setup - delete domain search - net_system: - domain_search: - - test.com - - sample.com - state: absent - provider: "{{ netconf }}" - register: result - -- name: Set domain search - net_system: - domain_search: - - test.com - - sample.com - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test.com' in config.xml" - - "'sample.com' in config.xml" - -- name: Set domain search - net_system: - domain_search: - - test.com - - sample.com - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete domain search - net_system: - domain_search: - - test.com - - sample.com - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test.com' not in config.xml" - - "'sample.com' not in config.xml" - -- name: Setup - delete name servers - net_system: - name_servers: - - 8.8.8.8 - - 8.8.4.4 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Set name servers - net_system: - name_servers: - - 8.8.8.8 - - 8.8.4.4 - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'8.8.8.8' in config.xml" - - "'8.8.4.4' in config.xml" - -- name: Set name servers (idempotent) - net_system: - name_servers: - - 8.8.8.8 - - 8.8.4.4 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete name servers - net_system: - name_servers: - - 8.8.8.8 - - 8.8.4.4 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'8.8.8.8' not in config.xml" - - "'8.8.4.4' not in config.xml" diff --git a/test/integration/targets/net_system/tests/netconf/basic.yaml b/test/integration/targets/net_system/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_system/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_system/tests/nxos/set_name_servers.yaml b/test/integration/targets/net_system/tests/nxos/set_name_servers.yaml deleted file mode 100644 index 57f393617ad..00000000000 --- a/test/integration/targets/net_system/tests/nxos/set_name_servers.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: msg="START nxos/set_name_servers.yaml" - -- name: setup - nxos_config: - lines: - - no ip name-server 1.1.1.1 - - no ip name-server 2.2.2.2 - - no ip name-server 3.3.3.3 - match: none - provider: "{{ cli }}" - -- name: configure name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 3 - - "'ip name-server 1.1.1.1' in result.commands" - - "'ip name-server 2.2.2.2' in result.commands" - - "'ip name-server 3.3.3.3' in result.commands" - -- name: verify name_servers - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: remove one - net_system: - name_servers: - - 1.1.1.1 - - 2.2.2.2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 1 - - "'no ip name-server 3.3.3.3' in result.commands" - -- name: teardown - nxos_config: - lines: - - no ip lookup source-interface - match: none - provider: "{{ cli }}" - ignore_errors: yes - # FIXME Copied from iosxr, not sure what we need here - -- debug: msg="END nxos/set_name_servers.yaml" diff --git a/test/integration/targets/net_user/aliases b/test/integration/targets/net_user/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_user/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_user/defaults/main.yaml b/test/integration/targets/net_user/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_user/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_user/tasks/cli.yaml b/test/integration/targets/net_user/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_user/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_user/tasks/main.yaml b/test/integration/targets/net_user/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_user/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_user/tasks/netconf.yaml b/test/integration/targets/net_user/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_user/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_user/tests/cli/userprivilege.yaml b/test/integration/targets/net_user/tests/cli/userprivilege.yaml deleted file mode 100644 index 3a2ae58d61a..00000000000 --- a/test/integration/targets/net_user/tests/cli/userprivilege.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/eos/userprivilege.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_user/tests/cli/userrole.yaml b/test/integration/targets/net_user/tests/cli/userrole.yaml deleted file mode 100644 index bc2254280c5..00000000000 --- a/test/integration/targets/net_user/tests/cli/userrole.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- include: "{{ role_path }}/tests/nxos/userrole.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'nxos' - -- include: "{{ role_path }}/tests/eos/userrole.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_user/tests/cli/users.yaml b/test/integration/targets/net_user/tests/cli/users.yaml deleted file mode 100644 index bd3de7894bc..00000000000 --- a/test/integration/targets/net_user/tests/cli/users.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- include: "{{ role_path }}/tests/nxos/users.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'nxos' - -- include: "{{ role_path }}/tests/eos/users.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_user/tests/eos/userprivilege.yaml b/test/integration/targets/net_user/tests/eos/userprivilege.yaml deleted file mode 100644 index 36ad907eeb2..00000000000 --- a/test/integration/targets/net_user/tests/eos/userprivilege.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Setup - net_user: &clear_netop - name: netop - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Set user to privilege level 15 - net_user: - name: netop - nopassword: yes - privilege: 15 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username netop privilege 15", "username netop nopassword"]' - -- name: tearDown - net_user: *clear_netop diff --git a/test/integration/targets/net_user/tests/eos/userrole.yaml b/test/integration/targets/net_user/tests/eos/userrole.yaml deleted file mode 100644 index c6bbcc8dac4..00000000000 --- a/test/integration/targets/net_user/tests/eos/userrole.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: Setup - net_user: &clear_users - aggregate: - - name: netop - - name: netend - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Set multiple users role - net_user: - aggregate: - - name: netop - - name: netend - nopassword: yes - role: network-operator - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username netop role network-operator", "username netop nopassword", "username netend role network-operator", "username netend nopassword"]' - -- name: tearDown - net_user: *clear_users diff --git a/test/integration/targets/net_user/tests/eos/users.yaml b/test/integration/targets/net_user/tests/eos/users.yaml deleted file mode 100644 index e1795687683..00000000000 --- a/test/integration/targets/net_user/tests/eos/users.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: Setup - net_user: &clear_netop - name: netop - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Create user - net_user: - name: netop - nopassword: yes - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username netop nopassword"]' - -- name: tearDown - net_user: *clear_netop - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["no username netop"]' diff --git a/test/integration/targets/net_user/tests/junos/basic.yaml b/test/integration/targets/net_user/tests/junos/basic.yaml deleted file mode 100644 index d77dfafe93e..00000000000 --- a/test/integration/targets/net_user/tests/junos/basic.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -- debug: msg="START net_user junos/basic.yaml" - -- name: setup - remove user - net_user: - name: test_user - state: absent - provider: "{{ netconf }}" - -- name: Create user - net_user: - name: test_user - state: present - role: operator - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_user' in config.xml" - - "'operator' in config.xml" - -- name: Create user again (idempotent) - net_user: - name: test_user - state: present - role: operator - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete user - net_user: - name: test_user - state: absent - role: operator - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_user' not in config.xml" - - "'test_user' not in config.xml" - -- name: Delete user again (idempotent check) - net_user: - name: test_user - state: absent - role: operator - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Teardown list of users - net_user: - aggregate: - - {name: test_user1, state: absent} - - {name: test_user2, state: absent} - provider: "{{ netconf }}" - register: result - -- name: Create list of users - net_user: - aggregate: - - {name: test_user1, role: operator, state: present} - - {name: test_user2, role: read-only, state: present} - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_user1' in config.xml" - - "'test_user2' in config.xml" - -- name: Delete list of users - net_user: - aggregate: - - {name: test_user1, role: operator, state: absent} - - {name: test_user2, role: read-only, state: absent} - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test_user1' not in config.xml" - - "'test_user2' not in config.xml" diff --git a/test/integration/targets/net_user/tests/netconf/basic.yaml b/test/integration/targets/net_user/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_user/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_user/tests/nxos/userrole.yaml b/test/integration/targets/net_user/tests/nxos/userrole.yaml deleted file mode 100644 index 1c062fa5a29..00000000000 --- a/test/integration/targets/net_user/tests/nxos/userrole.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Set multiple users role - net_user: - aggregate: - - name: netop - - name: netend - role: network-operator - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"role network-operator" in result.commands' - -- name: tearDown - net_user: - purge: yes - provider: "{{ cli }}" diff --git a/test/integration/targets/net_user/tests/nxos/users.yaml b/test/integration/targets/net_user/tests/nxos/users.yaml deleted file mode 100644 index 2719173d9e6..00000000000 --- a/test/integration/targets/net_user/tests/nxos/users.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Create user - net_user: - name: netop - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username netop"]' - -- name: Purge users - net_user: - purge: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["no username netop"]' diff --git a/test/integration/targets/net_vlan/aliases b/test/integration/targets/net_vlan/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_vlan/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_vlan/defaults/main.yaml b/test/integration/targets/net_vlan/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_vlan/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_vlan/tasks/cli.yaml b/test/integration/targets/net_vlan/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_vlan/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_vlan/tasks/main.yaml b/test/integration/targets/net_vlan/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_vlan/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_vlan/tasks/netconf.yaml b/test/integration/targets/net_vlan/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_vlan/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_vlan/tests/cli/basic.yaml b/test/integration/targets/net_vlan/tests/cli/basic.yaml deleted file mode 100644 index b1bec77f7ca..00000000000 --- a/test/integration/targets/net_vlan/tests/cli/basic.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' diff --git a/test/integration/targets/net_vlan/tests/eos/basic.yaml b/test/integration/targets/net_vlan/tests/eos/basic.yaml deleted file mode 100644 index 081b643c6fe..00000000000 --- a/test/integration/targets/net_vlan/tests/eos/basic.yaml +++ /dev/null @@ -1,69 +0,0 @@ ---- -- debug: msg="START net_vlan eos/basic.yaml" - -- name: setup - remove vlan - net_vlan: - vlan_id: 4000 - name: test-vlan - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Create vlan - net_vlan: - vlan_id: 4000 - name: test-vlan - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == true" - - "'vlan 4000' in result.commands" - - "'name test-vlan' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Create vlan again (idempotent) - net_vlan: - vlan_id: 4000 - name: test-vlan - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - -- name: Change vlan name and state - net_vlan: - vlan_id: 4000 - name: test-vlan2 - state: suspend - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'vlan 4000' in result.commands" - - "'name test-vlan2' in result.commands" - - "'state suspend' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_vlan/tests/junos/basic.yaml b/test/integration/targets/net_vlan/tests/junos/basic.yaml deleted file mode 100644 index 4baa1f750d1..00000000000 --- a/test/integration/targets/net_vlan/tests/junos/basic.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -- debug: msg="START net_vlan junos/basic.yaml" - -- name: setup - remove vlan - net_vlan: - vlan_id: 100 - name: test-vlan - state: absent - provider: "{{ netconf }}" - -- name: Create vlan - net_vlan: - vlan_id: 100 - name: test-vlan - state: present - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test-vlan' in config.xml" - - "'100' in config.xml" - -- name: Create vlan again (idempotent) - net_vlan: - vlan_id: 100 - name: test-vlan - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Delete vlan - net_vlan: - vlan_id: 100 - name: test-vlan - state: absent - provider: "{{ netconf }}" - register: result - -- name: Get running configuration - junos_rpc: - rpc: get-configuration - provider: "{{ netconf }}" - register: config - -- assert: - that: - - "result.changed == true" - - "'test-vlan' not in config.xml" - -- name: Setup vlan configuration for aggregate - net_vlan: - aggregate: - - vlan_id: 159 - name: test_vlan_1 - - vlan_id: 160 - name: test_vlan_2 - state: absent - provider: "{{ netconf }}" - -- name: Create vlan configuration using aggregate - net_vlan: - aggregate: - - { vlan_id: 159, name: test_vlan_1, description: test vlan-1 } - - { vlan_id: 160, name: test_vlan_2, description: test vlan-2 } - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\+ *test_vlan_1") - - result.diff.prepared is search("\+ *vlan-id 159") - - result.diff.prepared is search("\+ *test_vlan_2") - - result.diff.prepared is search("\+ *vlan-id 160") - -- name: Delete vlan configuration using aggregate - net_vlan: - aggregate: - - vlan_id: 159 - name: test_vlan_1 - - vlan_id: 160 - name: test_vlan_2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == true' - - result.diff.prepared is search("\- *test_vlan_1") - - result.diff.prepared is search("\- *vlan-id 159") - - result.diff.prepared is search("\- *test_vlan_2") - - result.diff.prepared is search("\- *vlan-id 160") - -- name: Delete vlan configuration using aggregate (idempotent) - net_vlan: - aggregate: - - vlan_id: 159 - name: test_vlan_1 - - vlan_id: 160 - name: test_vlan_2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - 'result.changed == false' diff --git a/test/integration/targets/net_vlan/tests/netconf/basic.yaml b/test/integration/targets/net_vlan/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_vlan/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/net_vrf/aliases b/test/integration/targets/net_vrf/aliases deleted file mode 100644 index 93151a8d9df..00000000000 --- a/test/integration/targets/net_vrf/aliases +++ /dev/null @@ -1 +0,0 @@ -network/ci diff --git a/test/integration/targets/net_vrf/defaults/main.yaml b/test/integration/targets/net_vrf/defaults/main.yaml deleted file mode 100644 index 5f709c5aac1..00000000000 --- a/test/integration/targets/net_vrf/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/net_vrf/tasks/cli.yaml b/test/integration/targets/net_vrf/tasks/cli.yaml deleted file mode 100644 index 46d86dd6988..00000000000 --- a/test/integration/targets/net_vrf/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_vrf/tasks/main.yaml b/test/integration/targets/net_vrf/tasks/main.yaml deleted file mode 100644 index af08869c922..00000000000 --- a/test/integration/targets/net_vrf/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: netconf.yaml, tags: ['netconf'] } diff --git a/test/integration/targets/net_vrf/tasks/netconf.yaml b/test/integration/targets/net_vrf/tasks/netconf.yaml deleted file mode 100644 index 1286b354228..00000000000 --- a/test/integration/targets/net_vrf/tasks/netconf.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/net_vrf/tests/cli/basic.yaml b/test/integration/targets/net_vrf/tests/cli/basic.yaml deleted file mode 100644 index ed9c8327e79..00000000000 --- a/test/integration/targets/net_vrf/tests/cli/basic.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- debug: msg="START cli/set_name_servers.yaml" - -- include: "{{ role_path }}/tests/eos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'eos' - -- debug: msg="END cli/set_name_servers.yaml" diff --git a/test/integration/targets/net_vrf/tests/eos/basic.yaml b/test/integration/targets/net_vrf/tests/eos/basic.yaml deleted file mode 100644 index 0c110d360f2..00000000000 --- a/test/integration/targets/net_vrf/tests/eos/basic.yaml +++ /dev/null @@ -1,116 +0,0 @@ ---- - -- name: setup - remove vrf - net_vrf: - name: test - state: absent - authorize: yes - provider: "{{ cli }}" - -- name: Create vrf - net_vrf: - name: test - rd: 1:200 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'vrf definition test' in result.commands" - - "'rd 1:200' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Create vrf again (idempotent) - net_vrf: - name: test - rd: 1:200 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - -- name: Modify rd - net_vrf: - name: test - rd: 1:201 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'vrf definition test' in result.commands" - - "'rd 1:201' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Modify rd again (idempotent) - net_vrf: - name: test - rd: 1:201 - state: present - authorize: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - -- name: Add Ethernet2 to vrf - net_vrf: - name: test - rd: 1:201 - state: present - authorize: yes - interfaces: - - Ethernet2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'interface Ethernet2' in result.commands" - - "'vrf forwarding test' in result.commands" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "'ansible_1' in result.session_name" - -- name: Add Ethernet2 to vrf again (idempotent) - net_vrf: - name: test - rd: 1:201 - state: present - authorize: yes - interfaces: - - Ethernet2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - # Ensure sessions contains epoc. Will fail after 18th May 2033 - - "result.session_name is not defined" - - -# FIXME add in tests for everything defined in docs -# FIXME Test state:absent + test: -# FIXME Without powers ensure "privileged mode required" diff --git a/test/integration/targets/net_vrf/tests/junos/basic.yaml b/test/integration/targets/net_vrf/tests/junos/basic.yaml deleted file mode 100644 index 6993492bbc3..00000000000 --- a/test/integration/targets/net_vrf/tests/junos/basic.yaml +++ /dev/null @@ -1,201 +0,0 @@ ---- -- debug: msg="START net_vrf junos/basic.yaml" - -- name: setup - remove vrf - net_vrf: - name: test-1 - state: absent - provider: "{{ netconf }}" - -- name: Configure vrf and its parameter - net_vrf: - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/6 - - ge-0/0/5 - rd: 3.3.3.3:10 - target: target:65513:111 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *test-1") - - result.diff.prepared is search("\+ *description test-vrf-1") - - result.diff.prepared is search("\+ *instance-type vrf") - - result.diff.prepared is search("\+ *interface ge-0/0/5.0") - - result.diff.prepared is search("\+ *interface ge-0/0/6.0") - - result.diff.prepared is search("\+ *route-distinguisher 3.3.3.3:10") - - result.diff.prepared is search("\+ *vrf-target target:65513:111") - -- name: Configure vrf and its parameter (idempotent) - net_vrf: - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/6 - - ge-0/0/5 - rd: 3.3.3.3:10 - target: target:65513:111 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Change vrf parameter - net_vrf: - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/3 - - ge-0/0/2 - rd: 1.1.1.1:10 - target: target:65514:113 - state: present - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'[edit routing-instances test-1]' in result.diff.prepared" - - result.diff.prepared is search("\+ *interface ge-0/0/2.0") - - result.diff.prepared is search("\+ *interface ge-0/0/3.0") - - "'[edit routing-instances test-1]' in result.diff.prepared" - - result.diff.prepared is search("\+ *route-distinguisher 1.1.1.1:10") - - result.diff.prepared is search("\+ *vrf-target target:65514:113") - - -- name: Delete vrf - net_vrf: - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/3 - - ge-0/0/2 - rd: 1.1.1.1:10 - target: target:65514:113 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *test-1") - - result.diff.prepared is search("\- *description test-vrf-1") - - result.diff.prepared is search("\- *instance-type vrf") - - result.diff.prepared is search("\- *interface ge-0/0/2.0") - - result.diff.prepared is search("\- *interface ge-0/0/3.0") - - result.diff.prepared is search("\- *route-distinguisher 1.1.1.1:10") - - result.diff.prepared is search("\- *vrf-target target:65514:113") - -- name: Delete vrf (idempotent) - net_vrf: - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/3 - - ge-0/0/2 - rd: 1.1.1.1:10 - target: target:65514:113 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: Setup vrf using aggregate - net_vrf: - aggregate: - - name: test-1 - - name: test-2 - state: absent - provider: "{{ netconf }}" - register: result - -- name: Create vrf using aggregate - net_vrf: - aggregate: - - name: test-1 - description: test-vrf-1 - interfaces: - - ge-0/0/3 - - ge-0/0/2 - rd: 1.1.1.1:10 - target: target:65514:113 - - name: test-2 - description: test-vrf-2 - interfaces: - - ge-0/0/4 - - ge-0/0/5 - rd: 2.2.2.2:10 - target: target:65515:114 - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\+ *test-1") - - result.diff.prepared is search("\+ *description test-vrf-1") - - result.diff.prepared is search("\+ *instance-type vrf") - - result.diff.prepared is search("\+ *interface ge-0/0/2.0") - - result.diff.prepared is search("\+ *interface ge-0/0/3.0") - - result.diff.prepared is search("\+ *route-distinguisher 1.1.1.1:10") - - result.diff.prepared is search("\+ *vrf-target target:65514:113") - - result.diff.prepared is search("\+ *test-2") - - result.diff.prepared is search("\+ *description test-vrf-2") - - result.diff.prepared is search("\+ *instance-type vrf") - - result.diff.prepared is search("\+ *interface ge-0/0/4.0") - - result.diff.prepared is search("\+ *interface ge-0/0/5.0") - - result.diff.prepared is search("\+ *route-distinguisher 2.2.2.2:10") - - result.diff.prepared is search("\+ *vrf-target target:65515:114") - -- name: Delete vrf configuration using aggregate - net_vrf: - aggregate: - - name: test-1 - - name: test-2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == true" - - result.diff.prepared is search("\- *test-1") - - result.diff.prepared is search("\- *description test-vrf-1") - - result.diff.prepared is search("\- *instance-type vrf") - - result.diff.prepared is search("\- *interface ge-0/0/2.0") - - result.diff.prepared is search("\- *interface ge-0/0/3.0") - - result.diff.prepared is search("\- *route-distinguisher 1.1.1.1:10") - - result.diff.prepared is search("\- *vrf-target target:65514:113") - - result.diff.prepared is search("\- *test-2") - - result.diff.prepared is search("\- *description test-vrf-2") - - result.diff.prepared is search("\- *instance-type vrf") - - result.diff.prepared is search("\- *interface ge-0/0/4.0") - - result.diff.prepared is search("\- *interface ge-0/0/5.0") - - result.diff.prepared is search("\- *route-distinguisher 2.2.2.2:10") - - result.diff.prepared is search("\- *vrf-target target:65515:114") - -- name: Delete vrf configuration using aggregate (idempotent) - net_vrf: - aggregate: - - name: test-1 - - name: test-2 - state: absent - provider: "{{ netconf }}" - register: result - -- assert: - that: - - "result.changed == false" diff --git a/test/integration/targets/net_vrf/tests/netconf/basic.yaml b/test/integration/targets/net_vrf/tests/netconf/basic.yaml deleted file mode 100644 index 5ff7cf5af8e..00000000000 --- a/test/integration/targets/net_vrf/tests/netconf/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ role_path }}/tests/junos/basic.yaml" - when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos' diff --git a/test/integration/targets/nxos_logging/tests/common/net_logging.yaml b/test/integration/targets/nxos_logging/tests/common/net_logging.yaml new file mode 100644 index 00000000000..5d78f1a8a54 --- /dev/null +++ b/test/integration/targets/nxos_logging/tests/common/net_logging.yaml @@ -0,0 +1,36 @@ +--- +- debug: msg="START nxos common/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Delete/disable console logging - setup + net_logging: + dest: console + dest_level: 0 + state: absent + provider: "{{ connection }}" + register: result + +- name: Set up console logging using platform agnostic module + net_logging: + dest: console + dest_level: 0 + state: present + provider: "{{ connection }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"logging console 0" in result.commands' + +- name: Delete/disable console logging - teardown + net_logging: + dest: console + dest_level: 0 + state: absent + provider: "{{ connection }}" + register: result + +- debug: msg="END nxos common/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/nxos_system/tests/cli/net_system.yaml b/test/integration/targets/nxos_system/tests/cli/net_system.yaml new file mode 100644 index 00000000000..2d1d4194de8 --- /dev/null +++ b/test/integration/targets/nxos_system/tests/cli/net_system.yaml @@ -0,0 +1,37 @@ +--- +- debug: msg="START nxos cli/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup + nxos_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + +- name: configure domain_list using platform agnostic module + net_system: + domain_search: + - ansible.com + - redhat.com + provider: "{{ cli }}" + register: result + +- assert: + that: + - result.changed == true + - "'ip domain-list ansible.com' in result.commands" + - "'ip domain-list redhat.com' in result.commands" + +- name: setup + nxos_config: + lines: + - no ip domain-list ansible.com + - no ip domain-list redhat.com + match: none + provider: "{{ cli }}" + +- debug: msg="END nxos cli/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/nxos_user/tests/common/net_user.yaml b/test/integration/targets/nxos_user/tests/common/net_user.yaml new file mode 100644 index 00000000000..f46005dbdfa --- /dev/null +++ b/test/integration/targets/nxos_user/tests/common/net_user.yaml @@ -0,0 +1,34 @@ +--- +- debug: msg="START nxos common/net_user.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Remove old entries of user - setup + net_user: + - name: ansibletest1 + state: absent + provider: "{{ connection }}" + +# Start tests +- name: Create user with platform agnostic module + net_user: + name: ansibletest1 + roles: network-operator + state: present + provider: "{{ connection }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"username" in result.commands[0]' + - '"role network-operator" in result.commands[1]' + +- name: teardown + net_user: + - name: ansibletest1 + state: absent + provider: "{{ connection }}" + +- debug: msg="END nxos common/net_user.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_interface/tests/cli/net_interface.yaml b/test/integration/targets/vyos_interface/tests/cli/net_interface.yaml new file mode 100644 index 00000000000..c3ea453397b --- /dev/null +++ b/test/integration/targets/vyos_interface/tests/cli/net_interface.yaml @@ -0,0 +1,56 @@ +--- +- debug: msg="START vyos cli/net_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Run vyos lsmod command + vyos_command: + commands: + - lsmod + register: lsmod_out + +- name: Set up - delete interface + net_interface: + name: eth1 + state: absent + +- name: Create interface using platform agnostic module + net_interface: + name: eth1 + state: present + description: test-interface + register: result + +- 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 + net_interface: + name: eth1 + state: present + description: test-interface-1 + speed: 100 + duplex: half + mtu: 256 + when: "'virtio_net' not in lsmod_out.stdout[0]" + register: result + +- 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 + net_interface: + name: eth1 + state: absent + +- debug: msg="END vyos cli/net_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml b/test/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml new file mode 100644 index 00000000000..93f98e7aed1 --- /dev/null +++ b/test/integration/targets/vyos_linkagg/tests/cli/net_linkagg.yaml @@ -0,0 +1,31 @@ +--- +- debug: msg="START vyos cli/net_linkagg.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Remove linkagg - set + net_linkagg: + name: bond0 + state: absent + +- name: Create linkagg using platform agnostic module + net_linkagg: + name: bond0 + members: + - eth1 + state: present + register: result + +- 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 + net_linkagg: + name: bond0 + state: absent + +- debug: msg="END vyos cli/net_linkagg.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml b/test/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml new file mode 100644 index 00000000000..cf8f97cb8a6 --- /dev/null +++ b/test/integration/targets/vyos_lldp/tests/cli/net_lldp.yaml @@ -0,0 +1,25 @@ +--- +- debug: msg="START vyos cli/net_lldp.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Make sure LLDP is not running - setup + vyos_config: + lines: delete service lldp + +- name: Enable LLDP service using platform agnostic module + net_lldp: + state: present + register: result + +- assert: + that: + - 'result.changed == true' + - '"set service lldp" in result.commands' + +- name: Make sure LLDP is not running - teardown + vyos_config: + lines: delete service lldp + +- debug: msg="END vyos cli/net_lldp.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml b/test/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml new file mode 100644 index 00000000000..49cd8b005f4 --- /dev/null +++ b/test/integration/targets/vyos_lldp_interface/tests/cli/net_lldp_interface.yaml @@ -0,0 +1,26 @@ +--- +- debug: msg="START vyos cli/net_lldp_interface.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: Make sure LLDP is not running - setup + vyos_config: + lines: delete service lldp + +- name: Create LLDP configuration using platform agnostic module + net_lldp_interface: + name: eth1 + state: present + register: result + +- assert: + that: + - 'result.changed == true' + - '"set service lldp interface eth1" in result.commands' + +- name: Make sure LLDP is not running - teardown + vyos_config: + lines: delete service lldp + +- debug: msg="END vyos cli/net_lldp_interface.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_logging/tests/cli/net_logging.yaml b/test/integration/targets/vyos_logging/tests/cli/net_logging.yaml new file mode 100644 index 00000000000..7c62d72f23f --- /dev/null +++ b/test/integration/targets/vyos_logging/tests/cli/net_logging.yaml @@ -0,0 +1,39 @@ +--- +- debug: msg="START vyos cli/net_logging.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: delete logging - setup + net_logging: + dest: file + name: test + facility: all + level: notice + state: absent + register: result + +- name: file logging using platform agnostic module + net_logging: + dest: file + name: test + facility: all + level: notice + state: present + register: result + +- assert: + that: + - 'result.changed == true' + - '"set system syslog file test facility all level notice" in result.commands' + +- name: delete logging - teardown + net_logging: + dest: file + name: test + facility: all + level: notice + state: absent + register: result + +- debug: msg="END vyos cli/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml b/test/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml new file mode 100644 index 00000000000..e2529ebccd3 --- /dev/null +++ b/test/integration/targets/vyos_static_route/tests/cli/net_static_route.yaml @@ -0,0 +1,33 @@ +--- +- debug: msg="START vyos cli/net_static_route.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: delete static route - setup + net_static_route: + prefix: 172.24.0.0/24 + next_hop: 192.168.42.64 + state: absent + register: result + +- name: create static route using platform agnostic module + net_static_route: + prefix: 172.24.0.0/24 + next_hop: 192.168.42.64 + state: present + register: result + +- 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 + net_static_route: + prefix: 172.24.0.0/24 + next_hop: 192.168.42.64 + state: absent + register: result + +- debug: msg="END vyos cli/net_static_route.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/net_linkagg/defaults/main.yaml b/test/integration/targets/vyos_system/defaults/main.yaml similarity index 100% rename from test/integration/targets/net_linkagg/defaults/main.yaml rename to test/integration/targets/vyos_system/defaults/main.yaml diff --git a/test/integration/targets/net_l3_interface/tasks/cli.yaml b/test/integration/targets/vyos_system/tasks/cli.yaml similarity index 53% rename from test/integration/targets/net_l3_interface/tasks/cli.yaml rename to test/integration/targets/vyos_system/tasks/cli.yaml index 46d86dd6988..890d3acf3e4 100644 --- a/test/integration/targets/net_l3_interface/tasks/cli.yaml +++ b/test/integration/targets/vyos_system/tasks/cli.yaml @@ -9,8 +9,14 @@ - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case - include: "{{ test_case_to_run }}" +- name: run test case (connection=network_cli) + include: "{{ test_case_to_run }} ansible_connection=network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run + +- name: run test case (connection=local) + include: "{{ test_case_to_run }} ansible_connection=local" + with_first_found: "{{ test_items }}" + loop_control: + loop_var: test_case_to_run diff --git a/test/integration/targets/vyos_system/tasks/main.yaml b/test/integration/targets/vyos_system/tasks/main.yaml new file mode 100644 index 00000000000..415c99d8b12 --- /dev/null +++ b/test/integration/targets/vyos_system/tasks/main.yaml @@ -0,0 +1,2 @@ +--- +- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/net_system/tests/vyos/set_name_servers.yaml b/test/integration/targets/vyos_system/tests/cli/basic.yaml similarity index 86% rename from test/integration/targets/net_system/tests/vyos/set_name_servers.yaml rename to test/integration/targets/vyos_system/tests/cli/basic.yaml index 12858b3cce2..f8958db49ce 100644 --- a/test/integration/targets/net_system/tests/vyos/set_name_servers.yaml +++ b/test/integration/targets/vyos_system/tests/cli/basic.yaml @@ -1,5 +1,5 @@ --- -- debug: msg="START vyos/set_name_servers.yaml" +- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - name: setup vyos_config: @@ -10,7 +10,7 @@ match: none - name: configure name servers - net_system: + vyos_system: name_servers: - 1.1.1.1 - 2.2.2.2 @@ -26,7 +26,7 @@ - result.commands[2] is search("set system name-server '3.3.3.3'") - name: verify name_servers - net_system: + vyos_system: name_servers: - 1.1.1.1 - 2.2.2.2 @@ -38,7 +38,7 @@ - result.changed == false - name: remove one - net_system: + vyos_system: name_servers: - 3.3.3.3 state: absent @@ -58,4 +58,4 @@ - delete system name-server name-server 3.3.3.3 match: none -- debug: msg="END vyos/set_name_servers.yaml" +- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_system/tests/cli/net_system.yaml b/test/integration/targets/vyos_system/tests/cli/net_system.yaml new file mode 100644 index 00000000000..c7a29fa9912 --- /dev/null +++ b/test/integration/targets/vyos_system/tests/cli/net_system.yaml @@ -0,0 +1,30 @@ +--- +- debug: msg="START vyos cli/net_system.yaml on connection={{ ansible_connection }}" + +# Add minimal testcase to check args are passed correctly to +# implementation module and module run is successful. + +- name: setup + vyos_config: + lines: + - delete system name-server 1.1.1.1 + match: none + +- name: configure name servers using platform agnostic module + net_system: + name_servers: + - 1.1.1.1 + register: result + +- assert: + that: + - result.changed == true + - result.commands[0] is search("set system name-server '1.1.1.1'") + +- name: setup + vyos_config: + lines: + - delete system name-server 1.1.1.1 + match: none + +- debug: msg="END vyos cli/net_system.yaml on connection={{ ansible_connection }}"