diff options
Diffstat (limited to 'test/integration/targets')
318 files changed, 0 insertions, 11839 deletions
diff --git a/test/integration/targets/ios_acl_interfaces/defaults/main.yaml b/test/integration/targets/ios_acl_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_acl_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_acl_interfaces/tasks/cli.yaml b/test/integration/targets/ios_acl_interfaces/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_acl_interfaces/tasks/main.yaml b/test/integration/targets/ios_acl_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/_parsed.cfg b/test/integration/targets/ios_acl_interfaces/tests/cli/_parsed.cfg deleted file mode 100644 index 1462c13530..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/_parsed.cfg +++ /dev/null @@ -1,8 +0,0 @@ -interface GigabitEthernet0/1 -ip access-group 110 in -ip access-group 123 out -ipv6 traffic-filter temp_v6 in -ipv6 traffic-filter test_v6 out -interface GigabitEthernet0/2 -ip access-group 110 in -ip access-group 123 out diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 68ee0265f2..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - ip access-group 110 in - ip access-group 123 out - ipv6 traffic-filter temp_v6 in - ipv6 traffic-filter test_v6 out - interface GigabitEthernet 0/2 - ip access-group 110 in - ip access-group 123 out diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index 9560e2bbf7..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - no ip access-group 110 in - no ip access-group 100 out - no ip access-group 123 out - no ipv6 traffic-filter temp_v6 in - no ipv6 traffic-filter test_v6 out - interface GigabitEthernet 0/2 - no ip access-group 110 in - no ip access-group 123 out diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index c101b6b8fa..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -- debug: - msg: "Start ios_acl_interfaces deleted integration tests ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml -- include_tasks: _populate_config.yaml - -- block: - - - name: Delete module attributes of given Interface based on AFI - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv6 - state: deleted - register: result - - - assert: - that: - - "result.commands|length == 3" - - "result.changed == true" - - "'no ipv6 traffic-filter temp_v6 in' in result.commands" - - "'no ipv6 traffic-filter test_v6 out' in result.commands" - - - name: Delete module attributes of given Interface based on AFI (IDEMPOTENT) - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv6 - state: deleted - register: result - - - assert: - that: - - "result.changed == false" - - - name: Delete module attributes of given Interface. - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - state: deleted - register: result - - - assert: - that: - - "result.commands|length == 3" - - "result.changed == true" - - "'no ip access-group 110 in' in result.commands" - - "'no ip access-group 123 out' in result.commands" - - - name: Delete module attributes of given Interface (IDEMPOTENT) - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - state: deleted - register: result - - - assert: - that: - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index 85e3bdf7aa..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- debug: - msg: "START ios_acl_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_acl_interfaces: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_acl_interfaces: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_acl_interfaces: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - -- name: Rendered with empty config should give appropriate error message - ios_acl_interfaces: - config: - state: rendered - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state rendered' - -- name: Parsed with empty config should give appropriate error message - ios_acl_interfaces: - running_config: - state: parsed - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of running_config parameter must not be empty for state parsed' diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/gathered.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/gathered.yaml deleted file mode 100644 index e11c78adf1..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/gathered.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- debug: - msg: "START ios_acl_interfaces gathered integration tests on connection={{ ansible_connection }}" - -- include_tasks: _populate_config.yaml - -- block: - - name: Gather the provided configuration with the exisiting running configuration - ios_acl_interfaces: &gathered - config: - state: gathered - register: result - - - name: Assert - assert: - that: - - "gathered['config'] | symmetric_difference(result.gathered) == []" - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 46be05105f..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- debug: - msg: "Start ios_acl_interfaces merged integration tests ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - - name: Merge the provided configuration with the exisiting running configuration - ios_acl_interfaces: &merged - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - - afi: ipv6 - acls: - - name: temp_v6 - direction: in - - name: test_v6 - direction: out - - name: GigabitEthernet0/2 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - state: merged - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(merged.commands) == []" - - - name: Merge the provided configuration with the exisiting running configuration (IDEMPOTENT) - ios_acl_interfaces: *merged - register: result - - - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index 89b303846f..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start ios_acl_interfaces overridden integration tests ansible_connection={{ ansible_connection }}" - -- include_tasks: _populate_config.yaml - -- block: - - - name: Override device configuration of all acl_interfaces with provided configuration - ios_acl_interfaces: &overridden - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 100 - direction: out - - name: 110 - direction: in - state: overridden - become: yes - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(overridden.commands) == []" - - - name: Override device configuration of all acl_interfaces with provided configuration (IDEMPOTENT) - ios_acl_interfaces: *overridden - become: yes - register: result - - - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/parsed.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/parsed.yaml deleted file mode 100644 index 96efd87898..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/parsed.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- debug: - msg: "START ios_acl_interfaces parsed integration tests on connection={{ ansible_connection }}" - -- name: Parse the commands for provided configuration - ios_acl_interfaces: &parsed - running_config: - "{{ lookup('file', '_parsed.cfg') }}" - state: parsed - become: yes - register: result - -- assert: - that: - - "result.changed == false" - - "parsed['config']|symmetric_difference(result.parsed) == []" diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/rendered.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/rendered.yaml deleted file mode 100644 index 0d83ef0d22..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/rendered.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- debug: - msg: "Start ios_acl_interfaces rendered integration tests ansible_connection={{ ansible_connection }}" - -- block: - - - name: Render the commands for provided configuration - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - - afi: ipv6 - acls: - - name: test_v6 - direction: out - - name: temp_v6 - direction: in - - name: GigabitEthernet0/2 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - state: rendered - become: yes - register: result - - - assert: - that: - - "result.changed == false" - - "result.rendered|symmetric_difference(merged.commands) == []" diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index ef569ebac7..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start ios_acl_interfaces replced integration tests ansible_connection={{ ansible_connection }}" - -- include_tasks: _populate_config.yaml - -- block: - - - name: Replaces device configuration of listed acl_interfaces with provided configuration - ios_acl_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 100 - direction: out - - name: 110 - direction: in - state: replaced - become: yes - register: result - - - assert: - that: - - "result.commands|length == 5" - - "result.changed == true" - - "result.commands|symmetric_difference(replaced.commands) == []" - - - name: Replaces device configuration of listed acl_interfaces with provided configuration (IDEMPOTENT) - ios_acl_interfaces: *replaced - become: yes - register: result - - - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/tests/cli/rtt.yaml b/test/integration/targets/ios_acl_interfaces/tests/cli/rtt.yaml deleted file mode 100644 index 999901092f..0000000000 --- a/test/integration/targets/ios_acl_interfaces/tests/cli/rtt.yaml +++ /dev/null @@ -1,78 +0,0 @@ ---- -- debug: - msg: "START ios_acl_interfaces round trip integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - - name: Apply the provided configuration (Base config) - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - - afi: ipv6 - acls: - - name: temp_v6 - direction: in - - name: test_v6 - direction: out - - name: GigabitEthernet0/2 - access_groups: - - afi: ipv4 - acls: - - name: 110 - direction: in - - name: 123 - direction: out - state: merged - register: base_config - - - name: Gather acl interfaces facts - ios_facts: - gather_subset: - - "!all" - - "!min" - gather_network_resources: - - acl_interfaces - - - name: Apply the provided configuration (config to be reverted) - ios_acl_interfaces: - config: - - name: GigabitEthernet0/1 - access_groups: - - afi: ipv4 - acls: - - name: 100 - direction: out - - name: 110 - direction: in - state: overridden - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(overridden.commands) == []" - - - name: Revert back to base config using facts round trip - ios_acl_interfaces: - config: "{{ ansible_facts['network_resources']['acl_interfaces'] }}" - state: overridden - register: revert - - - assert: - that: - - "revert.commands|length == 8" - - "revert.changed == true" - - "revert.commands|symmetric_difference(rtt.commands) == []" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acl_interfaces/vars/main.yaml b/test/integration/targets/ios_acl_interfaces/vars/main.yaml deleted file mode 100644 index 424499b53a..0000000000 --- a/test/integration/targets/ios_acl_interfaces/vars/main.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -interfaces: - int1: - GigabitEthernet0/1 - int2: - GigabitEthernet0/2 - - -merged: - commands: - - interface GigabitEthernet0/1 - - ip access-group 110 in - - ip access-group 123 out - - ipv6 traffic-filter temp_v6 in - - ipv6 traffic-filter test_v6 out - - interface GigabitEthernet0/2 - - ip access-group 110 in - - ip access-group 123 out - -replaced: - commands: - - interface GigabitEthernet0/1 - - no ip access-group 123 out - - no ipv6 traffic-filter temp_v6 in - - no ipv6 traffic-filter test_v6 out - - ip access-group 100 out - -overridden: - commands: - - interface GigabitEthernet0/1 - - no ip access-group 123 out - - no ipv6 traffic-filter test_v6 out - - no ipv6 traffic-filter temp_v6 in - - ip access-group 100 out - - interface GigabitEthernet0/2 - - no ip access-group 110 in - - no ip access-group 123 out - -gathered: - config: - - name: GigabitEthernet0/0 - - access_groups: - - acls: - - direction: 'in' - name: '110' - - direction: 'out' - name: '123' - afi: 'ipv4' - - acls: - - direction: 'in' - name: 'temp_v6' - - direction: 'out' - name: 'test_v6' - afi: 'ipv6' - name: GigabitEthernet0/1 - - access_groups: - - acls: - - direction: 'in' - name: '110' - - direction: 'out' - name: '123' - afi: ipv4 - name: GigabitEthernet0/2 - -parsed: - config: - - access_groups: - - acls: - - direction: in - name: '110' - - direction: out - name: '123' - afi: ipv4 - - acls: - - direction: in - name: temp_v6 - - direction: out - name: test_v6 - afi: ipv6 - name: GigabitEthernet0/1 - - access_groups: - - acls: - - direction: in - name: '110' - - direction: out - name: '123' - afi: ipv4 - name: GigabitEthernet0/2 - -rtt: - commands: - - interface GigabitEthernet0/1 - - no ip access-group 100 out - - ip access-group 123 out - - ipv6 traffic-filter temp_v6 in - - ipv6 traffic-filter test_v6 out - - interface GigabitEthernet0/2 - - ip access-group 110 in - - ip access-group 123 out diff --git a/test/integration/targets/ios_acls/defaults/main.yaml b/test/integration/targets/ios_acls/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_acls/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_acls/meta/main.yaml b/test/integration/targets/ios_acls/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_acls/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_acls/tasks/cli.yaml b/test/integration/targets/ios_acls/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_acls/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_acls/tasks/main.yaml b/test/integration/targets/ios_acls/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_acls/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_acls/tests/cli/_parsed.cfg b/test/integration/targets/ios_acls/tests/cli/_parsed.cfg deleted file mode 100644 index c873eac4cd..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/_parsed.cfg +++ /dev/null @@ -1,7 +0,0 @@ -ip access-list extended test_acl -deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10 -ip access-list extended 123 -deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12 -deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20 -ipv6 access-list R1_TRAFFIC -deny tcp any eq www any eq telnet ack dscp af11
\ No newline at end of file diff --git a/test/integration/targets/ios_acls/tests/cli/_populate_config.yaml b/test/integration/targets/ios_acls/tests/cli/_populate_config.yaml deleted file mode 100644 index 02f69c026d..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - ip access-list extended test_acl - deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10 - ip access-list extended 110 - deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10 - ip access-list extended 123 - deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12 - deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20 - ipv6 access-list R1_TRAFFIC - deny tcp any eq www any eq telnet ack dscp af11 diff --git a/test/integration/targets/ios_acls/tests/cli/_remove_config.yaml b/test/integration/targets/ios_acls/tests/cli/_remove_config.yaml deleted file mode 100644 index 29e24cd55e..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - no ip access-list standard std_acl - no ip access-list extended test_acl - no ip access-list extended 110 - no ip access-list extended 123 - no ip access-list extended 150 - no ipv6 access-list R1_TRAFFIC diff --git a/test/integration/targets/ios_acls/tests/cli/deleted.yaml b/test/integration/targets/ios_acls/tests/cli/deleted.yaml deleted file mode 100644 index bbf51119b6..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/deleted.yaml +++ /dev/null @@ -1,70 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_acls ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete attributes of provided configured ACLs - ios_acls: &deleted - config: - - afi: ipv4 - acls: - - name: test_acl - acl_type: extended - - name: 110 - aces: - - sequence: 10 - - name: 123 - - afi: ipv6 - acls: - - name: R1_TRAFFIC - state: deleted - register: result - - - assert: - that: - - "result.commands|length == 5" - - "result.changed == true" - - "result.commands|symmetric_difference(deleted.commands) == []" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_acls: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - - include_tasks: _remove_config.yaml - - include_tasks: _populate_config.yaml - - - name: Delete ACL attributes of provided configured interfaces based on AFI - ios_acls: &deleted_afi - config: - - afi: ipv4 - state: deleted - register: result - - - assert: - that: - - "result.commands|length == 3" - - "result.changed == true" - - "result.commands|symmetric_difference(deleted_afi.commands) == []" - - - name: Delete ACL attributes of provided configured interfaces based on AFI (IDEMPOTENT) - ios_acls: *deleted_afi - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acls/tests/cli/empty_config.yaml b/test/integration/targets/ios_acls/tests/cli/empty_config.yaml deleted file mode 100644 index 8a911eff28..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/empty_config.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- debug: - msg: "START ios_acls empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_acls: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_acls: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_acls: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - -- name: Rendered with empty config should give appropriate error message - ios_acls: - config: - state: rendered - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state rendered' - -- name: Parsed with empty config should give appropriate error message - ios_acls: - running_config: - state: parsed - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of running_config parameter must not be empty for state parsed' diff --git a/test/integration/targets/ios_acls/tests/cli/gathered.yaml b/test/integration/targets/ios_acls/tests/cli/gathered.yaml deleted file mode 100644 index 9b95aec1f3..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/gathered.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- debug: - msg: "START ios_acls gathered integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml -- include_tasks: _populate_config.yaml - -- block: - - name: Gather the provided configuration with the exisiting running configuration - ios_acls: &gathered - config: - state: gathered - register: result - - - assert: - that: - - "gathered['config'] | symmetric_difference(result.gathered) == []" - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml
\ No newline at end of file diff --git a/test/integration/targets/ios_acls/tests/cli/merged.yaml b/test/integration/targets/ios_acls/tests/cli/merged.yaml deleted file mode 100644 index 4bdc9ed0e0..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/merged.yaml +++ /dev/null @@ -1,123 +0,0 @@ ---- -- debug: - msg: "START Merged ios_acls state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_acls: &merged - config: - - afi: ipv4 - acls: - - name: std_acl - acl_type: standard - aces: - - grant: deny - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - - name: test_acl - acl_type: extended - aces: - - grant: deny - protocol_options: - tcp: - fin: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - option: - traceroute: true - ttl: - eq: 10 - - name: 110 - aces: - - grant: deny - sequence: 10 - protocol_options: - icmp: - echo: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - dscp: ef - ttl: - eq: 10 - - name: 123 - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - destination: - address: 198.51.101.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - tos: - service_value: 12 - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.4.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - lt: 20 - - afi: ipv6 - acls: - - name: R1_TRAFFIC - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - any: true - port_protocol: - eq: www - destination: - any: true - port_protocol: - eq: telnet - dscp: af11 - state: merged - register: result - - - assert: - that: - - "result.commands|length == 11" - - "result.changed == true" - - "result.commands|symmetric_difference(merged.commands) == []" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_acls: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acls/tests/cli/overridden.yaml b/test/integration/targets/ios_acls/tests/cli/overridden.yaml deleted file mode 100644 index ea8a581cfc..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/overridden.yaml +++ /dev/null @@ -1,73 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_acls state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all interfaces with provided configuration - ios_acls: &overridden - config: - - afi: ipv4 - acls: - - name: 110 - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - eq: 10 - - name: 150 - aces: - - grant: deny - protocol_options: - tcp: - syn: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - dscp: ef - ttl: - eq: 10 - state: overridden - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(overridden.commands) == []" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_acls: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acls/tests/cli/parsed.yaml b/test/integration/targets/ios_acls/tests/cli/parsed.yaml deleted file mode 100644 index 4219bc4a9e..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/parsed.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- debug: - msg: "START ios_acls parsed integration tests on connection={{ ansible_connection }}" - -- name: Parse the commands for provided configuration - ios_acls: &parsed - running_config: - "{{ lookup('file', '_parsed.cfg') }}" - state: parsed - become: yes - register: result - -- assert: - that: - - "result.changed == false" - - "parsed['config']|symmetric_difference(result.parsed) == []"
\ No newline at end of file diff --git a/test/integration/targets/ios_acls/tests/cli/rendered.yaml b/test/integration/targets/ios_acls/tests/cli/rendered.yaml deleted file mode 100644 index c5888e7fae..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/rendered.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -- debug: - msg: "Start ios_acls rendered integration tests ansible_connection={{ ansible_connection }}" - -- block: - - name: Rendered the provided configuration with the exisiting running configuration - ios_acls: - config: - - afi: ipv4 - acls: - - name: 110 - aces: - - grant: deny - sequence: 10 - protocol_options: - tcp: - syn: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - eq: 10 - - name: 150 - aces: - - grant: deny - protocol_options: - tcp: - syn: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - dscp: ef - ttl: - eq: 10 - state: rendered - register: result - - - assert: - that: - - "result.changed == false" - - "result.rendered|symmetric_difference(rendered.commands) == []"
\ No newline at end of file diff --git a/test/integration/targets/ios_acls/tests/cli/replaced.yaml b/test/integration/targets/ios_acls/tests/cli/replaced.yaml deleted file mode 100644 index 1562adae8d..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/replaced.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_acls state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed interfaces with provided configuration - ios_acls: &replaced - config: - - afi: ipv4 - acls: - - name: 110 - aces: - - grant: deny - protocol_options: - tcp: - syn: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - eq: 10 - - name: 150 - aces: - - grant: deny - sequence: 20 - protocol_options: - tcp: - syn: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - dscp: ef - ttl: - eq: 10 - state: replaced - register: result - - - assert: - that: - - "result.commands|length == 5" - - "result.changed == true" - - "result.commands|symmetric_difference(replaced.commands) == []" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_acls: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acls/tests/cli/rtt.yaml b/test/integration/targets/ios_acls/tests/cli/rtt.yaml deleted file mode 100644 index f2f3857317..0000000000 --- a/test/integration/targets/ios_acls/tests/cli/rtt.yaml +++ /dev/null @@ -1,173 +0,0 @@ ---- -- debug: - msg: "START ios_acls round trip integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Apply the provided configuration (base config) - ios_acls: - config: - - afi: ipv4 - acls: - - name: test_acl - acl_type: extended - aces: - - grant: deny - protocol_options: - tcp: - fin: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - option: - traceroute: true - ttl: - eq: 10 - - name: 110 - aces: - - grant: deny - protocol_options: - icmp: - echo: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - dscp: ef - ttl: - eq: 10 - - name: 123 - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - destination: - address: 198.51.101.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - tos: - service_value: 12 - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - destination: - address: 192.0.4.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - lt: 20 - - afi: ipv6 - acls: - - name: R1_TRAFFIC - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - any: true - port_protocol: - eq: www - destination: - any: true - port_protocol: - eq: telnet - dscp: af11 - state: merged - register: base_config - - - name: Gather ACLs facts - ios_facts: - gather_subset: - - "!all" - - "!min" - gather_network_resources: - - acls - - - name: Apply the configuration which need to be reverted - ios_acls: - config: - - afi: ipv4 - acls: - - name: 110 - aces: - - grant: deny - protocol_options: - tcp: - ack: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: www - dscp: ef - ttl: - eq: 10 - - name: 150 - aces: - - grant: deny - protocol_options: - tcp: - syn: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - destination: - address: 198.51.110.0 - wildcard_bits: 0.0.0.255 - port_protocol: - eq: telnet - dscp: ef - ttl: - eq: 10 - state: overridden - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(overridden.commands) == []" - - - name: Revert back to base config using facts round trip - ios_acls: - config: "{{ ansible_facts['network_resources']['acls'] }}" - state: overridden - register: revert - - - assert: - that: - - "revert.commands|length == 11" - - "revert.changed == true" - - "revert.commands|symmetric_difference(rtt.commands) == []" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_acls/vars/main.yaml b/test/integration/targets/ios_acls/vars/main.yaml deleted file mode 100644 index 18ff8ef538..0000000000 --- a/test/integration/targets/ios_acls/vars/main.yaml +++ /dev/null @@ -1,242 +0,0 @@ ---- -deleted: - commands: - - "no ip access-list extended test_acl" - - "ip access-list extended 110" - - "no 10" - - "no ip access-list extended 123" - - "no ipv6 access-list R1_TRAFFIC" - -deleted_afi: - commands: - - "no ip access-list extended 110" - - "no ip access-list extended 123" - - "no ip access-list extended test_acl" - -merged: - commands: - - "ip access-list standard std_acl" - - "deny 192.0.2.0 0.0.0.255" - - "ip access-list extended test_acl" - - "deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10" - - "ip access-list extended 110" - - "10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10" - - "ip access-list extended 123" - - "deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12" - - "deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20" - - "ipv6 access-list R1_TRAFFIC" - - "deny tcp any eq www any eq telnet ack dscp af11" - -replaced: - commands: - - "ip access-list extended 110" - - "no 10" - - "deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www syn dscp ef ttl eq 10" - - "ip access-list extended 150" - - "20 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10" - -overridden: - commands: - - "no ip access-list extended 123" - - "no ip access-list extended test_acl" - - "no ipv6 access-list R1_TRAFFIC" - - "ip access-list extended 110" - - "no 10" - - "deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq www ack dscp ef ttl eq 10" - - "ip access-list extended 150" - - "deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10" - -gathered: - config: - - acls: - - aces: - - destination: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - dscp: ef - grant: deny - protocol: icmp - protocol_options: - icmp: - echo: true - sequence: 10 - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - ttl: - eq: 10 - acl_type: extended - name: '110' - - aces: - - destination: - address: 198.51.101.0 - port_protocol: - eq: telnet - wildcard_bits: 0.0.0.255 - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - sequence: 10 - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - tos: - service_value: 12 - - destination: - address: 192.0.4.0 - port_protocol: - eq: www - wildcard_bits: 0.0.0.255 - dscp: ef - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - sequence: 20 - source: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - ttl: - lt: 20 - acl_type: extended - name: '123' - - aces: - - destination: - address: 192.0.3.0 - port_protocol: - eq: www - wildcard_bits: 0.0.0.255 - grant: deny - option: - traceroute: true - protocol: tcp - protocol_options: - tcp: - fin: true - sequence: 10 - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - ttl: - eq: 10 - acl_type: extended - name: test_acl - afi: ipv4 - - acls: - - aces: - - destination: - any: true - port_protocol: - eq: telnet - dscp: af11 - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - sequence: 10 - source: - any: true - port_protocol: - eq: www - name: R1_TRAFFIC - afi: ipv6 - -parsed: - config: - - acls: - - aces: - - destination: - address: 192.0.3.0 - port_protocol: - eq: www - wildcard_bits: 0.0.0.255 - grant: deny - option: - traceroute: true - protocol: tcp - protocol_options: - tcp: - fin: true - source: - address: 192.0.2.0 - wildcard_bits: 0.0.0.255 - ttl: - eq: 10 - name: test_acl - - aces: - - destination: - address: 198.51.101.0 - port_protocol: - eq: telnet - wildcard_bits: 0.0.0.255 - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - source: - address: 198.51.100.0 - wildcard_bits: 0.0.0.255 - tos: - service_value: 12 - - destination: - address: 192.0.4.0 - port_protocol: - eq: www - wildcard_bits: 0.0.0.255 - dscp: ef - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - source: - address: 192.0.3.0 - wildcard_bits: 0.0.0.255 - ttl: - lt: 20 - name: '123' - afi: ipv4 - - acls: - - aces: - - destination: - any: true - port_protocol: - eq: telnet - dscp: af11 - grant: deny - protocol: tcp - protocol_options: - tcp: - ack: true - source: - any: true - port_protocol: - eq: www - name: R1_TRAFFIC - afi: ipv6 - -rendered: - commands: - - ip access-list extended 110 - - 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www syn dscp ef ttl eq 10 - - ip access-list extended 150 - - deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10 - -rtt: - commands: - - no ip access-list extended 150 - - ip access-list extended 110 - - no 10 - - 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10 - - ip access-list extended 123 - - 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12 - - 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20 - - ip access-list extended test_acl - - 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10 - - ipv6 access-list R1_TRAFFIC - - sequence 10 deny tcp any eq www any eq telnet ack dscp af11 diff --git a/test/integration/targets/ios_banner/defaults/main.yaml b/test/integration/targets/ios_banner/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_banner/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_banner/meta/main.yml b/test/integration/targets/ios_banner/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_banner/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_banner/tasks/cli.yaml b/test/integration/targets/ios_banner/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_banner/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_banner/tasks/main.yaml b/test/integration/targets/ios_banner/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_banner/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_banner/tests/cli/basic-login.yaml b/test/integration/targets/ios_banner/tests/cli/basic-login.yaml deleted file mode 100644 index 5102087d4e..0000000000 --- a/test/integration/targets/ios_banner/tests/cli/basic-login.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- - -- name: setup - remove login - ios_banner: - banner: login - state: absent - provider: "{{ cli }}" - - -- name: Set login - ios_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - provider: "{{ cli }}" - - 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) - ios_banner: - banner: login - text: | - this is my login banner - that has a multiline - string - state: present - provider: "{{ cli }}" - - 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/ios_banner/tests/cli/basic-motd.yaml b/test/integration/targets/ios_banner/tests/cli/basic-motd.yaml deleted file mode 100644 index 792758a157..0000000000 --- a/test/integration/targets/ios_banner/tests/cli/basic-motd.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- - -- name: setup - remove motd - ios_banner: - banner: motd - state: absent - provider: "{{ cli }}" - - -- name: Set motd - ios_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - provider: "{{ cli }}" - - 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) - ios_banner: - banner: motd - text: | - this is my motd banner - that has a multiline - string - state: present - provider: "{{ cli }}" - - 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/ios_banner/tests/cli/basic-no-login.yaml b/test/integration/targets/ios_banner/tests/cli/basic-no-login.yaml deleted file mode 100644 index 1fbe53a4a1..0000000000 --- a/test/integration/targets/ios_banner/tests/cli/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 - provider: "{{ cli }}" - -- name: remove login - ios_banner: - banner: login - state: absent - provider: "{{ cli }}" - 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) - ios_banner: - banner: login - state: absent - provider: "{{ cli }}" - 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/ios_banner/tests/cli/multiple-login-exec.yaml b/test/integration/targets/ios_banner/tests/cli/multiple-login-exec.yaml deleted file mode 100644 index d70f219574..0000000000 --- a/test/integration/targets/ios_banner/tests/cli/multiple-login-exec.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- - -- name: Setup - set login and exec - ios_banner: - banner: "{{ item }}" - text: | - this is my login banner - that as a multiline - string - state: present - provider: "{{ cli }}" - loop: - - login - - exec - - -- name: Set login - ios_banner: - banner: "login" - text: | - this is my login banner - that as a multiline - string - state: present - provider: "{{ cli }}" - - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" - -- name: Set exec - ios_banner: - banner: "exec" - text: | - this is my login banner - that as a multiline - string - state: present - provider: "{{ cli }}" - - register: result - -- debug: - msg: "{{ result }}" - -- assert: - that: - - "result.changed == false" - - "result.commands | length == 0" diff --git a/test/integration/targets/ios_banner/tests/cli/net_banner.yml b/test/integration/targets/ios_banner/tests/cli/net_banner.yml deleted file mode 100644 index 49e98f631d..0000000000 --- a/test/integration/targets/ios_banner/tests/cli/net_banner.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- 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_bgp/defaults/main.yaml b/test/integration/targets/ios_bgp/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_bgp/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_bgp/meta/main.yaml b/test/integration/targets/ios_bgp/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_bgp/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_bgp/tasks/cli.yaml b/test/integration/targets/ios_bgp/tasks/cli.yaml deleted file mode 100644 index 575f5d0a8e..0000000000 --- a/test/integration/targets/ios_bgp/tasks/cli.yaml +++ /dev/null @@ -1,17 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_bgp/tasks/main.yaml b/test/integration/targets/ios_bgp/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_bgp/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_bgp/tests/cli/basic.yaml b/test/integration/targets/ios_bgp/tests/cli/basic.yaml deleted file mode 100644 index 9d6713530a..0000000000 --- a/test/integration/targets/ios_bgp/tests/cli/basic.yaml +++ /dev/null @@ -1,504 +0,0 @@ -- debug: msg="START ios cli/ios_bgp.yaml on connection={{ ansible_connection }}" - -- name: Clear existing BGP config - ios_bgp: - operation: delete - ignore_errors: yes - -- block: - - - name: Add fake config with 'bgp' string - ios_config: - match: none - replace: block - lines: - - "no ip access-list extended BGP_ACL" - - "ip access-list extended BGP_ACL" - - "permit tcp any any eq bgp" - - - name: Try delete fake bgp config - register: result - ios_bgp: - operation: delete - - - assert: - that: - - 'result.changed == false' - - - name: Clean fake config with 'bgp' string - ios_config: - match: none - replace: block - lines: - - "no ip access-list extended BGP_ACL" - - - name: Add fake bgp-like config - ios_config: - match: none - replace: block - lines: - - "no ip access-list extended BGP_ACL_2" - - "ip access-list extended BGP_ACL_2" - - "remark router bgp 64496" - - "remark neighbor 192.0.2.10 remote-as 64496" - - "remark neighbor 192.0.2.10 shutdown" - - "remark address-family ipv4" - - "remark neighbor 192.0.2.10 activate" - - "remark exit-address-family" - - "permit tcp any any eq bgp" - - - name: Try delete fake bgp-like config - register: result - ios_bgp: - operation: delete - - - assert: - that: - - 'result.changed == false' - - - name: Clean fake bgp-like config - ios_config: - match: none - replace: block - lines: - - "no ip access-list extended BGP_ACL_2" - - - name: Configure BGP with AS 64496 and a router-id - ios_bgp: &config - operation: merge - config: - bgp_as: 64496 - router_id: 192.0.2.2 - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'bgp router-id 192.0.2.2' in result.commands" - - - name: Configure BGP with AS 64496 and a router-id (idempotent) - ios_bgp: *config - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure BGP neighbors - ios_bgp: &nbr - operation: merge - config: - bgp_as: 64496 - neighbors: - - neighbor: 192.0.2.10 - remote_as: 64496 - password: ansible - description: IBGP_NBR_1 - ebgp_multihop: 100 - timers: - keepalive: 300 - holdtime: 360 - min_neighbor_holdtime: 360 - - - neighbor: 192.0.2.15 - remote_as: 64496 - description: IBGP_NBR_2 - ebgp_multihop: 150 - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'neighbor 192.0.2.10 remote-as 64496' in result.commands" - - "'neighbor 192.0.2.10 description IBGP_NBR_1' in result.commands" - - "'neighbor 192.0.2.10 ebgp-multihop 100' in result.commands" - - "'neighbor 192.0.2.10 timers 300 360 360' in result.commands" - - "'neighbor 192.0.2.15 remote-as 64496' in result.commands" - - "'neighbor 192.0.2.15 description IBGP_NBR_2' in result.commands" - - "'neighbor 192.0.2.15 ebgp-multihop 150' in result.commands" - - - name: Configure BGP neighbors (idempotent) - ios_bgp: *nbr - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure BGP neighbors with operation replace - ios_bgp: &nbr_rplc - operation: replace - config: - bgp_as: 64496 - neighbors: - - neighbor: 192.0.2.15 - remote_as: 64496 - description: IBGP_NBR_2 - ebgp_multihop: 150 - - - neighbor: 203.0.113.10 - remote_as: 64511 - description: EBGP_NBR_1 - local_as: 64497 - - - neighbor: 10.10.20.20 - remote_as: 65012 - description: BGP_NBR_2 - ebgp_multihop: 100 - register: result - - - assert: - that: - - 'result.changed == true' - - "'neighbor 203.0.113.10 remote-as 64511' in result.commands" - - "'neighbor 203.0.113.10 description EBGP_NBR_1' in result.commands" - - "'neighbor 203.0.113.10 local-as 64497' in result.commands" - - "'neighbor 10.10.20.20 remote-as 65012' in result.commands" - - "'neighbor 10.10.20.20 description BGP_NBR_2' in result.commands" - - "'no neighbor 192.0.2.10' in result.commands" - - - name: Configure BGP neighbors with operation replace (idempotent) - ios_bgp: *nbr_rplc - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure root-level networks for BGP - ios_bgp: &net - operation: merge - config: - bgp_as: 64496 - networks: - - prefix: 203.0.113.0 - masklen: 27 - route_map: RMAP_1 - - - prefix: 203.0.113.32 - masklen: 27 - route_map: RMAP_2 - register: result - - - assert: - that: - - 'result.changed == True' - - "'router bgp 64496' in result.commands" - - "'network 203.0.113.0 mask 255.255.255.224 route-map RMAP_1' in result.commands" - - "'network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands" - - - name: Configure root-level networks for BGP (idempotent) - ios_bgp: *net - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure root-level networks for BGP with operation replace - ios_bgp: &net_rplc - operation: replace - config: - bgp_as: 64496 - networks: - - prefix: 203.0.113.0 - masklen: 27 - route_map: RMAP_1 - - - prefix: 198.51.100.16 - masklen: 28 - register: result - - - assert: - that: - - 'result.changed == True' - - "'router bgp 64496' in result.commands" - - "'network 198.51.100.16 mask 255.255.255.240' in result.commands" - - "'no network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands" - - - name: Configure root-level networks for BGP with operation replace (idempotent) - ios_bgp: *net_rplc - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure BGP neighbors under address family mode - ios_bgp: &af_nbr - operation: merge - config: - bgp_as: 64496 - address_family: - - afi: ipv4 - safi: unicast - neighbors: - - neighbor: 203.0.113.10 - activate: yes - maximum_prefix: 250 - advertisement_interval: 120 - - - neighbor: 192.0.2.15 - activate: yes - route_reflector_client: True - - - neighbor: 10.10.20.20 - activate: yes - prefix_list_in: incoming-prefixes - prefix_list_out: outgoing-prefixes - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'address-family ipv4' in result.commands" - - "'neighbor 203.0.113.10 activate' in result.commands" - - "'neighbor 203.0.113.10 maximum-prefix 250' in result.commands" - - "'neighbor 203.0.113.10 advertisement-interval 120' in result.commands" - - "'neighbor 192.0.2.15 activate' in result.commands" - - "'neighbor 192.0.2.15 route-reflector-client' in result.commands" - - "'neighbor 10.10.20.20 activate' in result.commands" - - "'neighbor 10.10.20.20 prefix-list incoming-prefixes in' in result.commands" - - "'neighbor 10.10.20.20 prefix-list outgoing-prefixes out' in result.commands" - - - name: Configure BGP neighbors under address family mode (idempotent) - ios_bgp: *af_nbr - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure networks under address family - ios_bgp: &af_net - operation: merge - config: - bgp_as: 64496 - address_family: - - afi: ipv4 - safi: multicast - networks: - - prefix: 198.51.100.48 - masklen: 28 - route_map: RMAP_1 - - - prefix: 192.0.2.64 - masklen: 27 - - - prefix: 203.0.113.160 - masklen: 27 - route_map: RMAP_2 - - - afi: ipv4 - safi: unicast - networks: - - prefix: 198.51.100.64 - masklen: 28 - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'address-family ipv4 multicast' in result.commands" - - "'network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1' in result.commands" - - "'network 192.0.2.64 mask 255.255.255.224' in result.commands" - - "'network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2' in result.commands" - - "'exit-address-family' in result.commands" - - "'address-family ipv4' in result.commands" - - "'network 198.51.100.64 mask 255.255.255.240' in result.commands" - - "'exit-address-family' in result.commands" - - - name: Configure networks under address family (idempotent) - ios_bgp: *af_net - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure networks under address family with operation replace - ios_bgp: &af_net_rplc - operation: replace - config: - bgp_as: 64496 - address_family: - - afi: ipv4 - safi: multicast - networks: - - prefix: 198.51.100.80 - masklen: 28 - - - prefix: 192.0.2.64 - masklen: 27 - - - prefix: 203.0.113.192 - masklen: 27 - - - afi: ipv4 - safi: unicast - networks: - - prefix: 198.51.100.64 - masklen: 28 - register: result - - - assert: - that: - - 'result.changed == true' - - '"router bgp 64496" in result.commands' - - '"address-family ipv4 multicast" in result.commands' - - '"network 198.51.100.80 mask 255.255.255.240" in result.commands' - - '"network 203.0.113.192 mask 255.255.255.224" in result.commands' - - '"no network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1" in result.commands' - - '"no network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2" in result.commands' - - '"exit-address-family" in result.commands' - - - name: Configure networks under address family with operation replace (idempotent) - ios_bgp: *af_net_rplc - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Configure redistribute information under address family mode - ios_bgp: &af_rdr - operation: merge - config: - bgp_as: 64496 - address_family: - - afi: ipv4 - safi: multicast - redistribute: - - protocol: ospf - id: 112 - metric: 64 - - - protocol: eigrp - id: 233 - metric: 256 - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'address-family ipv4 multicast' in result.commands" - - "'redistribute ospf 112 metric 64' in result.commands" - - "'redistribute eigrp 233 metric 256' in result.commands" - - "'exit-address-family' in result.commands" - - - name: Configure redistribute information under address family mode (idempotent) - ios_bgp: *af_rdr - register: result - - - assert: - that: - - 'result.changed == false' - - - name: Get the IOS version - ios_facts: - gather_subset: all - - - name: Configure redistribute information under address family mode with operation replace - ios_bgp: &af_rdr_rplc - operation: replace - config: - bgp_as: 64496 - address_family: - - afi: ipv4 - safi: multicast - redistribute: - - protocol: ospf - id: 112 - metric: 64 - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64496' in result.commands" - - "'address-family ipv4 multicast' in result.commands" - - "'no redistribute eigrp 233' in result.commands" - - "'exit-address-family' in result.commands" - - - name: Configure redistribute information under address family mode with operation replace (idempotent) - ios_bgp: *af_rdr_rplc - register: result - when: ansible_net_version != "15.6(2)T" - - - assert: - that: - - 'result.changed == false' - when: ansible_net_version != "15.6(2)T" - - - name: Override all the exisiting BGP config - ios_bgp: - operation: override - config: - bgp_as: 64497 - router_id: 192.0.2.10 - log_neighbor_changes: True - register: result - - - assert: - that: - - 'result.changed == true' - - "'no router bgp 64496' in result.commands" - - "'router bgp 64497' in result.commands" - - "'bgp router-id 192.0.2.10' in result.commands" - - "'bgp log-neighbor-changes' in result.commands" - - - name: "Configure BGP neighbors with classful boundary" - ios_bgp: &classful - config: - bgp_as: 64497 - log_neighbor_changes: true - networks: - - prefix: 198.51.100.0 - masklen: 23 - - - prefix: 201.0.113.32 - masklen: 24 - - operation: merge - register: result - - - assert: - that: - - 'result.changed == true' - - "'router bgp 64497' in result.commands" - - "'network 198.51.100.0 mask 255.255.254.0' in result.commands" - - "'network 201.0.113.32' in result.commands" - - - name: Configure BGP neighbors with classful boundary (idempotent) - ios_bgp: *classful - register: result - - - assert: - that: - - 'result.changed == false' - - always: - - name: Teardown - ios_bgp: &rm - operation: delete - register: result - - - assert: - that: - - 'result.changed == true' - - "'no router bgp 64497' in result.commands" - - - name: Teardown again (idempotent) - ios_bgp: *rm - register: result - - - assert: - that: - - 'result.changed == false' - -- debug: msg="END ios cli/ios_bgp.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/defaults/main.yaml b/test/integration/targets/ios_command/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_command/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_command/meta/main.yml b/test/integration/targets/ios_command/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_command/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_command/tasks/cli.yaml b/test/integration/targets/ios_command/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_command/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_command/tasks/main.yaml b/test/integration/targets/ios_command/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_command/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_command/tests/cli/bad_operator.yaml b/test/integration/targets/ios_command/tests/cli/bad_operator.yaml deleted file mode 100644 index 99ad05420b..0000000000 --- a/test/integration/targets/ios_command/tests/cli/bad_operator.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- debug: msg="START cli/bad_operator.yaml on connection={{ ansible_connection }}" - -- name: test bad operator - ios_command: - commands: - - show version - - show interfaces GigabitEthernet 0/0 - provider: "{{ cli }}" - wait_for: - - "result[0] contains 'Description: Foo'" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- debug: msg="END cli/bad_operator.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/cli_command.yaml b/test/integration/targets/ios_command/tests/cli/cli_command.yaml deleted file mode 100644 index a2a252d3ab..0000000000 --- a/test/integration/targets/ios_command/tests/cli/cli_command.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- debug: - msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}" - -- block: - - name: get output for single command - cli_command: - command: show version - register: result - - - assert: - that: - - "result.changed == false" - - "result.stdout is defined" - - - name: send invalid command - cli_command: - command: 'show foo' - register: result - ignore_errors: yes - - - assert: - that: - - "result.failed == true" - - "result.msg is defined" - when: "ansible_connection == 'network_cli'" - -- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/contains.yaml b/test/integration/targets/ios_command/tests/cli/contains.yaml deleted file mode 100644 index 3e41f90399..0000000000 --- a/test/integration/targets/ios_command/tests/cli/contains.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- debug: msg="START cli/contains.yaml on connection={{ ansible_connection }}" - -- name: test contains operator - ios_command: - commands: - - show version - - show interface loopback 888 - provider: "{{ cli }}" - wait_for: - - "result[0] contains Cisco" - - "result[1] contains Loopback888" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - -- debug: msg="END cli/contains.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/error_regex.yaml b/test/integration/targets/ios_command/tests/cli/error_regex.yaml deleted file mode 100644 index c8c8a47c04..0000000000 --- a/test/integration/targets/ios_command/tests/cli/error_regex.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -- debug: msg="START cli/error_regex.yaml on connection={{ ansible_connection }}" - -- block: - - name: clear logs 1 - cli_command: &clear_logs - command: clear logging - prompt: - - Clear logging buffer - answer: - - "\r" - ignore_errors: True - - - name: send log with error regex match 1 - cli_command: &send_logs - command: "send log 'IPSEC-3-REPLAY_ERROR: test log_1'" - ignore_errors: True - - - name: fetch logs without command specific error regex - ios_command: - commands: - - show logging - register: result - ignore_errors: True - - - name: ensure task fails due to mismatched regex - assert: - that: - - "result.failed == true" - - - name: pause to avoid rate limiting - pause: - seconds: 10 - - - name: clear logs 2 - cli_command: *clear_logs - ignore_errors: True - - - name: send log with error regex match 2 - cli_command: *send_logs - ignore_errors: True - - - name: fetch logs with command specific error regex - ios_command: - commands: - - show logging - register: result - vars: - ansible_terminal_stderr_re: - - pattern: 'connection timed out' - flags: 're.I' - - - name: ensure task with modified error regex is success - assert: - that: - - "result.failed == false" - when: ansible_connection == 'network_cli' - -- debug: msg="END cli/error_regex.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/invalid.yaml b/test/integration/targets/ios_command/tests/cli/invalid.yaml deleted file mode 100644 index 35829ff605..0000000000 --- a/test/integration/targets/ios_command/tests/cli/invalid.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- debug: msg="START cli/invalid.yaml on connection={{ ansible_connection }}" - -- name: run invalid command - ios_command: - commands: show foo - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed" - -- name: run commands that include invalid command - ios_command: - commands: - - show version - - show foo - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed" - -- debug: msg="END cli/invalid.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/output.yaml b/test/integration/targets/ios_command/tests/cli/output.yaml deleted file mode 100644 index 945b388b17..0000000000 --- a/test/integration/targets/ios_command/tests/cli/output.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- debug: msg="START cli/output.yaml on connection={{ ansible_connection }}" - -- name: get output for single command - ios_command: - commands: - - show version - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - -- name: get output for multiple commands - ios_command: - commands: - - show version - - show interfaces - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - - "result.stdout | length == 2" - -- debug: msg="END cli/output.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_command/tests/cli/timeout.yaml b/test/integration/targets/ios_command/tests/cli/timeout.yaml deleted file mode 100644 index 4f430edeb2..0000000000 --- a/test/integration/targets/ios_command/tests/cli/timeout.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- debug: msg="START cli/timeout.yaml on connection={{ ansible_connection }}" - -- name: test bad condition - ios_command: - commands: - - show version - provider: "{{ cli }}" - wait_for: - - "result[0] contains bad_value_string" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- debug: msg="END cli/timeout.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/defaults/main.yaml b/test/integration/targets/ios_config/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_config/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_config/meta/main.yml b/test/integration/targets/ios_config/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_config/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_config/tasks/cli.yaml b/test/integration/targets/ios_config/tasks/cli.yaml deleted file mode 100644 index 82d196e4ed..0000000000 --- a/test/integration/targets/ios_config/tasks/cli.yaml +++ /dev/null @@ -1,17 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }} ansible_connection=network_cli" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_config/tasks/cli_config.yaml b/test/integration/targets/ios_config/tasks/cli_config.yaml deleted file mode 100644 index a3c82d6384..0000000000 --- a/test/integration/targets/ios_config/tasks/cli_config.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: collect all cli_config test cases - find: - paths: "{{ role_path }}/tests/cli_config" - 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 cases (connection=network_cli) - include: "{{ test_case_to_run }} ansible_connection=network_cli" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_config/tasks/main.yaml b/test/integration/targets/ios_config/tasks/main.yaml deleted file mode 100644 index 5e327e8d52..0000000000 --- a/test/integration/targets/ios_config/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: cli_config.yaml, tags: ['cli_config'] } diff --git a/test/integration/targets/ios_config/templates/basic/base_running_config b/test/integration/targets/ios_config/templates/basic/base_running_config deleted file mode 100644 index 37254dc963..0000000000 --- a/test/integration/targets/ios_config/templates/basic/base_running_config +++ /dev/null @@ -1,9 +0,0 @@ -version 15.6 -service timestamps debug datetime msec -service timestamps log datetime msec -no service password-encryption -! -hostname an-ios-01.ansible.com -! -boot-start-marker -boot-end-marker diff --git a/test/integration/targets/ios_config/templates/basic/config.j2 b/test/integration/targets/ios_config/templates/basic/config.j2 deleted file mode 100644 index 06f9848883..0000000000 --- a/test/integration/targets/ios_config/templates/basic/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -interface Loopback999 - description this is a test - shutdown - diff --git a/test/integration/targets/ios_config/templates/basic/configblock.j2 b/test/integration/targets/ios_config/templates/basic/configblock.j2 deleted file mode 100644 index 46150c4d90..0000000000 --- a/test/integration/targets/ios_config/templates/basic/configblock.j2 +++ /dev/null @@ -1,5 +0,0 @@ -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log diff --git a/test/integration/targets/ios_config/templates/basic/configexact1.j2 b/test/integration/targets/ios_config/templates/basic/configexact1.j2 deleted file mode 100644 index 82ad080c5d..0000000000 --- a/test/integration/targets/ios_config/templates/basic/configexact1.j2 +++ /dev/null @@ -1,6 +0,0 @@ -no ip access-list extended test -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log diff --git a/test/integration/targets/ios_config/templates/basic/configexact2.j2 b/test/integration/targets/ios_config/templates/basic/configexact2.j2 deleted file mode 100644 index 46150c4d90..0000000000 --- a/test/integration/targets/ios_config/templates/basic/configexact2.j2 +++ /dev/null @@ -1,5 +0,0 @@ -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log diff --git a/test/integration/targets/ios_config/templates/basic/configstrict1.j2 b/test/integration/targets/ios_config/templates/basic/configstrict1.j2 deleted file mode 100644 index 46150c4d90..0000000000 --- a/test/integration/targets/ios_config/templates/basic/configstrict1.j2 +++ /dev/null @@ -1,5 +0,0 @@ -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log diff --git a/test/integration/targets/ios_config/templates/basic/intended_running_config b/test/integration/targets/ios_config/templates/basic/intended_running_config deleted file mode 100644 index bdad8d3d8b..0000000000 --- a/test/integration/targets/ios_config/templates/basic/intended_running_config +++ /dev/null @@ -1,9 +0,0 @@ -version 15.6 -service timestamps debug datetime msec -service timestamps log datetime msec -no service password-encryption -! -hostname an-ios-02.ansible.com -! -boot-start-marker -boot-end-marker diff --git a/test/integration/targets/ios_config/templates/basic/macro.j2 b/test/integration/targets/ios_config/templates/basic/macro.j2 deleted file mode 100644 index 44a7a9bdbd..0000000000 --- a/test/integration/targets/ios_config/templates/basic/macro.j2 +++ /dev/null @@ -1,8 +0,0 @@ - A12345678 123456789 123456789 123456789 123456789 123456789 123456789 - B12345678 123456789 123456789 123456789 123456789 123456789 123456789 - C12345678 123456789 123456789 123456789 123456789 123456789 123456789 - D12345678 123456789 123456789 123456789 123456789 123456789 123456789 - E12345678 123456789 123456789 123456789 123456789 123456789 123456789 - F12345678 123456789 123456789 123456789 123456789 123456789 123456789 - G12345678 123456789 123456789 123456789 123456789 123456789 123456789 - H12345678 123456789 123456789 123456789 123456789 123456789 123456789 diff --git a/test/integration/targets/ios_config/templates/basic/setupblock.j2 b/test/integration/targets/ios_config/templates/basic/setupblock.j2 deleted file mode 100644 index f57aa49b73..0000000000 --- a/test/integration/targets/ios_config/templates/basic/setupblock.j2 +++ /dev/null @@ -1,5 +0,0 @@ -no ip access-list extended test -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log diff --git a/test/integration/targets/ios_config/templates/basic/setupexact.j2 b/test/integration/targets/ios_config/templates/basic/setupexact.j2 deleted file mode 100644 index e8791e272e..0000000000 --- a/test/integration/targets/ios_config/templates/basic/setupexact.j2 +++ /dev/null @@ -1,7 +0,0 @@ -no ip access-list extended test -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log - permit ip host 192.0.2.5 any log diff --git a/test/integration/targets/ios_config/templates/basic/setupstrict.j2 b/test/integration/targets/ios_config/templates/basic/setupstrict.j2 deleted file mode 100644 index e8791e272e..0000000000 --- a/test/integration/targets/ios_config/templates/basic/setupstrict.j2 +++ /dev/null @@ -1,7 +0,0 @@ -no ip access-list extended test -ip access-list extended test - permit ip host 192.0.2.1 any log - permit ip host 192.0.2.2 any log - permit ip host 192.0.2.3 any log - permit ip host 192.0.2.4 any log - permit ip host 192.0.2.5 any log diff --git a/test/integration/targets/ios_config/templates/defaults/config.j2 b/test/integration/targets/ios_config/templates/defaults/config.j2 deleted file mode 100644 index 1d4d9da8d4..0000000000 --- a/test/integration/targets/ios_config/templates/defaults/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -interface Loopback999 - description this is a test - no shutdown - diff --git a/test/integration/targets/ios_config/tests/cli/backup.yaml b/test/integration/targets/ios_config/tests/cli/backup.yaml deleted file mode 100644 index 0921d0086b..0000000000 --- a/test/integration/targets/ios_config/tests/cli/backup.yaml +++ /dev/null @@ -1,125 +0,0 @@ ---- -- debug: msg="START cli/cli_backup.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - commands: - - no description - - no shutdown - parents: - - interface Loopback999 - match: none - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - connection: local - -- name: delete backup files - file: - path: "{{ item.path }}" - state: absent - with_items: "{{backup_files.files|default([])}}" - -- name: configure device with config - ios_config: - src: basic/config.j2 - backup: yes - register: result - -- assert: - that: - - "result.changed == true" -# FIXME Bug https://github.com/ansible/ansible/issues/19382 -# - "result.updates is not defined" - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - connection: local - -- assert: - that: - - "backup_files.files is defined" - -- name: delete configurable backup file path - file: - path: "{{ item }}" - state: absent - with_items: - - "{{ role_path }}/backup_test_dir/" - - "{{ role_path }}/backup/backup.cfg" - -- name: take configuration backup in custom filename and directory path - ios_config: - backup: yes - backup_options: - filename: backup.cfg - dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-1 exist - find: - paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}/backup.cfg" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- name: take configuration backup in custom filename - ios_config: - backup: yes - backup_options: - filename: backup.cfg - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-2 exist - find: - paths: "{{ role_path }}/backup/backup.cfg" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- name: take configuration backup in custom path and default filename - ios_config: - backup: yes - backup_options: - dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-3 exist - find: - paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- debug: msg="END cli/cli_backup.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/defaults.yaml b/test/integration/targets/ios_config/tests/cli/defaults.yaml deleted file mode 100644 index 3792a9eb6a..0000000000 --- a/test/integration/targets/ios_config/tests/cli/defaults.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -- debug: msg="START cli/defaults.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - commands: - - no description - - shutdown - parents: - - interface Loopback999 - match: none - -- name: configure device with defaults included - ios_config: - src: defaults/config.j2 - defaults: yes - register: result - -- debug: var=result - -- assert: - that: - - "result.changed == true" -# FIXME Bug https://github.com/ansible/ansible/issues/19382 -# - "result.updates is not defined" - -- name: check device with defaults included - ios_config: - src: defaults/config.j2 - defaults: yes - register: result - -- debug: var=result - -- assert: - that: - - "result.changed == false" - - "result.updates is not defined" - -- name: Check device is in proper prompt after error - ios_config: - lines: - - mac-address-table notification mac-move - ignore_errors: yes - -- name: show interfaces brief to ensure deivce goes to valid prompt - ios_command: - commands: - - show interfaces - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - -- debug: msg="END cli/defaults.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/diff.yaml b/test/integration/targets/ios_config/tests/cli/diff.yaml deleted file mode 100644 index dbdd033a89..0000000000 --- a/test/integration/targets/ios_config/tests/cli/diff.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- debug: msg="START cli/diff.yaml on connection={{ ansible_connection }}" - -- name: Ensure hostname is preset - ios_system: - hostname: "{{ shorter_hostname }}" - -- name: ios_config diff against retrieved config - ios_config: - diff_against: intended - intended_config: "{{ lookup('file', '{{ role_path }}/templates/basic/intended_running_config') }}" - diff: true - register: result - -- assert: - that: - - "'hostname an-ios-02.ansible.com' in result['diff']['after']" - - "'hostname {{ shorter_hostname }}' in result['diff']['before']" - -- name: ios_config diff against provided running_config - ios_config: - diff_against: intended - intended_config: "{{ lookup('file', '{{ role_path }}/templates/basic/intended_running_config') }}" - running_config: "{{ lookup('file', '{{ role_path }}/templates/basic/base_running_config') }}" - diff: true - register: result - -- assert: - that: - - "'hostname an-ios-02.ansible.com' in result['diff']['after']" - - "'hostname an-ios-01.ansible.com' in result['diff']['before']" - -- debug: msg="END cli/diff.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/macro.yaml b/test/integration/targets/ios_config/tests/cli/macro.yaml deleted file mode 100644 index b526f47dc5..0000000000 --- a/test/integration/targets/ios_config/tests/cli/macro.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- - -- debug: msg="START cli/cli_macro.yaml on connection={{ ansible_connection }}" - -- name: "Check for macro support" - ios_command: - commands: - - "show parser macro brief" - register: supports_macro - ignore_errors: yes - -- name: "ios_config macro integration tests" - when: supports_macro is succeeded - block: - - - name: "Define macro name" - set_fact: - macro_name: 'MACRO_ANSIBLE_TEST' - - - name: "setup - remove configuration" - ios_config: - lines: - - 'no macro name {{ macro_name }}' - - 'do show clock' - match: none - - - name: "configure macro" - ios_config: - parents: "macro name {{ macro_name }}" - # before: [ 'no macro name ...'] - multiline_delimiter: '@' - after: '@' - match: line - replace: block - lines: "{{ lookup('template', 'basic/macro.j2') }}" - register: result - - - name: "Check if macro has been added" - assert: - that: - - "result.changed == true" - - - name: "configure macro again - idempotent check" - ios_config: - parents: "macro name {{ macro_name }}" - multiline_delimiter: '@' - after: '@' - match: line - replace: block - lines: "{{ lookup('template', 'basic/macro.j2') }}" - register: result - - - name: "macro already/correctly configured ?" - assert: - that: - - "result.changed == false" - - always: - - name: "teardown" - ios_config: - lines: - - "no macro name {{ macro_name }}" - - 'do show clock' - match: none - -- debug: msg="END cli/cli_macro.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/save.yaml b/test/integration/targets/ios_config/tests/cli/save.yaml deleted file mode 100644 index bd83961575..0000000000 --- a/test/integration/targets/ios_config/tests/cli/save.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- debug: msg="START cli/save.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - commands: - - no description - - no shutdown - parents: - - interface Loopback999 - match: none - save_when: modified - -- name: save should always run - ios_config: - save_when: always - register: result - -- assert: - that: - - "result.changed == true" - -- name: delete config (setup) - ios_config: - replace: line - lines: - - "no ip http server" - save_when: modified - register: result - -- name: save should run when changed - ios_config: - replace: line - lines: - - "ip http server" - save_when: modified - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - ios_config: - lines: - - "no ip http server" - register: result - -- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/src_basic.yaml b/test/integration/targets/ios_config/tests/cli/src_basic.yaml deleted file mode 100644 index c9381aca86..0000000000 --- a/test/integration/targets/ios_config/tests/cli/src_basic.yaml +++ /dev/null @@ -1,70 +0,0 @@ ---- -- debug: msg="START cli/src_basic.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - commands: - - no description - - no shutdown - parents: - - interface Loopback999 - match: none - -- name: configure device with config - ios_config: - src: basic/config.j2 - register: result - -- name: debug, remove me - debug: - msg: "{{ result }}" -- assert: - that: - - "result.changed == true" -# https://github.com/ansible/ansible-modules-core/issues/4807 -# FIXME Bug https://github.com/ansible/ansible/issues/19382 -# - "result.updates is not defined" - -- name: check device with config - ios_config: - src: basic/config.j2 - register: result - -- assert: - that: - - "result.changed == false" -# https://github.com/ansible/ansible-modules-core/issues/4807 -# FIXME Bug https://github.com/ansible/ansible/issues/19382 -# - "result.updates is not defined" - -- name: check for empty diff - ios_config: - running_config: | - service timestamps debug datetime msec - service timestamps log datetime msec - lines: - - service timestamps debug datetime msec - - service timestamps log datetime msec - check_mode: True - register: result -- assert: - that: - - "result.updates is undefined" - -- name: check for diff with ignore lines for running config - ios_config: - running_config: | - service timestamps debug datetime msec - service timestamps log datetime msec - lines: - - service timestamps debug datetime msec - - service timestamps log datetime msec - diff_ignore_lines: service timestamps log datetime msec - check_mode: True - register: result - -- assert: - that: - - "'service timestamps log datetime msec' in result.updates" - -- debug: msg="END cli/src_basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml b/test/integration/targets/ios_config/tests/cli/src_invalid.yaml deleted file mode 100644 index 0744324037..0000000000 --- a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- debug: msg="START cli/src_invalid.yaml on connection={{ ansible_connection }}" - - -# Defend https://github.com/ansible/ansible-modules-core/issues/4797 -- name: configure with invalid src - ios_config: - src: basic/foobar.j2 - register: result - ignore_errors: yes - -- assert: - that: - - "result.changed == false" - - "result.failed == true" - - "result.msg == 'path specified in src not found'" - -- debug: msg="END cli/src_invalid.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml deleted file mode 100644 index 4300a37d28..0000000000 --- a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: msg="START cli/src_match_none.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - commands: - - no description - - no shutdown - parents: - - interface Loopback999 - match: none - -- name: configure device with config - ios_config: - src: basic/config.j2 - match: none - register: result - -- assert: - that: - - "result.changed == true" -# https://github.com/ansible/ansible-modules-core/issues/4807 -# FIXME Bug https://github.com/ansible/ansible/issues/19382 -# - "result.updates is not defined" - -- name: check device with config - ios_config: - src: basic/config.j2 - register: result - -- assert: - that: - # Idempotent test -# https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.changed == false" - - "result.updates is not defined" - -- debug: msg="END cli/src_match_none.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel.yaml b/test/integration/targets/ios_config/tests/cli/sublevel.yaml deleted file mode 100644 index 7442cd9c2b..0000000000 --- a/test/integration/targets/ios_config/tests/cli/sublevel.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- debug: msg="START cli/sublevel.yaml on connection={{ ansible_connection }}" - -- name: setup test - ios_config: - lines: - - 'no ip access-list extended test' - - 'no ip access-list standard test' - match: none - -- name: configure sub level command - ios_config: - lines: ['permit ip any any log'] - parents: ['ip access-list extended test'] - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list extended test' in result.updates" - - "'permit ip any any log' in result.updates" - -- name: configure sub level command idempotent check - ios_config: - lines: ['permit ip any any log'] - parents: ['ip access-list extended test'] - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - 'no ip access-list extended test' - match: none - -- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml deleted file mode 100644 index 05d14ee77d..0000000000 --- a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- debug: msg="START cli/sublevel_block.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - parents: ['ip access-list extended test'] - before: ['no ip access-list extended test'] - after: ['exit'] - match: none - -- name: configure sub level command using block resplace - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ['ip access-list extended test'] - replace: block - after: ['exit'] - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list extended test' in result.updates" - - "'permit ip host 192.0.2.1 any log' in result.updates" - - "'permit ip host 192.0.2.2 any log' in result.updates" - - "'permit ip host 192.0.2.3 any log' in result.updates" - - "'permit ip host 192.0.2.4 any log' in result.updates" - -- name: check sub level command using block replace - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ['ip access-list extended test'] - replace: block - after: ['exit'] - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - no ip access-list extended test - match: none - -- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml deleted file mode 100644 index 0feb3f99e5..0000000000 --- a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -- debug: msg="START cli/sublevel_exact.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - - permit ip host 192.0.2.5 any log - parents: ip access-list extended test - before: no ip access-list extended test - after: exit - match: none - -- name: configure sub level command using exact match - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ip access-list extended test - before: no ip access-list extended test - after: exit - match: exact - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list extended test' in result.updates" - - "'permit ip host 192.0.2.1 any log' in result.updates" - - "'permit ip host 192.0.2.2 any log' in result.updates" - - "'permit ip host 192.0.2.3 any log' in result.updates" - - "'permit ip host 192.0.2.4 any log' in result.updates" - - "'permit ip host 192.0.2.5 any log' not in result.updates" - -- name: check sub level command using exact match - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ip access-list extended test - match: exact - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - no ip access-list extended test - match: none - -- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml deleted file mode 100644 index ea4cb11b3e..0000000000 --- a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -- debug: msg="START cli/sublevel_strict.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - - permit ip host 192.0.2.5 any log - parents: ip access-list extended test - before: no ip access-list extended test - match: none - -- name: configure sub level command using strict match - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ip access-list extended test - match: strict - register: result - -- assert: - that: - - "result.changed == false" - -- name: check sub level command using strict match - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.2 any log - parents: ip access-list extended test - after: exit - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list extended test' in result.updates" - - "'permit ip host 192.0.2.1 any log' not in result.updates" - - "'permit ip host 192.0.2.2 any log' in result.updates" - - "'permit ip host 192.0.2.3 any log' in result.updates" - - "'permit ip host 192.0.2.4 any log' not in result.updates" - - "'permit ip host 192.0.2.5 any log' not in result.updates" - -- name: teardown - ios_config: - lines: no ip access-list extended test - match: none - -- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_strict_mul_parents.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_strict_mul_parents.yaml deleted file mode 100644 index f99f77e341..0000000000 --- a/test/integration/targets/ios_config/tests/cli/sublevel_strict_mul_parents.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - class-map c1 - - match precedence 7 - - policy-map p1 - - class c1 - before: ['no policy-map p1', 'no class-map c1'] - match: none - -- name: configure sub level command using strict match - ios_config: - lines: - - set ip precedence 5 - - police cir percent 10 - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'set ip precedence 5' in result.updates" - - "'police cir percent 10' in result.updates" - -- name: change sub level command order and config with strict match - ios_config: - lines: - - police cir percent 10 - - set ip precedence 5 - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'set ip precedence 5' in result.updates" - - "'police cir percent 10' in result.updates" - -- name: Config sub level command with strict match (Idempotency) - ios_config: - lines: -#IOS does not change orded of class action if reconfigured -#so we have to use old order for Idempoteny - - set ip precedence 5 - - police cir percent 10 - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - no policy-map p1 - - no class-map c1 - match: none - -- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel.yaml b/test/integration/targets/ios_config/tests/cli/toplevel.yaml deleted file mode 100644 index 0408c8202a..0000000000 --- a/test/integration/targets/ios_config/tests/cli/toplevel.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- debug: msg="START cli/toplevel.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: ['hostname {{ shorter_hostname }}'] - match: none - -- name: configure top level command - ios_config: - lines: ['hostname foo'] - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - -- name: configure top level command idempotent check - ios_config: - lines: ['hostname foo'] - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: ['hostname {{ shorter_hostname }}'] - match: none - -- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml deleted file mode 100644 index 26039e06a3..0000000000 --- a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- debug: msg="START cli/toplevel_after.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - "snmp-server contact ansible" - - "hostname {{ shorter_hostname }}" - match: none - -- name: configure top level command with before - ios_config: - lines: ['hostname foo'] - after: ['snmp-server contact bar'] - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - - "'snmp-server contact bar' in result.updates" - -- name: configure top level command with before idempotent check - ios_config: - lines: ['hostname foo'] - after: ['snmp-server contact foo'] - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - "no snmp-server contact" - - "hostname {{ shorter_hostname }}" - match: none - -- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml deleted file mode 100644 index ab210be8c8..0000000000 --- a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- debug: msg="START cli/toplevel_before.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - "snmp-server contact ansible" - - "hostname {{ shorter_hostname }}" - match: none - -- name: configure top level command with before - ios_config: - lines: ['hostname foo'] - before: ['snmp-server contact bar'] - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - - "'snmp-server contact bar' in result.updates" - -- name: configure top level command with before idempotent check - ios_config: - lines: ['hostname foo'] - before: ['snmp-server contact foo'] - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: - - "no snmp-server contact" - - "hostname {{ shorter_hostname }}" - match: none - -- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml deleted file mode 100644 index 06aa838481..0000000000 --- a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- debug: msg="START cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: ['hostname {{ shorter_hostname }}'] - match: none - -- name: configure top level command - ios_config: - lines: ['hostname foo'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - -- name: configure top level command idempotent check - ios_config: - lines: ['hostname foo'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - ios_config: - lines: ['hostname {{ shorter_hostname }}'] - match: none - -- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli_config/cli_backup.yaml b/test/integration/targets/ios_config/tests/cli_config/cli_backup.yaml deleted file mode 100644 index a431c01fde..0000000000 --- a/test/integration/targets/ios_config/tests/cli_config/cli_backup.yaml +++ /dev/null @@ -1,113 +0,0 @@ -- debug: msg="END cli_config/backup.yaml on connection={{ ansible_connection }}" - -- name: delete configurable backup file path - file: - path: "{{ item }}" - state: absent - with_items: - - "{{ role_path }}/backup_test_dir/" - - "{{ role_path }}/backup/backup.cfg" - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - connection: local - -- name: delete backup files - file: - path: "{{ item.path }}" - state: absent - with_items: "{{backup_files.files|default([])}}" - -- name: take config backup - cli_config: - backup: yes - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - connection: local - -- assert: - that: - - "backup_files.files is defined" - -- name: take configuration backup in custom filename and directory path - cli_config: - backup: yes - backup_options: - filename: backup.cfg - dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-1 exist - find: - paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}/backup.cfg" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- name: take configuration backup in custom filename - cli_config: - backup: yes - backup_options: - filename: backup.cfg - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-2 exist - find: - paths: "{{ role_path }}/backup/backup.cfg" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- name: take configuration backup in custom path and default filename - cli_config: - backup: yes - backup_options: - dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: check if the backup file-3 exist - find: - paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_file - connection: local - -- assert: - that: - - "backup_file.files is defined" - -- debug: msg="END cli_config/backup.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli_config/cli_basic.yaml b/test/integration/targets/ios_config/tests/cli_config/cli_basic.yaml deleted file mode 100644 index 607b3df498..0000000000 --- a/test/integration/targets/ios_config/tests/cli_config/cli_basic.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -- debug: msg="START cli_config/cli_basic.yaml on connection={{ ansible_connection }}" - -- name: setup - cli_config: &rm - config: | - interface loopback999 - no description - shutdown - diff_match: none - -- name: configure device with config - cli_config: &conf - config: "{{ lookup('template', 'basic/config.j2') }}" - register: result - -- assert: - that: - - "result.changed == true" - -- name: Idempotence - cli_config: *conf - register: result - -- assert: - that: - - "result.changed == false" - -- name: remove config - cli_config: *rm - -- name: configure device with config - cli_config: - config: "{{ lookup('template', 'basic/config.j2') }}" - defaults: yes - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - cli_config: *rm - -- debug: msg="END cli_config/cli_basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli_config/cli_block_replace.yaml b/test/integration/targets/ios_config/tests/cli_config/cli_block_replace.yaml deleted file mode 100644 index f66f83f96d..0000000000 --- a/test/integration/targets/ios_config/tests/cli_config/cli_block_replace.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- debug: msg="START cli_config/cli_block_replace.yaml on connection={{ ansible_connection }}" - -- name: setup - remove configuration - cli_config: - config: "{{ lookup('template', 'basic/setupblock.j2') }}" - diff_match: none - -- name: block replace - cli_config: &block - config: "{{ lookup('template', 'basic/configblock.j2') }}" - diff_replace: block - register: result - -- assert: - that: - - "result.changed == true" - -- name: block replace (Idempotence) - cli_config: *block - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - cli_config: - config: no ip access-list extended test - diff_match: none - -- debug: msg="END cli_config/cli_block_replace.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli_config/cli_exact_match.yaml b/test/integration/targets/ios_config/tests/cli_config/cli_exact_match.yaml deleted file mode 100644 index 597afa5099..0000000000 --- a/test/integration/targets/ios_config/tests/cli_config/cli_exact_match.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- debug: msg="START cli_config/cli_exact_match.yaml on connection={{ ansible_connection }}" - -- name: setup - remove configuration - cli_config: - config: "{{ lookup('template', 'basic/setupexact.j2') }}" - diff_match: none - -- name: configure using exact match - cli_config: - config: "{{ lookup('template', 'basic/configexact1.j2') }}" - diff_match: exact - register: result - -- assert: - that: - - "result.changed == true" - -- name: check using exact match - cli_config: - config: "{{ lookup('template', 'basic/configexact2.j2') }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - cli_config: - config: no ip access-list extended test - diff_match: none - -- debug: msg="END cli_config/cli_exact_match.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli_config/cli_strict_match.yaml b/test/integration/targets/ios_config/tests/cli_config/cli_strict_match.yaml deleted file mode 100644 index 45ba54f1ef..0000000000 --- a/test/integration/targets/ios_config/tests/cli_config/cli_strict_match.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- debug: msg="START cli_config/cli_strict_match.yaml on connection={{ ansible_connection }}" - -- name: setup - remove configuration - cli_config: - config: "{{ lookup('template', 'basic/setupstrict.j2') }}" - diff_match: none - -- name: configure using strict match - cli_config: - config: "{{ lookup('template', 'basic/configstrict1.j2') }}" - diff_match: strict - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - cli_config: - config: no ip access-list extended test - diff_match: none - -- debug: msg="END cli_config/cli_strict_match.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_facts/defaults/main.yaml b/test/integration/targets/ios_facts/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_facts/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_facts/meta/main.yml b/test/integration/targets/ios_facts/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_facts/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_facts/tasks/cli.yaml b/test/integration/targets/ios_facts/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_facts/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_facts/tasks/main.yaml b/test/integration/targets/ios_facts/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_facts/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_facts/tests/cli/all_facts.yaml b/test/integration/targets/ios_facts/tests/cli/all_facts.yaml deleted file mode 100644 index 5f2a754487..0000000000 --- a/test/integration/targets/ios_facts/tests/cli/all_facts.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- debug: msg="START cli/all_facts.yaml on connection={{ ansible_connection }}" - - -- name: test getting all facts - ios_facts: - gather_subset: - - all - provider: "{{ cli }}" - register: result - - - -- assert: - that: - # _facts modules should never report a change - - "result.changed == false" - - # Correct subsets are present - - "'config' in result.ansible_facts.ansible_net_gather_subset" - - "'hardware' in result.ansible_facts.ansible_net_gather_subset" - - "'default' in result.ansible_facts.ansible_net_gather_subset" - - "'interfaces' in result.ansible_facts.ansible_net_gather_subset" - - # Items from those subsets are present - - "result.ansible_facts.ansible_net_filesystems is defined" - # Check that these facts not only are present, but are valid (positive integers) - - "result.ansible_facts.ansible_net_memfree_mb > 1" - - "result.ansible_facts.ansible_net_memtotal_mb > 1" - -- assert: - that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}" - loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}" - -- debug: msg="END cli/all_facts.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_facts/tests/cli/default_facts.yaml b/test/integration/targets/ios_facts/tests/cli/default_facts.yaml deleted file mode 100644 index 11cb9e518f..0000000000 --- a/test/integration/targets/ios_facts/tests/cli/default_facts.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- debug: msg="START cli/default_facts.yaml on connection={{ ansible_connection }}" - - -- name: test getting default facts - ios_facts: - provider: "{{ cli }}" - register: result - -- assert: - that: - # _facts modules should never report a change - - "result.changed == false" - - # Correct subsets are present - - "'hardware' in result.ansible_facts.ansible_net_gather_subset" - - "'default' in result.ansible_facts.ansible_net_gather_subset" - - "'interfaces' in result.ansible_facts.ansible_net_gather_subset" - - "result.ansible_facts.ansible_net_filesystems is defined" - # ... and not present - - "'config' not in result.ansible_facts.ansible_net_gather_subset" - - # Items from those subsets are present - - "result.ansible_facts.ansible_net_filesystems is defined" #hw - - "result.ansible_facts.ansible_net_memtotal_mb > 10" #hw - - "result.ansible_facts.ansible_net_interfaces | length > 1" # more than one interface returned - - # ... and not present - - "result.ansible_facts.ansible_net_config is not defined" # config - -- assert: - that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}" - loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}" - -- debug: msg="END cli/default.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_facts/tests/cli/invalid_subset.yaml b/test/integration/targets/ios_facts/tests/cli/invalid_subset.yaml deleted file mode 100644 index e7d4281f7d..0000000000 --- a/test/integration/targets/ios_facts/tests/cli/invalid_subset.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- debug: msg="START cli/invalid_subset.yaml on connection={{ ansible_connection }}" - - -- name: test invalid subset (foobar) - ios_facts: - gather_subset: - - "foobar" - provider: "{{ cli }}" - register: result - ignore_errors: true - - -- assert: - that: - # Failures shouldn't return changes - - "result.changed == false" - # It's a failure - - "result.failed == true" - # Sensible Failure message - - "result.msg == 'Subset must be one of [config, default, hardware, interfaces], got foobar'" - -############### -# FIXME Future -# We may in the future want to add a test for - -- name: test subset specified multiple times - ios_facts: - gather_subset: - - "!hardware" - - "hardware" - provider: "{{ cli }}" - register: result - ignore_errors: true - -- assert: - that: - # Failures shouldn't return changes - - "result.changed == false" - # It's a failure - - "result.failed == true" - # Sensible Failure message - - "result.msg == 'Bad subset'" - ignore_errors: true - - - -- debug: msg="END cli/invalid_subset.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml b/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml deleted file mode 100644 index da46f2cd90..0000000000 --- a/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- debug: msg="START cli/not_hardware_facts.yaml on connection={{ ansible_connection }}" - - -- name: test not hardware - ios_facts: - gather_subset: - - "!hardware" - provider: "{{ cli }}" - register: result - -- assert: - that: - # _facts modules should never report a change - - "result.changed == false" - - # Correct subsets are present - - "'config' in result.ansible_facts.ansible_net_gather_subset" - - - "'default' in result.ansible_facts.ansible_net_gather_subset" - - "'interfaces' in result.ansible_facts.ansible_net_gather_subset" - # ... and not present - - "'hardware' not in result.ansible_facts.ansible_net_gather_subset" - - # Items from those subsets are present - - "result.ansible_facts.ansible_net_interfaces | length > 1" # more than one interface returned - # ... and not present - - "result.ansible_facts.ansible_net_filesystems is not defined" - - "result.ansible_facts.ansible_net_filesystems_info is not defined" - -- debug: msg="END cli/not_hardware_facts.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_file/aliases b/test/integration/targets/ios_file/aliases deleted file mode 100644 index 6bb69158a7..0000000000 --- a/test/integration/targets/ios_file/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/ios/group1 diff --git a/test/integration/targets/ios_file/defaults/main.yaml b/test/integration/targets/ios_file/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_file/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_file/ios1.cfg b/test/integration/targets/ios_file/ios1.cfg deleted file mode 100644 index 120dd4cad7..0000000000 --- a/test/integration/targets/ios_file/ios1.cfg +++ /dev/null @@ -1,3 +0,0 @@ -vlan 3 - name ank_vlan3 -! diff --git a/test/integration/targets/ios_file/nonascii.bin b/test/integration/targets/ios_file/nonascii.bin Binary files differdeleted file mode 100644 index 14c6ddb1b8..0000000000 --- a/test/integration/targets/ios_file/nonascii.bin +++ /dev/null diff --git a/test/integration/targets/ios_file/tasks/cli.yaml b/test/integration/targets/ios_file/tasks/cli.yaml deleted file mode 100644 index 575f5d0a8e..0000000000 --- a/test/integration/targets/ios_file/tasks/cli.yaml +++ /dev/null @@ -1,17 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_file/tasks/main.yaml b/test/integration/targets/ios_file/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_file/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_file/tests/cli/net_get.yaml b/test/integration/targets/ios_file/tests/cli/net_get.yaml deleted file mode 100644 index 906429f534..0000000000 --- a/test/integration/targets/ios_file/tests/cli/net_get.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- debug: msg="START ios cli/net_get.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: - - ip ssh version 2 - - ip scp server enable - - username {{ ansible_ssh_user }} privilege 15 - match: none - -- name: setup (copy file to be fetched from device) - net_put: - src: ios1.cfg - register: result - -- name: setup (remove file from localhost if present) - file: - path: ios_{{ inventory_hostname }}.cfg - state: absent - delegate_to: localhost - -- name: get the file from device with relative destination - net_get: - src: ios1.cfg - dest: 'ios_{{ inventory_hostname }}.cfg' - register: result - -- assert: - that: - - result.changed == true - -- name: Idempotency check - net_get: - src: ios1.cfg - dest: 'ios_{{ inventory_hostname }}.cfg' - register: result - -- assert: - that: - - result.changed == false - -- name: setup (remove file from localhost if present) - file: - path: ios_{{ inventory_hostname }}.cfg - state: absent - delegate_to: localhost - -- debug: msg="END ios cli/net_get.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_file/tests/cli/net_put.yaml b/test/integration/targets/ios_file/tests/cli/net_put.yaml deleted file mode 100644 index d7c1b03630..0000000000 --- a/test/integration/targets/ios_file/tests/cli/net_put.yaml +++ /dev/null @@ -1,73 +0,0 @@ ---- -- debug: - msg: "START ios cli/net_put.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: - - ip ssh version 2 - - ip scp server enable - - username {{ ansible_ssh_user }} privilege 15 - match: none - -- name: Delete existing files if present on remote host - ios_command: - commands: "{{ item }}" - loop: - - delete /force ios1.cfg - - delete /force ios.cfg - - delete /force nonascii.bin - ignore_errors: true - -- name: copy file from controller to ios + scp (Default) - net_put: - src: ios1.cfg - register: result - -- assert: - that: - - result.changed == true - -- name: Idempotency Check - net_put: - src: ios1.cfg - register: result - -- assert: - that: - - result.changed == false - -- name: copy file from controller to ios + dest specified - net_put: - src: ios1.cfg - dest: ios.cfg - register: result - -- assert: - that: - - result.changed == true - -- name: copy file with non-ascii characters to ios in template mode(Fail case) - net_put: - src: nonascii.bin - mode: 'text' - register: result - ignore_errors: true - -- assert: - that: - - result.failed == true - -- name: copy file with non-ascii characters to ios in default mode(binary) - net_put: - src: nonascii.bin - register: result - -- assert: - that: - - result.changed == true - -- debug: msg="END ios cli/net_put.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_interface/defaults/main.yaml b/test/integration/targets/ios_interface/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_interface/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_interface/meta/main.yaml b/test/integration/targets/ios_interface/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_interface/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_interface/tasks/cli.yaml b/test/integration/targets/ios_interface/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_interface/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_interface/tasks/main.yaml b/test/integration/targets/ios_interface/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_interface/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_interface/tests/cli/basic.yaml b/test/integration/targets/ios_interface/tests/cli/basic.yaml deleted file mode 100644 index a61152d6f7..0000000000 --- a/test/integration/targets/ios_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,228 +0,0 @@ ---- -- debug: msg="START ios_interface cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Configure interface (setup) - ios_interface: - name: "{{ test_interface }}" - description: test-interface-1 - speed: 1000 - mtu: 1800 - state: present - provider: "{{ cli }}" - register: result - -- name: Configure interface - ios_interface: - name: "{{ test_interface }}" - description: test-interface-initial - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"description test-interface-initial" in result.commands' - -- name: Confgure interface (idempotent) - ios_interface: - name: "{{ test_interface }}" - description: test-interface-initial - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Confgure interface parameters - ios_interface: - name: "{{ test_interface }}" - description: test-interface - mtu: 2000 - state: present - provider: "{{ cli }}" - 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 - ios_interface: - name: "{{ test_interface }}" - description: test-interface-1 - mtu: 1800 - state: present - provider: "{{ cli }}" - 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 - ios_interface: - name: "{{ test_interface }}" - enabled: False - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"shutdown" in result.commands' - -- name: Enable interface - ios_interface: - name: "{{ test_interface }}" - enabled: True - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"no shutdown" in result.commands' - -- name: Confgure second interface (setup) - ios_interface: - name: "{{ test_interface2 }}" - description: test-interface-initial - speed: 1000 - mtu: 1800 - state: present - provider: "{{ cli }}" - register: result - -- name: Add interface aggregate - ios_interface: - aggregate: - - { name: "{{ test_interface }}", mtu: 2000, description: test-interface-1 } - - { name: "{{ test_interface2 }}", mtu: 2000, description: test-interface-2 } - speed: 1000 - state: present - provider: "{{ cli }}" - 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) - ios_interface: - aggregate: - - { name: "{{ test_interface }}", mtu: 2000, description: test-interface-1 } - - { name: "{{ test_interface2 }}", mtu: 2000, description: test-interface-2 } - speed: 1000 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable interface aggregate - ios_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - enabled: False - state: present - provider: "{{ cli }}" - 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 - ios_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - enabled: True - state: present - provider: "{{ cli }}" - 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 - ios_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - provider: "{{ cli }}" - -- name: Create loopback interface aggregate - ios_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface Loopback9" in result.commands' - - '"interface Loopback10" in result.commands' - -- name: Delete loopback interface aggregate - ios_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - provider: "{{ cli }}" - 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) - ios_interface: - aggregate: - - name: Loopback9 - - name: Loopback10 - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- debug: msg="END ios_interface cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_interface/tests/cli/intent.yaml b/test/integration/targets/ios_interface/tests/cli/intent.yaml deleted file mode 100644 index 1758c6cb98..0000000000 --- a/test/integration/targets/ios_interface/tests/cli/intent.yaml +++ /dev/null @@ -1,140 +0,0 @@ ---- -- debug: msg="START ios_interface cli/intent.yaml on connection={{ ansible_connection }}" - -- name: Check intent arguments - ios_interface: - name: "{{ test_interface }}" - state: up - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check intent arguments (failed condition) - ios_interface: - name: "{{ test_interface }}" - state: down - provider: "{{ cli }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - -- name: Config + intent - ios_interface: - name: "{{ test_interface }}" - enabled: False - state: down - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.failed == false" - -- name: Config + intent (fail) - ios_interface: - name: "{{ test_interface }}" - enabled: False - provider: "{{ cli }}" - 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 - provider: "{{ cli }}" - register: show_lldp_neighbors_result - -- block: - - name: Check neighbors intent arguments - ios_interface: - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.failed == false" - - - name: Check neighbors intent arguments (failed condition) - ios_interface: - name: Gi0/0 - neighbors: - - port: dummy_port - host: dummy_host - provider: "{{ cli }}" - 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[0]' - -- name: Aggregate config + intent (pass) - ios_interface: - aggregate: - - name: "{{ test_interface }}" - enabled: True - state: up - provider: "{{ cli }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == false" - -- block: - - name: Aggregate neighbors intent (pass) - ios_interface: - aggregate: - - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - provider: "{{ cli }}" - ignore_errors: yes - register: result - - - assert: - that: - - "result.failed == false" - - - name: Aggregate neighbors intent (fail) - ios_interface: - aggregate: - - name: Gi0/0 - neighbors: - - port: eth0 - host: netdev - - port: dummy_port - host: dummy_host - provider: "{{ cli }}" - 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[0]" diff --git a/test/integration/targets/ios_interface/tests/cli/net_interface.yaml b/test/integration/targets/ios_interface/tests/cli/net_interface.yaml deleted file mode 100644 index 45f70a1ddb..0000000000 --- a/test/integration/targets/ios_interface/tests/cli/net_interface.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- 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: Configure interface (setup) - net_interface: - name: "{{ test_interface }}" - description: test-interface-1 - speed: 1000 - mtu: 1800 - state: present - provider: "{{ cli }}" - register: result - -- name: Configure interface using platform agnostic module - net_interface: - name: "{{ test_interface }}" - description: test-interface-initial - state: present - provider: "{{ cli }}" - 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 - provider: "{{ cli }}" - 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_interfaces/defaults/main.yaml b/test/integration/targets/ios_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_interfaces/meta/main.yaml b/test/integration/targets/ios_interfaces/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_interfaces/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_interfaces/tasks/cli.yaml b/test/integration/targets/ios_interfaces/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_interfaces/tasks/main.yaml b/test/integration/targets/ios_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 7494111773..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - description this is interface1 - mtu 65 - speed 10 - no shutdown - interface GigabitEthernet 0/2 - description this is interface2 - mtu 110 - duplex auto - speed 100 - shutdown diff --git a/test/integration/targets/ios_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index 3cebd16814..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface loopback888 - no description - no shutdown - interface loopback999 - no description - no shutdown - interface GigabitEthernet 0/1 - no description - no mtu - no duplex - no speed - no shutdown - interface GigabitEthernet 0/2 - no description - no mtu - no duplex - no speed - no shutdown diff --git a/test/integration/targets/ios_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index 04c919403e..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete attributes of all configured interfaces - ios_interfaces: &deleted - state: deleted - register: result - - - debug: - msg: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) }}" - - "{{ deleted['before'] | symmetric_difference(result['before']) }}" - - "{{ deleted['after'] | symmetric_difference(result['after']) }}" - - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index cb0761e9a4..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: - msg: "START ios_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_interfaces: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_interfaces: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_interfaces: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' diff --git a/test/integration/targets/ios_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 775edbe1bd..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- debug: - msg: "START Merged ios_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_interfaces: &merged - config: - - name: GigabitEthernet0/1 - description: 'Configured and Merged by Ansible-Network' - mtu: 110 - enabled: True - duplex: half - - name: GigabitEthernet0/2 - description: 'Configured and Merged by Ansible-Network' - mtu: 2800 - enabled: False - speed: 100 - duplex: full - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index d0231f1de6..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all interfaces with provided configuration - ios_interfaces: &overridden - config: - - name: GigabitEthernet0/2 - description: 'Configured and Overridden by Ansible-Network' - enabled: False - duplex: full - mtu: 2000 - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index 24b21a6988..0000000000 --- a/test/integration/targets/ios_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed interfaces with provided configuration - ios_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - description: 'Configured and Replaced by Ansible-Network' - mtu: 110 - - name: GigabitEthernet0/2 - description: 'Configured and Replaced by Ansible-Network' - speed: 10 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_interfaces/vars/main.yaml b/test/integration/targets/ios_interfaces/vars/main.yaml deleted file mode 100644 index 1eb0cb68ad..0000000000 --- a/test/integration/targets/ios_interfaces/vars/main.yaml +++ /dev/null @@ -1,214 +0,0 @@ ---- -merged: - before: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - duplex: auto - enabled: true - name: GigabitEthernet0/1 - speed: auto - - duplex: auto - enabled: true - name: GigabitEthernet0/2 - speed: auto - - commands: - - "interface GigabitEthernet0/1" - - "description Configured and Merged by Ansible-Network" - - "mtu 110" - - "duplex half" - - "interface GigabitEthernet0/2" - - "description Configured and Merged by Ansible-Network" - - "mtu 2800" - - "speed 100" - - "duplex full" - - "shutdown" - - after: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - description: Configured and Merged by Ansible-Network - duplex: half - enabled: true - mtu: 110 - name: GigabitEthernet0/1 - speed: auto - - description: Configured and Merged by Ansible-Network - duplex: full - enabled: false - mtu: 2800 - name: GigabitEthernet0/2 - speed: '100' - -replaced: - before: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - description: this is interface1 - duplex: auto - enabled: true - mtu: 65 - name: GigabitEthernet0/1 - speed: '10' - - description: this is interface2 - duplex: auto - enabled: false - mtu: 110 - name: GigabitEthernet0/2 - speed: '100' - - commands: - - "interface GigabitEthernet0/1" - - "no speed" - - "description Configured and Replaced by Ansible-Network" - - "mtu 110" - - "interface GigabitEthernet0/2" - - "no shutdown" - - "no mtu" - - "description Configured and Replaced by Ansible-Network" - - "speed 10" - - after: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - description: Configured and Replaced by Ansible-Network - duplex: auto - enabled: true - mtu: 110 - name: GigabitEthernet0/1 - speed: auto - - description: Configured and Replaced by Ansible-Network - duplex: auto - enabled: true - name: GigabitEthernet0/2 - speed: '10' - -overridden: - before: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - description: this is interface1 - duplex: auto - enabled: true - mtu: 65 - name: GigabitEthernet0/1 - speed: '10' - - description: this is interface2 - duplex: auto - enabled: false - mtu: 110 - name: GigabitEthernet0/2 - speed: '100' - - commands: - - "interface GigabitEthernet0/1" - - "no description" - - "no speed" - - "no mtu" - - "interface GigabitEthernet0/2" - - "no speed" - - "description Configured and Overridden by Ansible-Network" - - "mtu 2000" - - "duplex full" - - after: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - duplex: auto - enabled: true - name: GigabitEthernet0/1 - speed: auto - - description: Configured and Overridden by Ansible-Network - duplex: full - enabled: false - mtu: 2000 - name: GigabitEthernet0/2 - speed: auto - -deleted: - before: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - description: this is interface1 - duplex: auto - enabled: true - mtu: 65 - name: GigabitEthernet0/1 - speed: '10' - - description: this is interface2 - duplex: auto - enabled: false - mtu: 110 - name: GigabitEthernet0/2 - speed: '100' - - commands: - - "interface GigabitEthernet0/1" - - "no description" - - "no speed" - - "no mtu" - - "interface GigabitEthernet0/2" - - "no description" - - "no shutdown" - - "no speed" - - "no mtu" - - after: - - enabled: true - name: loopback888 - - enabled: true - name: loopback999 - - duplex: auto - enabled: true - name: GigabitEthernet0/0 - speed: auto - - duplex: auto - enabled: true - name: GigabitEthernet0/1 - speed: auto - - duplex: auto - enabled: true - name: GigabitEthernet0/2 - speed: auto diff --git a/test/integration/targets/ios_l2_interface/defaults/main.yaml b/test/integration/targets/ios_l2_interface/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_l2_interface/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_l2_interface/meta/main.yml b/test/integration/targets/ios_l2_interface/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_l2_interface/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_l2_interface/tasks/cli.yaml b/test/integration/targets/ios_l2_interface/tasks/cli.yaml deleted file mode 100644 index a71aef3f53..0000000000 --- a/test/integration/targets/ios_l2_interface/tasks/cli.yaml +++ /dev/null @@ -1,26 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- name: run test case (connection=local) - include: "{{ test_case_to_run }} ansible_connection=local" - with_first_found: - - files: "{{ test_items|default([]) }}" - skip: true - loop_control: - loop_var: test_case_to_run - tags: connection_local diff --git a/test/integration/targets/ios_l2_interface/tasks/main.yaml b/test/integration/targets/ios_l2_interface/tasks/main.yaml deleted file mode 100644 index 03f5b146cc..0000000000 --- a/test/integration/targets/ios_l2_interface/tasks/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- block: - - { include: cli.yaml, tags: ['cli'] } - when: 'switch_type == "L2"' diff --git a/test/integration/targets/ios_l2_interface/tests/cli/agg.yaml b/test/integration/targets/ios_l2_interface/tests/cli/agg.yaml deleted file mode 100644 index 9de5904615..0000000000 --- a/test/integration/targets/ios_l2_interface/tests/cli/agg.yaml +++ /dev/null @@ -1,81 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} ios_l2_interface aggregate test" - -- name: Setup - Ensure interfaces are switchport - ios_config: - lines: - - switchport - parents: - - "interface {{ item }}" - loop: - - "{{ test_interface }}" - - "{{ test_interface2 }}" - -- name: "Setup vlans" - ios_vlan: - aggregate: - - vlan_id: 6 - - vlan_id: 15 - provider: "{{ cli }}" - -- name: Setup - Remove interface aggregate before testing - ios_l2_interface: - aggregate: - - { name: "{{ test_interface }}", mode: access, access_vlan: 6 } - - { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 } - state: absent - provider: "{{ cli }}" - -- block: - - name: Configure interface for access_vlan aggregate - ios_l2_interface: &conf_agg - aggregate: - - { name: "{{ test_interface }}", mode: access, access_vlan: 6 } - - { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 } - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - - name: Configure interface for access_vlan aggregate(Idempotence) - ios_l2_interface: *conf_agg - register: result - - - assert: - that: - - "result.changed == false" - - - name: Remove interface aggregate - ios_l2_interface: &rm_agg - aggregate: - - { name: "{{ test_interface }}", mode: access, access_vlan: 6 } - - { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 } - provider: "{{ cli }}" - state: absent - register: result - - - assert: - that: - - "result.changed == true" - - - name: Remove interface aggregate(Idempotence) - ios_l2_interface: *rm_agg - register: result - - - assert: - that: - - "result.changed == false" - - always: - - name: "remove vlans" - ios_vlan: - aggregate: - - vlan_id: 6 - - vlan_id: 15 - state: absent - provider: "{{ cli }}" - ignore_errors: yes - -- debug: msg="END connection={{ ansible_connection }} ios_l2_interface aggregate test" diff --git a/test/integration/targets/ios_l2_interface/tests/cli/sanity.yaml b/test/integration/targets/ios_l2_interface/tests/cli/sanity.yaml deleted file mode 100644 index 44466f9617..0000000000 --- a/test/integration/targets/ios_l2_interface/tests/cli/sanity.yaml +++ /dev/null @@ -1,168 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} ios_l2_interface sanity test" - -- name: "Setup interface" - ios_config: &default - lines: - - "default interface {{ test_interface }}" - provider: "{{ cli }}" - -- name: set trunk encapsulation type - ios_config: - lines: - - switchport trunk encapsulation dot1q - parents: - - "interface {{ test_interface }}" - provider: "{{ cli }}" - -- name: "Setup vlans" - ios_vlan: - aggregate: - - vlan_id: 5 - - vlan_id: 6 - - vlan_id: 7 - - vlan_id: 8 - - vlan_id: 9 - - vlan_id: 10 - - vlan_id: 20 - provider: "{{ cli }}" - -- block: - - name: Ensure interface is in its default switchport state - ios_l2_interface: &def_swi - name: "{{ test_interface }}" - state: unconfigured - provider: "{{ cli }}" - - - name: Ensure interface is configured for access vlan 20 - ios_l2_interface: &acc_vl - name: "{{ test_interface }}" - mode: access - access_vlan: 20 - provider: "{{ cli }}" - register: result - - - assert: &true - that: - - "result.changed == true" - - - name: "access vlan Idempotence" - ios_l2_interface: *acc_vl - register: result - - - assert: &false - that: - - "result.changed == false" - - - name: Ensure interface only has vlans 5-10 as trunk vlans - ios_l2_interface: &tr_vl - name: "{{ test_interface }}" - mode: trunk - native_vlan: 10 - trunk_allowed_vlans: 5-10 - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: "trunk vlan Idempotence" - ios_l2_interface: *tr_vl - register: result - - - assert: *false - - - name: Ensure interface is a trunk port and ensure 2-50 are being tagged (doesn't mean others aren't also being tagged) - ios_l2_interface: &tag - name: "{{ test_interface }}" - mode: trunk - native_vlan: 10 - trunk_vlans: 2-50 - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: "tag vlan Idempotence" - ios_l2_interface: *tag - register: result - - - assert: *false - - - name: Remove full trunk vlan range 2-50 - ios_l2_interface: &no_tag - name: "{{ test_interface }}" - mode: trunk - trunk_vlans: 2-50 - state: absent - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: Check Idempotence Remove full trunk vlan range 2-50 - ios_l2_interface: *no_tag - register: result - - - assert: *false - - - name: Reconfigure interface trunk port and ensure 2-50 are being tagged - ios_l2_interface: *tag - register: result - - - assert: *true - - - name: Check Idempotence Reconfigure interface trunk port and ensure 2-50 are being tagged - ios_l2_interface: *tag - register: result - - - assert: *false - - - name: Remove partial trunk vlan range 30-4094 are removed - ios_l2_interface: &partial - name: "{{ test_interface }}" - mode: trunk - trunk_vlans: 30-4094 - state: absent - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: Check Idempotence Remove partial trunk vlan range 30-4094 are removed - ios_l2_interface: *partial - register: result - - - assert: *false - - - name: put interface default state - ios_l2_interface: *def_swi - register: result - - - assert: *true - - - name: "default state idempotence" - ios_l2_interface: *def_swi - register: result - - - assert: *false - - always: - - name: "remove vlans" - ios_vlan: - aggregate: - - vlan_id: 5 - - vlan_id: 6 - - vlan_id: 7 - - vlan_id: 8 - - vlan_id: 9 - - vlan_id: 10 - - vlan_id: 20 - state: absent - provider: "{{ cli }}" - ignore_errors: yes - - - name: "default interface" - ios_config: *default - ignore_errors: yes - -- debug: msg="END connection={{ ansible_connection }} ios_l2_interface sanity test" diff --git a/test/integration/targets/ios_l2_interfaces/defaults/main.yaml b/test/integration/targets/ios_l2_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_l2_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_l2_interfaces/meta/main.yaml b/test/integration/targets/ios_l2_interfaces/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_l2_interfaces/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_l2_interfaces/tasks/cli.yaml b/test/integration/targets/ios_l2_interfaces/tasks/cli.yaml deleted file mode 100644 index 3bafcd702f..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Get the IOS version - ios_facts: - gather_subset: all - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_l2_interfaces/tasks/main.yaml b/test/integration/targets/ios_l2_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 01d1b309e7..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - switchport access vlan 10 - interface GigabitEthernet 0/2 - switchport trunk encapsulation dot1q - switchport trunk native vlan 10 - switchport trunk allowed vlan 10-20,40 - switchport trunk pruning vlan 10,20 - switchport mode trunk - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index 3b502087ca..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - no switchport access vlan - no switchport trunk encapsulation - no switchport trunk native vlan - no switchport trunk allowed vlan - no switchport trunk pruning vlan - no switchport mode - interface GigabitEthernet 0/2 - no switchport access vlan - no switchport trunk encapsulation - no switchport trunk native vlan - no switchport trunk allowed vlan - no switchport trunk pruning vlan - no switchport mode - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index 7f460e6b32..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_l2_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete L2 attributes from all configured interfaces - ios_l2_interfaces: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_l2_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index 66ef9a6a06..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: - msg: "START ios_l2_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_l2_interfaces: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_l2_interfaces: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_l2_interfaces: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 18edcec050..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- debug: - msg: "START Merged ios_l2_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_l2_interfaces: &merged - config: - - name: GigabitEthernet0/1 - access: - vlan: 30 - - name: GigabitEthernet0/2 - trunk: - allowed_vlans: 15-20,40 - native_vlan: 20 - pruning_vlans: 10,20 - encapsulation: dot1q - mode: trunk - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_l2_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index 66a60653d7..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_l2_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device L2 configuration from all interfaces with provided configuration - ios_l2_interfaces: &overridden - config: - - name: GigabitEthernet0/2 - trunk: - allowed_vlans: 30-35,40 - native_vlan: 30 - encapsulation: isl - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device L2 configuration from all interfaces with provided configuration (IDEMPOTENT) - ios_l2_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l2_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_l2_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index cbd7e95741..0000000000 --- a/test/integration/targets/ios_l2_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_l2_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device L2 configuration from listed interfaces with provided configuration - ios_l2_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - access: - vlan: 40 - - name: GigabitEthernet0/2 - trunk: - native_vlan: 20 - pruning_vlans: 10-20,30 - encapsulation: dot1q - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device L2 configuration from listed interfaces with provided configuration (IDEMPOTENT) - ios_l2_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l2_interfaces/vars/main.yaml b/test/integration/targets/ios_l2_interfaces/vars/main.yaml deleted file mode 100644 index d4780c770a..0000000000 --- a/test/integration/targets/ios_l2_interfaces/vars/main.yaml +++ /dev/null @@ -1,159 +0,0 @@ ---- -merged: - before: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "switchport access vlan 30" - - "switchport voice vlan 40" - - "interface GigabitEthernet0/2" - - "switchport trunk encapsulation dot1q" - - "switchport trunk native vlan 20" - - "switchport trunk allowed vlan 15-20,40" - - "switchport trunk pruning vlan 10,20" - - "switchport mode trunk" - - after: - - name: GigabitEthernet0/0 - - access: - vlan: 30 - voice: - vlan: 40 - name: GigabitEthernet0/1 - - mode: trunk - name: GigabitEthernet0/2 - trunk: - allowed_vlans: - - 15-20 - - "40" - encapsulation: dot1q - native_vlan: 20 - pruning_vlans: - - "10" - - "20" - -replaced: - before: - - name: GigabitEthernet0/0 - - access: - vlan: 10 - voice: - vlan: 40 - name: GigabitEthernet0/1 - - mode: trunk - name: GigabitEthernet0/2 - trunk: - allowed_vlans: - - 10-20 - - "40" - encapsulation: dot1q - native_vlan: 10 - pruning_vlans: - - "10" - - "20" - - commands: - - "interface GigabitEthernet0/1" - - "switchport access vlan 40" - - "switchport voice vlan 20" - - "interface GigabitEthernet0/2" - - "no switchport mode" - - "no switchport trunk allowed vlan" - - "switchport trunk native vlan 20" - - "switchport trunk pruning vlan 10-20,30" - - after: - - name: GigabitEthernet0/0 - - access: - vlan: 40 - voice: - vlan: 20 - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - trunk: - encapsulation: dot1q - native_vlan: 20 - pruning_vlans: - - 10-20 - - "30" - -overridden: - before: - - name: GigabitEthernet0/0 - - access: - vlan: 10 - voice: - vlan: 40 - name: GigabitEthernet0/1 - - mode: trunk - name: GigabitEthernet0/2 - trunk: - allowed_vlans: - - 10-20 - - "40" - encapsulation: dot1q - native_vlan: 10 - pruning_vlans: - - "10" - - "20" - - commands: - - "interface GigabitEthernet0/1" - - "no switchport access vlan" - - "no switchport voice vlan" - - "interface GigabitEthernet0/2" - - "no switchport mode" - - "no switchport trunk pruning vlan" - - "switchport trunk encapsulation isl" - - "switchport trunk native vlan 30" - - "switchport trunk allowed vlan 30-35,40" - - after: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - trunk: - allowed_vlans: - - 30-35 - - "40" - encapsulation: isl - native_vlan: 30 - -deleted: - before: - - name: GigabitEthernet0/0 - - access: - vlan: 10 - voice: - vlan: 40 - name: GigabitEthernet0/1 - - mode: trunk - name: GigabitEthernet0/2 - trunk: - allowed_vlans: - - 10-20 - - "40" - encapsulation: dot1q - native_vlan: 10 - pruning_vlans: - - "10" - - "20" - - commands: - - "interface GigabitEthernet0/1" - - "no switchport access vlan" - - "no switch voice vlan" - - "interface GigabitEthernet0/2" - - "no switchport mode" - - "no switchport trunk encapsulation" - - "no switchport trunk native vlan" - - "no switchport trunk allowed vlan" - - "no switchport trunk pruning vlan" - - after: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 diff --git a/test/integration/targets/ios_l3_interface/defaults/main.yaml b/test/integration/targets/ios_l3_interface/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_l3_interface/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_l3_interface/meta/main.yaml b/test/integration/targets/ios_l3_interface/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_l3_interface/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_l3_interface/tasks/cli.yaml b/test/integration/targets/ios_l3_interface/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_l3_interface/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_l3_interface/tasks/main.yaml b/test/integration/targets/ios_l3_interface/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_l3_interface/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml b/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml deleted file mode 100644 index cb0de03f74..0000000000 --- a/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,257 +0,0 @@ ---- -- debug: msg="START ios_l3_interface cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Delete interface ipv4 and ipv6 address(setup) - ios_l3_interface: - name: "{{ test_interface }}" - state: absent - provider: "{{ cli }}" - register: result - -- name: Setup - Ensure interfaces are switchport - ios_config: - lines: - - no shutdown - parents: - - "interface {{ item }}" - provider: "{{ cli }}" - loop: - - "{{ test_interface }}" - - "{{ test_interface2 }}" - -- name: Configure interface ipv4 address - ios_l3_interface: - name: "{{ test_interface }}" - ipv4: 192.168.20.1/24 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address 192.168.20.1 255.255.255.0" in result.commands' - -- name: Configure interface ipv4 address (idempotent) - ios_l3_interface: - name: "{{ test_interface }}" - ipv4: 192.168.20.1/24 - state: present - provider: "{{ cli }}" - register: result - -- assert: &unchanged - that: - - 'result.changed == false' - -- name: Assign same ipv4 address to other interface (fail) - ios_l3_interface: - name: "{{ test_interface2 }}" - ipv4: 192.168.20.1/24 - state: present - provider: "{{ cli }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- name: Change interface ipv4 address - ios_l3_interface: - name: "{{ test_interface }}" - ipv4: dhcp - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address dhcp" in result.commands' - -- name: Configure interface ipv6 address - ios_l3_interface: &ipv6-1 - name: "{{ test_interface }}" - ipv6: fd5d:12c9:2201:1::1/64 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ipv6 address fd5d:12c9:2201:1::1/64" in result.commands' - -- name: Configure interface ipv6 address (idempotent) - ios_l3_interface: *ipv6-1 - register: result - -- assert: *unchanged - -- name: Configure second ipv6 address on interface - ios_l3_interface: &ipv6-2 - name: "{{ test_interface }}" - ipv6: fd5d:12c9:2291:1::1/64 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ipv6 address fd5d:12c9:2291:1::1/64" in result.commands' - -- name: Ensure first ipv6 address still associated with interface - ios_l3_interface: *ipv6-1 - register: result - -- assert: *unchanged - -- name: Ensure second ipv6 address still associated with interface - ios_l3_interface: *ipv6-2 - register: result - -- assert: *unchanged - -- name: Assign same ipv6 address to other interface (fail) - ios_l3_interface: - name: "{{ test_interface2 }}" - ipv6: fd5d:12c9:2201:1::1/64 - state: present - provider: "{{ cli }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- name: Change interface ipv6 address - ios_l3_interface: - name: "{{ test_interface }}" - ipv6: dhcp - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ipv6 address dhcp" in result.commands' - -- name: Delete interface ipv4 and ipv6 address - ios_l3_interface: - name: "{{ test_interface }}" - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"no ip address" in result.commands' - - '"no ipv6 address" in result.commands' - -- name: Delete interface ipv4 and ipv6 address (idempotent) - ios_l3_interface: - name: "{{ test_interface }}" - state: absent - provider: "{{ cli }}" - register: result - -- assert: *unchanged - -- name: Delete second interface ipv4 and ipv6 address (setup) - ios_l3_interface: - name: "{{ test_interface2 }}" - state: absent - provider: "{{ cli }}" - register: result - -- name: Configure ipv4 and ipv6 address using aggregate - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}", ipv4: 192.161.0.1/24, ipv6: "fd5d:12c9:2201:2::2/64" } - - { name: "{{ test_interface2 }}", ipv4: 192.162.0.2/16, ipv6: "fd5e:12c9:2201:3::3/32" } - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address 192.161.0.1 255.255.255.0" in result.commands' - - '"ipv6 address fd5d:12c9:2201:2::2/64" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"ip address 192.162.0.2 255.255.0.0" in result.commands' - - '"ipv6 address fd5e:12c9:2201:3::3/32" in result.commands' - -- name: Configure ipv4 and ipv6 address using aggregate (idempotent) - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}", ipv4: 192.161.0.1/24, ipv6: "fd5d:12c9:2201:2::2/64" } - - { name: "{{ test_interface2 }}", ipv4: 192.162.0.2/16, ipv6: "fd5e:12c9:2201:3::3/32" } - provider: "{{ cli }}" - register: result - -- assert: *unchanged - -- name: Change ipv4 and ipv6 address using aggregate - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}", ipv4: 193.167.1.1/8, ipv6: "fd5a:12c9:2201:4::4/32" } - - { name: "{{ test_interface2 }}", ipv4: 192.169.2.2/24, ipv6: "fd5b:12c9:2201:5::5/90" } - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address 193.167.1.1 255.0.0.0" in result.commands' - - '"ipv6 address fd5a:12c9:2201:4::4/32" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"ip address 192.169.2.2 255.255.255.0" in result.commands' - - '"ipv6 address fd5b:12c9:2201:5::5/90" in result.commands' - - -- name: Delete ipv4 and ipv6 address using aggregate - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"no ip address" in result.commands' - - '"no ipv6 address" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"no ip address" in result.commands' - - '"no ipv6 address" in result.commands' - -- name: Delete ipv4 and ipv6 address using aggregate (idempotent) - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - state: absent - provider: "{{ cli }}" - register: result - -- assert: *unchanged - -- debug: msg="END ios_l3_interface cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_l3_interfaces/defaults/main.yaml b/test/integration/targets/ios_l3_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_l3_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_l3_interfaces/meta/main.yaml b/test/integration/targets/ios_l3_interfaces/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_l3_interfaces/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_l3_interfaces/tasks/cli.yaml b/test/integration/targets/ios_l3_interfaces/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_l3_interfaces/tasks/main.yaml b/test/integration/targets/ios_l3_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 130cab1eaf..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - ip address 203.0.113.27 255.255.255.0 - interface GigabitEthernet 0/2 - ip address 192.0.2.1 255.255.255.0 secondary - ip address 192.0.2.2 255.255.255.0 - ipv6 address 2001:db8:0:3::/64 diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index a0db7f0698..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - no ip address - no ipv6 address - interface GigabitEthernet 0/2 - no ip address - no ipv6 address diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index aa28c2b2a9..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_l3_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete attributes of provided configured interfaces - ios_l3_interfaces: &deleted - config: - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_l3_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index a9ccad652b..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: - msg: "START ios_l3_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_l3_interfaces: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_l3_interfaces: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_l3_interfaces: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 0902eaec84..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- debug: - msg: "START Merged ios_l3_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_l3_interfaces: &merged - config: - - name: GigabitEthernet0/1 - ipv4: - - address: dhcp - dhcp_client: 0 - dhcp_hostname: test.com - - name: GigabitEthernet0/2 - ipv4: - - address: 198.51.100.1/24 - secondary: True - - address: 198.51.100.2/24 - ipv6: - - address: 2001:db8:0:3::/64 - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_l3_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index 2ebe3fd621..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_l3_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all interfaces with provided configuration - ios_l3_interfaces: &overridden - config: - - name: GigabitEthernet0/0 - ipv4: - - address: dhcp - - name: GigabitEthernet0/2 - ipv4: - - address: 198.51.100.1/24 - - address: 198.51.100.2/24 - secondary: True - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_l3_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l3_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_l3_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index 7e6e4de24d..0000000000 --- a/test/integration/targets/ios_l3_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_l3_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed interfaces with provided configuration - ios_l3_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - ipv4: - - address: 203.0.114.1/24 - - name: GigabitEthernet0/2 - ipv4: - - address: 198.51.100.1/24 - secondary: True - - address: 198.51.100.2/24 - ipv6: - - address: 2001:db8:1:1::/64 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_l3_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_l3_interfaces/vars/main.yaml b/test/integration/targets/ios_l3_interfaces/vars/main.yaml deleted file mode 100644 index b85a3c2ae5..0000000000 --- a/test/integration/targets/ios_l3_interfaces/vars/main.yaml +++ /dev/null @@ -1,157 +0,0 @@ ---- -merged: - before: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "ip address dhcp client-id GigabitEthernet 0/0 hostname test.com" - - "interface GigabitEthernet0/2" - - "ip address 198.51.100.1 255.255.255.0 secondary" - - "ip address 198.51.100.2 255.255.255.0" - - "ipv6 address 2001:db8:0:3::/64" - - after: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - ipv4: - - address: dhcp - dhcp_client: 0 - dhcp_hostname: test.com - name: GigabitEthernet0/1 - - ipv4: - - address: 198.51.100.1 255.255.255.0 - secondary: true - - address: 198.51.100.2 255.255.255.0 - ipv6: - - address: 2001:db8:0:3::/64 - name: GigabitEthernet0/2 - - -replaced: - before: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - ipv4: - - address: 203.0.113.27 255.255.255.0 - name: GigabitEthernet0/1 - - ipv4: - - address: 192.0.2.1 255.255.255.0 - secondary: true - - address: 192.0.2.2 255.255.255.0 - ipv6: - - address: 2001:db8:0:3::/64 - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "ip address 203.0.114.1 255.255.255.0" - - "interface GigabitEthernet0/2" - - "no ip address" - - "no ipv6 address" - - "ip address 198.51.100.1 255.255.255.0 secondary" - - "ip address 198.51.100.2 255.255.255.0" - - "ipv6 address 2001:db8:1:1::/64" - - after: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - ipv4: - - address: 203.0.114.1 255.255.255.0 - name: GigabitEthernet0/1 - - ipv4: - - address: 198.51.100.1 255.255.255.0 - secondary: true - - address: 198.51.100.2 255.255.255.0 - ipv6: - - address: 2001:db8:1:1::/64 - name: GigabitEthernet0/2 - -overridden: - before: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - ipv4: - - address: 203.0.113.27 255.255.255.0 - name: GigabitEthernet0/1 - - ipv4: - - address: 192.0.2.1 255.255.255.0 - secondary: true - - address: 192.0.2.2 255.255.255.0 - ipv6: - - address: 2001:db8:0:3::/64 - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "no ip address" - - "interface GigabitEthernet0/2" - - "no ip address" - - "no ipv6 address" - - "ip address 198.51.100.1 255.255.255.0" - - "ip address 198.51.100.2 255.255.255.0 secondary" - - after: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - ipv4: - - address: 198.51.100.2 255.255.255.0 - secondary: true - - address: 198.51.100.1 255.255.255.0 - name: GigabitEthernet0/2 - -deleted: - before: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - ipv4: - - address: 203.0.113.27 255.255.255.0 - name: GigabitEthernet0/1 - - ipv4: - - address: 192.0.2.1 255.255.255.0 - secondary: true - - address: 192.0.2.2 255.255.255.0 - ipv6: - - address: 2001:db8:0:3::/64 - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "no ip address" - - "interface GigabitEthernet0/2" - - "no ip address" - - "no ipv6 address" - - after: - - name: loopback888 - - name: loopback999 - - ipv4: - - address: dhcp - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 diff --git a/test/integration/targets/ios_lacp/aliases b/test/integration/targets/ios_lacp/aliases deleted file mode 100644 index 6bb69158a7..0000000000 --- a/test/integration/targets/ios_lacp/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/ios/group1 diff --git a/test/integration/targets/ios_lacp/defaults/main.yaml b/test/integration/targets/ios_lacp/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_lacp/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_lacp/meta/main.yaml b/test/integration/targets/ios_lacp/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_lacp/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_lacp/tasks/cli.yaml b/test/integration/targets/ios_lacp/tasks/cli.yaml deleted file mode 100644 index 3bafcd702f..0000000000 --- a/test/integration/targets/ios_lacp/tasks/cli.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Get the IOS version - ios_facts: - gather_subset: all - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_lacp/tasks/main.yaml b/test/integration/targets/ios_lacp/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lacp/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lacp/tests/cli/_populate_config.yaml b/test/integration/targets/ios_lacp/tests/cli/_populate_config.yaml deleted file mode 100644 index c192cb556d..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - lacp system-priority 500 - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp/tests/cli/_remove_config.yaml b/test/integration/targets/ios_lacp/tests/cli/_remove_config.yaml deleted file mode 100644 index 2b21b291ca..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - no lacp system-priority - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp/tests/cli/deleted.yaml b/test/integration/targets/ios_lacp/tests/cli/deleted.yaml deleted file mode 100644 index 6022637a74..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/deleted.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_lacp ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete configured System LACP - ios_lacp: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['before'] == result['before'] }}" - - - name: Delete configured System LACP (IDEMPOTENT) - ios_lacp: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp/tests/cli/empty_config.yaml b/test/integration/targets/ios_lacp/tests/cli/empty_config.yaml deleted file mode 100644 index 6b369f5087..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/empty_config.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- debug: - msg: "START ios_lacp empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- block: - - name: Merged with empty config should give appropriate error message - ios_lacp: - config: - state: merged - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - - - name: Replaced with empty config should give appropriate error message - ios_lacp: - config: - state: replaced - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp/tests/cli/merged.yaml b/test/integration/targets/ios_lacp/tests/cli/merged.yaml deleted file mode 100644 index 1ed005c2b2..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/merged.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- debug: - msg: "START Merged ios_lacp state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration system LACP - ios_lacp: &merged - config: - system: - priority: 10 - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['before'] == result['before'] }}" - - - name: Merge provided configuration system LACP (IDEMPOTENT) - ios_lacp: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp/tests/cli/replaced.yaml b/test/integration/targets/ios_lacp/tests/cli/replaced.yaml deleted file mode 100644 index 7e48df1e9d..0000000000 --- a/test/integration/targets/ios_lacp/tests/cli/replaced.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_lacp state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces system LACP configuration provided LACP configuration - ios_lacp: &replaced - config: - system: - priority: 20 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['before'] == result['before'] }}" - - - name: Replaces system LACP configuration provided LACP configuration (IDEMPOTENT) - ios_lacp: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp/vars/main.yaml b/test/integration/targets/ios_lacp/vars/main.yaml deleted file mode 100644 index 6832c791b0..0000000000 --- a/test/integration/targets/ios_lacp/vars/main.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -merged: - before: - system: - priority: 32768 - - commands: - - "lacp system-priority 10" - - after: - - system: - priority: 10 - -replaced: - before: - system: - priority: 500 - - commands: - - "lacp system-priority 20" - - after: - system: - priority: 20 - -deleted: - before: - system: - priority: 500 - - commands: - - "no lacp system-priority" - - after: - system: - priority: 32768 diff --git a/test/integration/targets/ios_lacp_interfaces/defaults/main.yaml b/test/integration/targets/ios_lacp_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_lacp_interfaces/tasks/cli.yaml b/test/integration/targets/ios_lacp_interfaces/tasks/cli.yaml deleted file mode 100644 index 3bafcd702f..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Get the IOS version - ios_facts: - gather_subset: all - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_lacp_interfaces/tasks/main.yaml b/test/integration/targets/ios_lacp_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 54e139b0ae..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - lacp port-priority 30 - interface GigabitEthernet 0/2 - lacp port-priority 20 - interface Port-channel 10 - lacp fast-switchover - lacp max-bundle 2 - interface Port-channel 40 - lacp max-bundle 5 - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index f298b7d417..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - no lacp port-priority - interface GigabitEthernet 0/2 - no lacp port-priority - interface Port-channel 10 - no lacp fast-switchover - no lacp max-bundle - interface Port-channel 40 - no lacp fast-switchover - no lacp max-bundle - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index 8e03114454..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_lacp_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete LACP attributes for all configured interfaces - ios_lacp_interfaces: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete LACP attributes for all configured interfaces (IDEMPOTENT) - ios_lacp_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml
\ No newline at end of file diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index 705f47afb9..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: - msg: "START ios_lacp_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- block: - - name: Merged with empty config should give appropriate error message - ios_lacp_interfaces: - config: - state: merged - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - - - name: Replaced with empty config should give appropriate error message - ios_lacp_interfaces: - config: - state: replaced - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - - - name: Overridden with empty config should give appropriate error message - ios_lacp_interfaces: - config: - state: overridden - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 3bfd29b1d2..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: - msg: "START Merged ios_lacp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge the provided configuration with the exisiting running configuration - ios_lacp_interfaces: &merged - config: - - name: GigabitEthernet0/1 - port_priority: 30 - - name: GigabitEthernet0/2 - port_priority: 20 - - name: Port-channel10 - fast_switchover: True - max_bundle: 2 - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge the provided configuration with the exisiting running configuration (IDEMPOTENT) - ios_lacp_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index e9d4ca2465..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_lacp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all lacp_interfaces with provided configuration - ios_lacp_interfaces: &overridden - config: - - name: GigabitEthernet0/2 - port_priority: 40 - - name: Port-channel40 - fast_switchover: True - max_bundle: 2 - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all lacp_interfaces with provided configuration (IDEMPOTENT) - ios_lacp_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_lacp_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index 2d5e8e7b79..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_lacp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed lacp_interfaces with provided configuration - ios_lacp_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - port_priority: 10 - - name: Port-channel40 - fast_switchover: True - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed lacp_interfaces with provided configuration (IDEMPOTENT) - ios_lacp_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lacp_interfaces/vars/main.yaml b/test/integration/targets/ios_lacp_interfaces/vars/main.yaml deleted file mode 100644 index b57c882d41..0000000000 --- a/test/integration/targets/ios_lacp_interfaces/vars/main.yaml +++ /dev/null @@ -1,126 +0,0 @@ ---- -merged: - before: - - name: Port-channel10 - - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "lacp port-priority 30" - - "interface GigabitEthernet0/2" - - "lacp port-priority 20" - - "interface Port-channel10" - - "lacp max-bundle 2" - - "lacp fast-switchover" - - after: - - fast_switchover: True - max_bundle: 2 - name: Port-channel10 - - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - port_priority: 30 - - name: GigabitEthernet0/2 - port_priority: 20 - -replaced: - before: - - fast_switchover: True - max_bundle: 2 - name: Port-channel10 - - max_bundle: 5 - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - port_priority: 30 - - name: GigabitEthernet0/2 - port_priority: 20 - - commands: - - "interface GigabitEthernet0/1" - - "lacp port-priority 10" - - "interface Port-channel40" - - "no lacp max-bundle" - - "lacp fast-switchover" - - after: - - fast_switchover: True - max_bundle: 2 - name: Port-channel10 - - fast_switchover: True - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - port_priority: 10 - - name: GigabitEthernet0/2 - port_priority: 20 - -overridden: - before: - - fast_switchover: True - max_bundle: 2 - name: Port-channel10 - - max_bundle: 5 - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - port_priority: 30 - - name: GigabitEthernet0/2 - port_priority: 20 - - commands: - - "interface GigabitEthernet0/1" - - "no lacp port-priority" - - "interface GigabitEthernet0/2" - - "lacp port-priority 40" - - "interface Port-channel10" - - "no lacp fast-switchover" - - "no lacp max-bundle" - - "interface Port-channel40" - - "lacp fast-switchover" - - "lacp max-bundle 2" - - after: - - name: Port-channel10 - - fast_switchover: True - max_bundle: 2 - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - port_priority: 40 - -deleted: - before: - - fast_switchover: True - max_bundle: 2 - name: Port-channel10 - - max_bundle: 5 - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - port_priority: 30 - - name: GigabitEthernet0/2 - port_priority: 20 - - commands: - - "interface GigabitEthernet0/1" - - "no lacp port-priority" - - "interface GigabitEthernet0/2" - - "no lacp port-priority" - - "interface Port-channel10" - - "no lacp fast-switchover" - - "no lacp max-bundle" - - "interface Port-channel40" - - "no lacp max-bundle" - - after: - - name: Port-channel10 - - name: Port-channel40 - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 diff --git a/test/integration/targets/ios_lag_interfaces/defaults/main.yaml b/test/integration/targets/ios_lag_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_lag_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_lag_interfaces/meta/main.yaml b/test/integration/targets/ios_lag_interfaces/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_lag_interfaces/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_lag_interfaces/tasks/cli.yaml b/test/integration/targets/ios_lag_interfaces/tasks/cli.yaml deleted file mode 100644 index 3bafcd702f..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Get the IOS version - ios_facts: - gather_subset: all - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_lag_interfaces/tasks/main.yaml b/test/integration/targets/ios_lag_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index 6a3f2f8ca1..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - channel-group 1 mode active - interface GigabitEthernet 0/2 - channel-group 1 mode passive - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index 3a57969291..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/1 - no channel-group - interface GigabitEthernet 0/2 - no channel-group - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index 01429d3d2a..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_lag_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete attributes of all configured interfaces - ios_lag_interfaces: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_lag_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index c77acf1037..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: - msg: "START ios_lag_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- block: - - name: Merged with empty config should give appropriate error message - ios_lag_interfaces: - config: - state: merged - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - - - name: Replaced with empty config should give appropriate error message - ios_lag_interfaces: - config: - state: replaced - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - - - name: Overridden with empty config should give appropriate error message - ios_lag_interfaces: - config: - state: overridden - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 07ade884b7..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- debug: - msg: "START Merged ios_lag_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_lag_interfaces: &merged - config: - - name: Port-channel1 - members: - - member: GigabitEthernet0/1 - mode: active - - member: GigabitEthernet0/2 - mode: passive - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_lag_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index 03415b97bc..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_lag_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all interfaces with provided configuration - ios_lag_interfaces: &overridden - config: - - name: Port-channel10 - members: - - member: GigabitEthernet0/2 - mode: passive - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_lag_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lag_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_lag_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index 26ec314e31..0000000000 --- a/test/integration/targets/ios_lag_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_lag_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed interfaces with provided configuration - ios_lag_interfaces: &replaced - config: - - name: Port-channel2 - members: - - member: GigabitEthernet0/1 - mode: active - - name: Port-channel40 - members: - - member: GigabitEthernet0/2 - mode: active - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_lag_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lag_interfaces/vars/main.yaml b/test/integration/targets/ios_lag_interfaces/vars/main.yaml deleted file mode 100644 index e97107f1dd..0000000000 --- a/test/integration/targets/ios_lag_interfaces/vars/main.yaml +++ /dev/null @@ -1,93 +0,0 @@ ---- -merged: - before: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 - - commands: - - "interface GigabitEthernet0/1" - - "channel-group 1 mode active" - - "interface GigabitEthernet0/2" - - "channel-group 1 mode passive" - - after: - - name: GigabitEthernet0/0 - - members: - - member: GigabitEthernet0/1 - mode: active - - member: GigabitEthernet0/2 - mode: passive - name: Port-channel1 - -replaced: - before: - - name: GigabitEthernet0/0 - - members: - - member: GigabitEthernet0/1 - mode: active - - member: GigabitEthernet0/2 - mode: passive - name: Port-channel1 - - commands: - - "interface GigabitEthernet0/1" - - "channel-group 2 mode active" - - "interface GigabitEthernet0/2" - - "channel-group 40 mode active" - - after: - - name: GigabitEthernet0/0 - - members: - - member: GigabitEthernet0/1 - mode: active - name: Port-channel2 - - members: - - member: GigabitEthernet0/2 - mode: active - name: Port-channel40 - -overridden: - before: - - name: GigabitEthernet0/0 - - members: - - member: GigabitEthernet0/1 - mode: active - - member: GigabitEthernet0/2 - mode: passive - name: Port-channel1 - - commands: - - "interface GigabitEthernet0/1" - - "no channel-group" - - "interface GigabitEthernet0/2" - - "channel-group 10 mode passive" - - after: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - members: - - member: GigabitEthernet0/2 - mode: passive - name: Port-channel10 - -deleted: - before: - - name: GigabitEthernet0/0 - - members: - - member: GigabitEthernet0/1 - mode: active - - member: GigabitEthernet0/2 - mode: passive - name: Port-channel1 - - commands: - - "interface GigabitEthernet0/1" - - "no channel-group" - - "interface GigabitEthernet0/2" - - "no channel-group" - - after: - - name: GigabitEthernet0/0 - - name: GigabitEthernet0/1 - - name: GigabitEthernet0/2 diff --git a/test/integration/targets/ios_linkagg/defaults/main.yaml b/test/integration/targets/ios_linkagg/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_linkagg/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_linkagg/meta/main.yaml b/test/integration/targets/ios_linkagg/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_linkagg/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_linkagg/tasks/cli.yaml b/test/integration/targets/ios_linkagg/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_linkagg/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_linkagg/tasks/main.yaml b/test/integration/targets/ios_linkagg/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_linkagg/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_linkagg/tests/cli/basic.yaml b/test/integration/targets/ios_linkagg/tests/cli/basic.yaml deleted file mode 100644 index d873067ab4..0000000000 --- a/test/integration/targets/ios_linkagg/tests/cli/basic.yaml +++ /dev/null @@ -1,171 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- set_fact: switch_type="{{ switch_type }}" - -- block: - - - name: setup - remove config used in test(part1) - ios_config: - lines: - - no interface port-channel 20 - provider: "{{ cli }}" - ignore_errors: yes - - - name: setup - remove config used in test(part2) - ios_config: - lines: - - no interface port-channel 5 - provider: "{{ cli }}" - ignore_errors: yes - - - name: setup - remove config used in test(part3) - ios_config: - lines: - - no channel-group 20 mode active - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - - name: create linkagg - ios_linkagg: &create - group: 20 - state: present - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface port-channel 20' in result.commands" - - - name: create linkagg(Idempotence) - ios_linkagg: *create - register: result - - - assert: - that: - - "result.changed == false" - - - name: set link aggregation group to members - ios_linkagg: &configure_member - group: 20 - mode: active - members: - - GigabitEthernet0/1 - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface GigabitEthernet0/1' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - "'interface GigabitEthernet0/2' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - - name: set link aggregation group to members(Idempotence) - ios_linkagg: *configure_member - register: result - - - assert: - that: - - "result.changed == false" - - - name: remove link aggregation group from member - ios_linkagg: &remove_member - group: 20 - mode: active - members: - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface GigabitEthernet0/1' in result.commands" - - "'no channel-group 20 mode active' in result.commands" - - - name: remove link aggregation group from member(Idempotence) - ios_linkagg: *remove_member - register: result - - - assert: - that: - - "result.changed == false" - - - name: remove linkagg - ios_linkagg: &remove - group: 20 - state: absent - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'no interface port-channel 20' in result.commands" - - - name: remove linkagg(Idempotence) - ios_linkagg: *remove - register: result - - - assert: - that: - - "result.changed == false" - - - name: create aggregate of linkagg definitions - ios_linkagg: &create_agg - aggregate: - - { group: 5 } - - { group: 20, mode: active, members: ['GigabitEthernet0/1'] } - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface port-channel 5' in result.commands" - - "'interface port-channel 20' in result.commands" - - "'interface GigabitEthernet0/1' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - - name: create aggregate of linkagg definitions(Idempotence) - ios_linkagg: *create_agg - register: result - - - assert: - that: - - "result.changed == false" - - - name: teardown(part1) - ios_config: - lines: - - no interface port-channel 20 - provider: "{{ cli }}" - ignore_errors: yes - - - name: teardown(part2) - ios_config: - lines: - - no interface port-channel 5 - provider: "{{ cli }}" - ignore_errors: yes - - - name: teardown(part3) - ios_config: - lines: - - no channel-group 20 mode active - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - when: switch_type == 'L2' - -- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_lldp/defaults/main.yaml b/test/integration/targets/ios_lldp/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_lldp/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_lldp/meta/main.yaml b/test/integration/targets/ios_lldp/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_lldp/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_lldp/tasks/cli.yaml b/test/integration/targets/ios_lldp/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_lldp/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_lldp/tasks/main.yaml b/test/integration/targets/ios_lldp/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lldp/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lldp/tests/cli/basic.yaml b/test/integration/targets/ios_lldp/tests/cli/basic.yaml deleted file mode 100644 index a2119e1843..0000000000 --- a/test/integration/targets/ios_lldp/tests/cli/basic.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- debug: msg="START ios_lldp cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Make sure LLDP is not running before tests - ios_config: - lines: no lldp run - provider: "{{ cli }}" - -- name: Enable LLDP service - ios_lldp: - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"lldp run" in result.commands' - -- name: Enable LLDP service again (idempotent) - ios_lldp: - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Disable LLDP service - ios_lldp: - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no lldp run" in result.commands' - -- name: Disable LLDP service (idempotent) - ios_lldp: - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- debug: msg="END ios_lldp cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_lldp_global/aliases b/test/integration/targets/ios_lldp_global/aliases deleted file mode 100644 index 6bb69158a7..0000000000 --- a/test/integration/targets/ios_lldp_global/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/ios/group1 diff --git a/test/integration/targets/ios_lldp_global/defaults/main.yaml b/test/integration/targets/ios_lldp_global/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_lldp_global/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_lldp_global/meta/main.yaml b/test/integration/targets/ios_lldp_global/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_lldp_global/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_lldp_global/tasks/cli.yaml b/test/integration/targets/ios_lldp_global/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_lldp_global/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_lldp_global/tasks/main.yaml b/test/integration/targets/ios_lldp_global/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lldp_global/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lldp_global/tests/cli/_populate_config.yaml b/test/integration/targets/ios_lldp_global/tests/cli/_populate_config.yaml deleted file mode 100644 index 6bea3dcf21..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - lldp holdtime 10 - lldp run - lldp timer 100 - lldp reinit 3 diff --git a/test/integration/targets/ios_lldp_global/tests/cli/_remove_config.yaml b/test/integration/targets/ios_lldp_global/tests/cli/_remove_config.yaml deleted file mode 100644 index 1098845c79..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - no lldp holdtime - no lldp run - no lldp timer - no lldp reinit diff --git a/test/integration/targets/ios_lldp_global/tests/cli/deleted.yaml b/test/integration/targets/ios_lldp_global/tests/cli/deleted.yaml deleted file mode 100644 index cc6e24dee9..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/deleted.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_lldp_global ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete configured Global LLDP - ios_lldp_global: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['before'] == result['before'] }}" - - - name: Delete configured Global LLDP (IDEMPOTENT) - ios_lldp_global: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_global/tests/cli/empty_config.yaml b/test/integration/targets/ios_lldp_global/tests/cli/empty_config.yaml deleted file mode 100644 index b8cc397152..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/empty_config.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- debug: - msg: "START ios_lldp_global empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_lldp_global: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_lldp_global: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' diff --git a/test/integration/targets/ios_lldp_global/tests/cli/merged.yaml b/test/integration/targets/ios_lldp_global/tests/cli/merged.yaml deleted file mode 100644 index 00757ecfac..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/merged.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- debug: - msg: "START Merged ios_lldp_global state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration Global LLDP - ios_lldp_global: &merged - config: - holdtime: 10 - enabled: True - reinit: 3 - timer: 20 - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['before'] == result['before'] }}" - - - name: Merge provided configuration Global LLDP (IDEMPOTENT) - ios_lldp_global: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_global/tests/cli/replaced.yaml b/test/integration/targets/ios_lldp_global/tests/cli/replaced.yaml deleted file mode 100644 index 892b5dbc34..0000000000 --- a/test/integration/targets/ios_lldp_global/tests/cli/replaced.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_lldp_global state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces Global LLDP configuration with provided LLDP configuration - ios_lldp_global: &replaced - config: - holdtime: 20 - reinit: 5 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] == result['before'] }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['before'] == result['before'] }}" - - - name: Replaces Global LLDP configuration with provided LLDP configuration (IDEMPOTENT) - ios_lldp_global: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_global/vars/main.yaml b/test/integration/targets/ios_lldp_global/vars/main.yaml deleted file mode 100644 index ed87644bf8..0000000000 --- a/test/integration/targets/ios_lldp_global/vars/main.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -merged: - before: {} - - commands: - - "lldp holdtime 10" - - "lldp run" - - "lldp timer 20" - - "lldp reinit 3" - - after: - timer: 20 - holdtime: 10 - reinit: 3 - enabled: True - -replaced: - before: - timer: 100 - holdtime: 10 - reinit: 3 - enabled: True - - commands: - - "no lldp run" - - "no lldp timer" - - "lldp holdtime 20" - - "lldp reinit 5" - - after: - holdtime: 10 - reinit: 3 - -deleted: - before: - timer: 100 - holdtime: 10 - reinit: 3 - enabled: True - - commands: - - "no lldp holdtime" - - "no lldp run" - - "no lldp timer" - - "no lldp reinit" - - after: {} diff --git a/test/integration/targets/ios_lldp_interfaces/defaults/main.yaml b/test/integration/targets/ios_lldp_interfaces/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_lldp_interfaces/tasks/cli.yaml b/test/integration/targets/ios_lldp_interfaces/tasks/cli.yaml deleted file mode 100644 index 242420aa7f..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tasks/cli.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_lldp_interfaces/tasks/main.yaml b/test/integration/targets/ios_lldp_interfaces/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/_enable_lldp.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/_enable_lldp.yaml deleted file mode 100644 index 19fb690cbb..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/_enable_lldp.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Enable LLDP Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - lldp run diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/_populate_config.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/_populate_config.yaml deleted file mode 100644 index f3e97a3f8f..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/0 - lldp receive - lldp transmit - interface GigabitEthernet 0/1 - lldp receive - lldp transmit - interface GigabitEthernet 0/2 - lldp receive - lldp transmit diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/_remove_config.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/_remove_config.yaml deleted file mode 100644 index bf401c6a32..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - interface GigabitEthernet 0/0 - no lldp receive - no lldp transmit - interface GigabitEthernet 0/1 - no lldp receive - no lldp transmit - interface GigabitEthernet 0/2 - no lldp receive - no lldp transmit diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/deleted.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/deleted.yaml deleted file mode 100644 index 46fadff52a..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/deleted.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_lldp_interfaces ansible_connection={{ ansible_connection }}" - -- include_tasks: _enable_lldp.yaml - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete LLDP attributes for respective configured interfaces - ios_lldp_interfaces: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete LLDP attributes for respective configured interfaces (IDEMPOTENT) - ios_lldp_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - always: - - include_tasks: _remove_config.yaml
\ No newline at end of file diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/empty_config.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/empty_config.yaml deleted file mode 100644 index 61c66b0cca..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/empty_config.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: - msg: "START ios_lldp_interfaces empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_lldp_interfaces: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_lldp_interfaces: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_lldp_interfaces: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/merged.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/merged.yaml deleted file mode 100644 index 445026fa03..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/merged.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- debug: - msg: "START Merged ios_lldp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _enable_lldp.yaml - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge the provided configuration with the exisiting running configuration - ios_lldp_interfaces: &merged - config: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: False - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge the provided configuration with the exisiting running configuration (IDEMPOTENT) - ios_lldp_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/overridden.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/overridden.yaml deleted file mode 100644 index ad26ba0133..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/overridden.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_lldp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _enable_lldp.yaml - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all lldp_interfaces with provided configuration - ios_lldp_interfaces: &overridden - config: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all lldp_interfaces with provided configuration (IDEMPOTENT) - ios_lldp_interfaces: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_interfaces/tests/cli/replaced.yaml b/test/integration/targets/ios_lldp_interfaces/tests/cli/replaced.yaml deleted file mode 100644 index 687e8a017d..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/tests/cli/replaced.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_lldp_interfaces state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _enable_lldp.yaml - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed lldp_interfaces with provided configuration - ios_lldp_interfaces: &replaced - config: - - name: GigabitEthernet0/1 - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: False - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed lldp_interfaces with provided configuration (IDEMPOTENT) - ios_lldp_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_lldp_interfaces/vars/main.yaml b/test/integration/targets/ios_lldp_interfaces/vars/main.yaml deleted file mode 100644 index 1ba6ba5aee..0000000000 --- a/test/integration/targets/ios_lldp_interfaces/vars/main.yaml +++ /dev/null @@ -1,126 +0,0 @@ ---- -merged: - before: - - name: GigabitEthernet0/0 - receive: False - transmit: False - - name: GigabitEthernet0/1 - receive: False - transmit: False - - name: GigabitEthernet0/2 - receive: False - transmit: False - - commands: - - "interface GigabitEthernet0/0" - - "lldp receive" - - "lldp transmit" - - "interface GigabitEthernet0/1" - - "lldp receive" - - "lldp transmit" - - "interface GigabitEthernet0/2" - - "lldp receive" - - after: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: False - -replaced: - before: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: True - - commands: - - "interface GigabitEthernet0/1" - - "no lldp receive" - - "interface GigabitEthernet0/2" - - "no lldp transmit" - - after: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: False - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: False - -overridden: - before: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: True - - commands: - - "interface GigabitEthernet0/1" - - "no lldp receive" - - "no lldp transmit" - - "interface GigabitEthernet0/2" - - "no lldp transmit" - - after: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: False - transmit: False - - name: GigabitEthernet0/2 - receive: True - transmit: False - -deleted: - before: - - name: GigabitEthernet0/0 - receive: True - transmit: True - - name: GigabitEthernet0/1 - receive: True - transmit: True - - name: GigabitEthernet0/2 - receive: True - transmit: True - - commands: - - "interface GigabitEthernet0/0" - - "no lldp receive" - - "no lldp transmit" - - "interface GigabitEthernet0/1" - - "no lldp receive" - - "no lldp transmit" - - "interface GigabitEthernet0/2" - - "no lldp receive" - - "no lldp transmit" - - after: - - name: GigabitEthernet0/0 - receive: False - transmit: False - - name: GigabitEthernet0/1 - receive: False - transmit: False - - name: GigabitEthernet0/2 - receive: False - transmit: False diff --git a/test/integration/targets/ios_logging/defaults/main.yaml b/test/integration/targets/ios_logging/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_logging/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_logging/meta/main.yaml b/test/integration/targets/ios_logging/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_logging/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_logging/tasks/cli.yaml b/test/integration/targets/ios_logging/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_logging/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_logging/tasks/main.yaml b/test/integration/targets/ios_logging/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_logging/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_logging/tests/cli/basic.yaml b/test/integration/targets/ios_logging/tests/cli/basic.yaml deleted file mode 100644 index fc63620418..0000000000 --- a/test/integration/targets/ios_logging/tests/cli/basic.yaml +++ /dev/null @@ -1,144 +0,0 @@ ---- -# ensure logging configs are empty -- name: Remove host logging - ios_logging: &remove_host - dest: host - name: 172.16.0.1 - state: absent - provider: "{{ cli }}" - -- name: Remove console - ios_logging: - dest: console - level: warnings - state: absent - provider: "{{ cli }}" - -- name: Remove buffer - ios_logging: - dest: buffered - size: 8000 - provider: "{{ cli }}" - state: absent - -# start tests -- name: Set up host logging - ios_logging: - dest: host - name: 172.16.0.1 - facility: local7 - state: present - provider: "{{ cli }}" - 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) - ios_logging: - dest: host - name: 172.16.0.1 - state: present - provider: "{{ cli }}" - register: result - -- assert: &unchanged - that: - - 'result.changed == false' - -- name: Delete/disable host logging - ios_logging: *remove_host - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging host 172.16.0.1" in result.commands' - -- name: Delete/disable host logging (idempotent) - ios_logging: *remove_host - register: result - -- assert: *unchanged - -- name: Console logging with level warnings - ios_logging: - dest: console - level: warnings - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging console warnings" in result.commands' - -- name: Configure Buffer size - ios_logging: - dest: buffered - size: 8000 - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging buffered 8000" in result.commands' - - -- name: Change logging parameters using aggregate - ios_logging: - aggregate: - - { dest: console, level: notifications } - - { dest: buffered, size: 9000 } - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging buffered 9000" in result.commands' - - '"logging console notifications" in result.commands' - -- name: Set both logging destination and facility - ios_logging: &set_both - dest: buffered - facility: uucp - level: alerts - size: 4096 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"logging buffered 4096 alerts" in result.commands' - - '"logging facility uucp" in result.commands' - -- name: Set both logging destination and facility (idempotent) - ios_logging: *set_both - register: result - -- assert: *unchanged - -- name: remove logging as collection tearDown - ios_logging: - aggregate: - - { dest: console, level: notifications } - - { dest: buffered, size: 4096, level: alerts } - - { facility: uucp } - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no logging console" in result.commands' - - '"no logging buffered" in result.commands' - - '"no logging facility uucp" in result.commands' diff --git a/test/integration/targets/ios_logging/tests/cli/net_logging.yaml b/test/integration/targets/ios_logging/tests/cli/net_logging.yaml deleted file mode 100644 index 154336bdb4..0000000000 --- a/test/integration/targets/ios_logging/tests/cli/net_logging.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- 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 - provider: "{{ cli }}" - -- name: Set up host logging using platform agnostic module - net_logging: - dest: host - name: 172.16.0.1 - facility: local7 - state: present - provider: "{{ cli }}" - 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 - provider: "{{ cli }}" - -- debug: msg="END ios cli/net_logging.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_ntp/defaults/main.yaml b/test/integration/targets/ios_ntp/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_ntp/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_ntp/meta/main.yml b/test/integration/targets/ios_ntp/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_ntp/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_ntp/tasks/cli.yaml b/test/integration/targets/ios_ntp/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_ntp/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_ntp/tasks/main.yaml b/test/integration/targets/ios_ntp/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_ntp/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_ntp/tests/cli/ntp_configuration.yaml b/test/integration/targets/ios_ntp/tests/cli/ntp_configuration.yaml deleted file mode 100644 index 67a9d7b4f2..0000000000 --- a/test/integration/targets/ios_ntp/tests/cli/ntp_configuration.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} ios_ntp sanity test" - -- name: remove NTP (if set) - ios_ntp: &remove - server: 10.75.32.5 - source_int: "{{ test_interface }}" - acl: NTP_ACL - logging: true - key_id: 10 - auth_key: 15435A030726242723273C21181319000A - auth: true - state: absent - provider: "{{ cli }}" - ignore_errors: true - -- block: - - - name: configure NTP - ios_ntp: &config - server: 10.75.32.5 - source_int: "{{ test_interface }}" - state: present - provider: "{{ cli }}" - register: result - - - assert: &true - that: - - "result.changed == true" - - - name: idempotence check - ios_ntp: *config - register: result - - - assert: &false - that: - - "result.changed == false" - - - name: load acl NTP_ACL into device - ios_config: - lines: - - 10 permit ip host 192.0.2.1 any log - parents: ip access-list extended NTP_ACL - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: configure NTP - ios_ntp: &config1 - acl: NTP_ACL - logging: true - state: present - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: idempotence check - ios_ntp: *config1 - register: result - - - assert: *false - - - name: configure NTP with diffferen values - ios_ntp: &config2 - key_id: 10 - auth_key: 15435A030726242723273C21181319000A - auth: true - state: present - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: idempotence check - ios_ntp: *config2 - register: result - - - assert: *false - - - name: remove part of config - ios_ntp: &config3 - acl: NTP_ACL - logging: true - state: absent - provider: "{{ cli }}" - register: result - - - assert: *true - - - name: idempotence check - ios_ntp: *config3 - register: result - - - assert: *false - - always: - - name: Remove ntp config - ios_ntp: *remove - - - name: remove NTP_ACL from device - ios_config: - lines: - - no ip access-list extended NTP_ACL - provider: "{{ cli }}" diff --git a/test/integration/targets/ios_ping/defaults/main.yaml b/test/integration/targets/ios_ping/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_ping/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_ping/meta/main.yaml b/test/integration/targets/ios_ping/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_ping/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_ping/tasks/cli.yaml b/test/integration/targets/ios_ping/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_ping/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_ping/tasks/main.yaml b/test/integration/targets/ios_ping/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_ping/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_ping/tests/cli/ping.yaml b/test/integration/targets/ios_ping/tests/cli/ping.yaml deleted file mode 100644 index 3b6c96ce81..0000000000 --- a/test/integration/targets/ios_ping/tests/cli/ping.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- debug: msg="START cli/ping.yaml on connection={{ ansible_connection }}" - -- ios_command: - commands: show version - provider: "{{ cli }}" - register: show_version_result - -- set_fact: management_interface=GigabitEthernet0/0 - when: "'Cisco IOS' in show_version_result.stdout[0]" - -- set_fact: management_interface=GigabitEthernet1 - when: "'Cisco IOS-XE' in show_version_result.stdout[0]" - -- name: Get show ip management nterface output - ios_command: - commands: - - "show ip interface {{ management_interface }} | include Internet address" - provider: "{{ cli }}" - register: show_ip_interface_result - -- name: Extract the IP address from registered output - set_fact: management_ip="{{ show_ip_interface_result.stdout[0].split()[-1].split('/')[0] }}" - -- name: expected successful ping - ios_ping: &valid_ip - dest: '{{ management_ip }}' - provider: "{{ cli }}" - register: esp - -- name: unexpected unsuccessful ping - ios_ping: &invalid_ip - dest: '10.255.255.250' - provider: "{{ cli }}" - register: uup - ignore_errors: yes - -- name: unexpected successful ping - ios_ping: - <<: *valid_ip - state: 'absent' - register: usp - ignore_errors: yes - -- name: expected unsuccessful ping - ios_ping: - <<: *invalid_ip - state: 'absent' - register: eup - -- name: assert - assert: - that: - - esp.failed == eup.failed == false - - usp.failed == uup.failed == true diff --git a/test/integration/targets/ios_smoke/defaults/main.yaml b/test/integration/targets/ios_smoke/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_smoke/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_smoke/meta/main.yaml b/test/integration/targets/ios_smoke/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_smoke/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_smoke/tasks/cli.yaml b/test/integration/targets/ios_smoke/tasks/cli.yaml deleted file mode 100644 index d696cc518d..0000000000 --- a/test/integration/targets/ios_smoke/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- name: run test case (connection=local) - include: "{{ test_case_to_run }} ansible_connection=local" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_local diff --git a/test/integration/targets/ios_smoke/tasks/main.yaml b/test/integration/targets/ios_smoke/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_smoke/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_smoke/templates/defaults/config.j2 b/test/integration/targets/ios_smoke/templates/defaults/config.j2 deleted file mode 100644 index 1d4d9da8d4..0000000000 --- a/test/integration/targets/ios_smoke/templates/defaults/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -interface Loopback999 - description this is a test - no shutdown - diff --git a/test/integration/targets/ios_smoke/tests/cli/common_config.yaml b/test/integration/targets/ios_smoke/tests/cli/common_config.yaml deleted file mode 100644 index 1870ee0e29..0000000000 --- a/test/integration/targets/ios_smoke/tests/cli/common_config.yaml +++ /dev/null @@ -1,212 +0,0 @@ -# ios_linkagg -> CustomNetworkConfig -# ios_config -> dumps, NetworkConfig - -- debug: msg="START cli/common_config.yaml on connection={{ ansible_connection }}" - -# Hit NetworkConfig -- name: set hostname - ios_config: - lines: ['hostname ios-smoke'] - match: none - provider: "{{ cli }}" - -- name: hit diff_ignore_lines - ios_config: - lines: ['hostname ios-smoke-diff'] - diff_ignore_lines: - - hostname ios-smoke - save_when: modified - provider: "{{ cli }}" - -- name: return hostname - ios_config: - lines: ['hostname {{ shorter_hostname }}'] - match: none - provider: "{{ cli }}" - -- name: hit items with parents - ios_config: - lines: ['permit ip any any log'] - parents: ['ip access-list extended test'] - provider: "{{ cli }}" - match: exact - register: result - -- name: teardown - ios_config: - lines: - - 'no ip access-list extended test' - match: none - provider: "{{ cli }}" - -- name: setup test NetworkConfig.difference, replace=block - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - parents: ['ip access-list extended test'] - before: ['no ip access-list extended test'] - after: ['exit'] - provider: "{{ cli }}" - match: none - -- name: test NetworkConfig.difference, replace=block - ios_config: - lines: - - permit ip host 192.0.2.1 any log - - permit ip host 192.0.2.2 any log - - permit ip host 192.0.2.3 any log - - permit ip host 192.0.2.4 any log - parents: ['ip access-list extended test'] - replace: block - after: ['exit'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list extended test' in result.updates" - - "'permit ip host 192.0.2.1 any log' in result.updates" - - "'permit ip host 192.0.2.2 any log' in result.updates" - - "'permit ip host 192.0.2.3 any log' in result.updates" - - "'permit ip host 192.0.2.4 any log' in result.updates" - -- name: teardown- NetworkConfig.difference, replace=block - ios_config: - lines: - - no ip access-list extended test - match: none - provider: "{{ cli }}" - -# CustomNetworkConfig -# currently gets skipped because switch_type != 'L2' -- set_fact: switch_type="{{ switch_type }}" - -- block: - - - name: setup - remove config used in test(part1) - ios_config: - lines: - - no interface port-channel 20 - provider: "{{ cli }}" - ignore_errors: yes - - - name: setup - remove config used in test(part2) - ios_config: - lines: - - no interface port-channel 5 - provider: "{{ cli }}" - ignore_errors: yes - - - name: setup - remove config used in test(part3) - ios_config: - lines: - - no channel-group 20 mode active - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - - name: create linkagg - ios_linkagg: &create - group: 20 - state: present - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface port-channel 20' in result.commands" - - - name: set link aggregation group to members - ios_linkagg: &configure_member - group: 20 - mode: active - members: - - GigabitEthernet0/1 - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface GigabitEthernet0/1' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - "'interface GigabitEthernet0/2' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - - name: remove link aggregation group from member - ios_linkagg: &remove_member - group: 20 - mode: active - members: - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface GigabitEthernet0/1' in result.commands" - - "'no channel-group 20 mode active' in result.commands" - - - name: remove linkagg - ios_linkagg: &remove - group: 20 - state: absent - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'no interface port-channel 20' in result.commands" - - - name: create aggregate of linkagg definitions - ios_linkagg: &create_agg - aggregate: - - { group: 5 } - - { group: 20, mode: active, members: ['GigabitEthernet0/1'] } - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface port-channel 5' in result.commands" - - "'interface port-channel 20' in result.commands" - - "'interface GigabitEthernet0/1' in result.commands" - - "'channel-group 20 mode active' in result.commands" - - - name: teardown(part1) - ios_config: - lines: - - no interface port-channel 20 - provider: "{{ cli }}" - ignore_errors: yes - - - name: teardown(part2) - ios_config: - lines: - - no interface port-channel 5 - provider: "{{ cli }}" - ignore_errors: yes - - - name: teardown(part3) - ios_config: - lines: - - no channel-group 20 mode active - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - when: switch_type == 'L2' - -- debug: msg="END cli/common_config.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml b/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml deleted file mode 100644 index 6b1f6b4e9d..0000000000 --- a/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml +++ /dev/null @@ -1,152 +0,0 @@ ---- -# ios_command -> ComplexList -# ios_interface -> conditional, remove_default_spec -# ios_logging -> validate_ip_address -# ios_l3_interface -> is_netmask, is_masklen, to_subnet, to_netmask, to_masklen - -#ComplexList already covered - -- debug: msg="START ios_smoke cli/common_utils.yaml on connection={{ ansible_connection }}" - -# hit is_netmask(), is_masklen(), to_netmask(), to_masklen() -- name: Delete interface ipv4 and ipv6 address(setup) - ios_l3_interface: - name: "{{ test_interface }}" - state: absent - provider: "{{ cli }}" - register: result - -- name: Setup - Ensure interfaces are switchport - ios_config: - lines: - - no shutdown - parents: - - "interface {{ item }}" - provider: "{{ cli }}" - loop: - - "{{ test_interface }}" - - "{{ test_interface2 }}" - -- name: Configure interface ipv4 address - ios_l3_interface: - name: "{{ test_interface }}" - ipv4: 192.168.20.1/24 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address 192.168.20.1 255.255.255.0" in result.commands' - -- name: test invalid subnet - ios_l3_interface: - name: "{{ test_interface }}" - ipv4: 192.168.20.1/45 - state: present - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- debug: var=result - -- assert: - that: - - 'result.failed == true' - -- name: Change ipv4 and ipv6 address using aggregate - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}", ipv4: 193.167.1.1/8, ipv6: "fd5a:12c9:2201:4::4/32" } - - { name: "{{ test_interface2 }}", ipv4: 192.169.2.2/24, ipv6: "fd5b:12c9:2201:5::5/90" } - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"interface {{ test_interface }}" in result.commands' - - '"ip address 193.167.1.1 255.0.0.0" in result.commands' - - '"ipv6 address fd5a:12c9:2201:4::4/32" in result.commands' - - '"interface {{ test_interface2 }}" in result.commands' - - '"ip address 192.169.2.2 255.255.255.0" in result.commands' - - '"ipv6 address fd5b:12c9:2201:5::5/90" in result.commands' - -- name: Delete ipv4 and ipv6 address using aggregate - ios_l3_interface: - aggregate: - - { name: "{{ test_interface }}" } - - { name: "{{ test_interface2 }}" } - state: absent - provider: "{{ cli }}" - register: result - -# hit validate_ip_address() -- name: Remove host logging - setup - net_logging: - dest: host - name: 172.16.0.1 - state: absent - provider: "{{ cli }}" - -- name: Remove host logging - teardown - net_logging: - dest: host - name: 172.16.0.1 - state: absent - provider: "{{ cli }}" - -# hit conditional(), remove_default_spec() -- name: Check intent arguments - ios_interface: - name: "{{ test_interface }}" - state: up - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.failed == false" - -- name: Check intent arguments (failed condition) - ios_interface: - name: "{{ test_interface }}" - state: down - provider: "{{ cli }}" - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(down)' in result.failed_conditions" - -- name: Config + intent - ios_interface: - name: "{{ test_interface }}" - enabled: False - state: down - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.failed == false" - -- name: Config + intent (fail) - ios_interface: - name: "{{ test_interface }}" - enabled: False - provider: "{{ cli }}" - state: up - ignore_errors: yes - register: result - -- assert: - that: - - "result.failed == true" - - "'state eq(up)' in result.failed_conditions" - -- debug: msg="END ios_smoke cli/common_utils.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_smoke/tests/cli/misc_tests.yaml b/test/integration/targets/ios_smoke/tests/cli/misc_tests.yaml deleted file mode 100644 index dfe513eac4..0000000000 --- a/test/integration/targets/ios_smoke/tests/cli/misc_tests.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: msg="START ios_smoke cli/misc_tests.yaml on connection={{ ansible_connection }}" - -# hit network.ios.ios- get_defaults_flag() -- name: setup - ios_config: - commands: - - no description - - shutdown - parents: - - interface Loopback999 - match: none - provider: "{{ cli }}" - -- name: configure device with defaults included - ios_config: - src: defaults/config.j2 - defaults: yes - provider: "{{ cli }}" - register: result - -- name: run ios commands to test command_timeout - ios_command: - commands: - - show running-config all - - show interfaces - - show running-config all - vars: - ansible_command_timeout: 1 - ansible_buffer_read_timeout: 2 - ignore_errors: True - register: result - when: ansible_connection == 'network_cli' - -- assert: - that: - - 'result.failed == true' - - "'timeout value 1 seconds reached' in result.msg" - when: ansible_connection == 'network_cli' - -- debug: msg="END ios_smoke cli/misc_tests.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_smoke/tests/cli/reboot.yaml b/test/integration/targets/ios_smoke/tests/cli/reboot.yaml deleted file mode 100644 index 6f9a77b255..0000000000 --- a/test/integration/targets/ios_smoke/tests/cli/reboot.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- block: - - cli_command: - command: reload - prompt: - - "yes/no" - - "confirm" - answer: - - "no" - - "y" - check_all: yes - - - wait_for_connection: - delay: 20 - sleep: 10 - - - cli_command: - command: show version - when: ansible_connection.endswith("network_cli") diff --git a/test/integration/targets/ios_static_route/defaults/main.yaml b/test/integration/targets/ios_static_route/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_static_route/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_static_route/meta/main.yaml b/test/integration/targets/ios_static_route/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_static_route/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_static_route/tasks/cli.yaml b/test/integration/targets/ios_static_route/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_static_route/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_static_route/tasks/main.yaml b/test/integration/targets/ios_static_route/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_static_route/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_static_route/tests/cli/basic.yaml b/test/integration/targets/ios_static_route/tests/cli/basic.yaml deleted file mode 100644 index c58a0e3408..0000000000 --- a/test/integration/targets/ios_static_route/tests/cli/basic.yaml +++ /dev/null @@ -1,144 +0,0 @@ ---- -- debug: msg="START ios cli/ios_static_route.yaml on connection={{ ansible_connection }}" - -- name: Clear all static routes - ios_static_route: &delete_all - aggregate: - - { prefix: 172.16.31.0 } - - { prefix: 172.16.32.0 } - - { prefix: 172.16.33.0 } - - { prefix: 172.16.34.0 } - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: absent - provider: "{{ cli }}" - -- name: create static route - ios_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["ip route 172.16.31.0 255.255.255.0 10.0.0.8"]' - -- name: Verify idempotence with default admin_distance - ios_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 1 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: modify admin distance of static route - ios_static_route: &admin2 - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - admin_distance: 2 - state: present - provider: "{{ cli }}" - 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) - ios_static_route: *admin2 - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Verify idempotence with unspecified admin_distance - ios_static_route: - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - -- name: delete static route - ios_static_route: &delete - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: absent - provider: "{{ cli }}" - 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) - ios_static_route: *delete - register: result - -- assert: - that: - - 'result.changed == false' - -- name: Add static route aggregates - ios_static_route: - aggregate: - - { prefix: 172.16.32.0 } - - { prefix: 172.16.33.0 } - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["ip route 172.16.32.0 255.255.255.0 10.0.0.8", "ip route 172.16.33.0 255.255.255.0 10.0.0.8"]' - -- name: Add and remove static route aggregates with overrides - ios_static_route: - aggregate: - - { prefix: 172.16.32.0 } - - { prefix: 172.16.33.0, state: absent } - - { prefix: 172.16.34.0 } - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: present - provider: "{{ cli }}" - 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"]' - -- name: Remove static route aggregates - ios_static_route: *delete_all - 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"]' - -- debug: msg="END ios cli/ios_static_route.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 deleted file mode 100644 index 3e7c99d4c6..0000000000 --- a/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- 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: &delete - prefix: 172.16.31.0 - mask: 255.255.255.0 - next_hop: 10.0.0.8 - state: absent - provider: "{{ cli }}" - -- 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 - admin_distance: 1 - state: present - provider: "{{ cli }}" - 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: *delete - -- debug: msg="END ios cli/net_static_route.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_static_routes/defaults/main.yaml b/test/integration/targets/ios_static_routes/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_static_routes/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_static_routes/meta/main.yaml b/test/integration/targets/ios_static_routes/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_static_routes/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_static_routes/tasks/cli.yaml b/test/integration/targets/ios_static_routes/tasks/cli.yaml deleted file mode 100644 index 337e34133b..0000000000 --- a/test/integration/targets/ios_static_routes/tasks/cli.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/ios_static_routes/tasks/main.yaml b/test/integration/targets/ios_static_routes/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_static_routes/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_static_routes/tests/cli/_intial_setup_config.yaml b/test/integration/targets/ios_static_routes/tests/cli/_intial_setup_config.yaml deleted file mode 100644 index a6b390ad04..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/_intial_setup_config.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Intitial Setup Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - vrf definition ansible_temp_vrf - address-family ipv4 - ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name test_vrf track 150 - ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3 - ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2 - ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast - ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6 diff --git a/test/integration/targets/ios_static_routes/tests/cli/_populate_config.yaml b/test/integration/targets/ios_static_routes/tests/cli/_populate_config.yaml deleted file mode 100644 index e6275cc7e2..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Populate Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name test_vrf track 150 - ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3 - ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2 - ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast - ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6 diff --git a/test/integration/targets/ios_static_routes/tests/cli/_remove_config.yaml b/test/integration/targets/ios_static_routes/tests/cli/_remove_config.yaml deleted file mode 100644 index acfd6cc8e5..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name test_vrf track 150 - no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3 - no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2 - no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast - no ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6 - no vrf definition ansible_temp_vrf diff --git a/test/integration/targets/ios_static_routes/tests/cli/deleted.yaml b/test/integration/targets/ios_static_routes/tests/cli/deleted.yaml deleted file mode 100644 index 2d3967b129..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/deleted.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_static_routes ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Delete attributes of provided configured interfaces - ios_static_routes: &deleted - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: test_vrf - tag: 50 - track: 150 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.1 - name: route_1 - distance_metric: 110 - tag: 40 - multicast: True - - forward_router_address: 198.51.101.2 - name: route_2 - distance_metric: 30 - - forward_router_address: 198.51.101.3 - name: route_3 - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: test_v6 - tag: 105 - state: deleted - register: result - - - assert: - that: - - "result.commands|length == 5" - - "result.changed == true" - - "result.commands|symmetric_difference(deleted.commands) == []" - - - name: Delete attributes of all configured interfaces (IDEMPOTENT) - ios_static_routes: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result.changed == false" - - always: - - include_tasks: _populate_config.yaml - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_static_routes/tests/cli/empty_config.yaml b/test/integration/targets/ios_static_routes/tests/cli/empty_config.yaml deleted file mode 100644 index 0cf39e734a..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/empty_config.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- debug: - msg: "START ios_static_routes empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- name: Merged with empty config should give appropriate error message - ios_static_routes: - config: - state: merged - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - -- name: Replaced with empty config should give appropriate error message - ios_static_routes: - config: - state: replaced - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - -- name: Overridden with empty config should give appropriate error message - ios_static_routes: - config: - state: overridden - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - -- name: Rendered with empty config should give appropriate error message - ios_static_routes: - config: - state: rendered - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of config parameter must not be empty for state rendered' - -- name: Parsed with empty config should give appropriate error message - ios_static_routes: - running_config: - state: parsed - register: result - ignore_errors: True - -- assert: - that: - - result.msg == 'value of running_config parameter must not be empty for state parsed' diff --git a/test/integration/targets/ios_static_routes/tests/cli/gathered.yaml b/test/integration/targets/ios_static_routes/tests/cli/gathered.yaml deleted file mode 100644 index 4377f544d0..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/gathered.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- debug: - msg: "START ios_static_routes gathered integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Gather the provided configuration with the exisiting running configuration - ios_static_routes: &gathered - config: - state: gathered - register: result - - - name: Assert that gathered dicts was correctly generated - assert: - that: - - "result['changed'] == false" - - always: - - include_tasks: _remove_config.yaml
\ No newline at end of file diff --git a/test/integration/targets/ios_static_routes/tests/cli/merged.yaml b/test/integration/targets/ios_static_routes/tests/cli/merged.yaml deleted file mode 100644 index 26825412ca..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/merged.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: - msg: "START Merged ios_static_routes state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_static_routes: &merged - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: merged_vrf - tag: 50 - track: 150 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.1 - name: merged_route_1 - distance_metric: 110 - tag: 40 - multicast: True - - forward_router_address: 198.51.101.2 - name: merged_route_2 - distance_metric: 30 - - forward_router_address: 198.51.101.3 - name: merged_route_3 - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: merged_v6 - tag: 105 - state: merged - register: result - - - assert: - that: - - "result.commands|length == 5" - - "result.changed == true" - - "result.commands|symmetric_difference(merged.commands) == []" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_static_routes: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _populate_config.yaml - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_static_routes/tests/cli/overridden.yaml b/test/integration/targets/ios_static_routes/tests/cli/overridden.yaml deleted file mode 100644 index 02b6acb6a8..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/overridden.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_static_routes state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Override device configuration of all interfaces with provided configuration - ios_static_routes: &overridden - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: override_vrf - tag: 50 - track: 150 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.3 - name: override_route - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: override_v6 - tag: 175 - state: overridden - register: result - - - assert: - that: - - "result.commands|length == 8" - - "result.changed == true" - - "result.commands|symmetric_difference(overridden.commands) == []" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_static_routes: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _populate_config.yaml - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_static_routes/tests/cli/rendered.yaml b/test/integration/targets/ios_static_routes/tests/cli/rendered.yaml deleted file mode 100644 index 9805efebaf..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/rendered.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -- debug: - msg: "START ios_static_routes rendered integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Rendered the provided configuration with the exisiting running configuration - ios_static_routes: &rendered - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: test_vrf - tag: 50 - track: 150 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.1 - name: route_1 - distance_metric: 110 - tag: 40 - multicast: True - - forward_router_address: 198.51.101.2 - name: route_2 - distance_metric: 30 - - forward_router_address: 198.51.101.3 - name: route_3 - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: test_v6 - tag: 105 - state: rendered - register: result - - - assert: - that: - - "result.changed == false" - - "result.rendered|symmetric_difference(rendered.commands) == []" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_static_routes/tests/cli/replaced.yaml b/test/integration/targets/ios_static_routes/tests/cli/replaced.yaml deleted file mode 100644 index b7e7badfed..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/replaced.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_static_routes state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _intial_setup_config.yaml - -- block: - - name: Replaces device configuration of listed interfaces with provided configuration - ios_static_routes: &replaced - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: replaced_vrf - tag: 75 - track: 155 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.1 - name: replaced_route - distance_metric: 175 - tag: 70 - multicast: True - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: replaced_v6 - tag: 110 - state: replaced - register: result - - - assert: - that: - - "result.commands|length == 7" - - "result.changed == true" - - "result.commands|symmetric_difference(replaced.commands) == []" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_static_routes: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result.commands|length == 0" - - "result['changed'] == false" - - always: - - include_tasks: _populate_config.yaml - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_static_routes/tests/cli/rtt.yaml b/test/integration/targets/ios_static_routes/tests/cli/rtt.yaml deleted file mode 100644 index e8a5c6b151..0000000000 --- a/test/integration/targets/ios_static_routes/tests/cli/rtt.yaml +++ /dev/null @@ -1,78 +0,0 @@ ---- -- debug: - msg: "START ios_static_routes round trip integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Apply the provided configuration (base config) - ios_static_routes: - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: rtt_vrf - tag: 50 - track: 150 - - address_families: - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - forward_router_address: 198.51.101.1 - name: rtt_route_1 - distance_metric: 110 - tag: 40 - multicast: True - state: merged - register: base_config - - - name: Gather static routes facts - ios_facts: - gather_subset: - - "!all" - - "!min" - gather_network_resources: - - static_routes - - - name: Apply the configuration which need to be reverted - ios_static_routes: - config: - - vrf: ansible_temp_vrf - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.12 - name: new_rtt_vrf - tag: 10 - track: 150 - state: overridden - register: result - - - assert: - that: - - "result.commands|length == 2" - - "result.changed == true" - - "result.commands|symmetric_difference(rtt.override_commands) == []" - - - name: Revert back to base config using facts round trip - ios_static_routes: - config: "{{ ansible_facts['network_resources']['static_routes'] }}" - state: overridden - register: revert - - - assert: - that: - - "revert.commands|length == 1" - - "revert.changed == true" - - "revert.commands|symmetric_difference(rtt.override_revert_commands) == []" - - always: - - include_tasks: _populate_config.yaml - - include_tasks: _remove_config.yaml
\ No newline at end of file diff --git a/test/integration/targets/ios_static_routes/vars/main.yaml b/test/integration/targets/ios_static_routes/vars/main.yaml deleted file mode 100644 index 30c67c56e9..0000000000 --- a/test/integration/targets/ios_static_routes/vars/main.yaml +++ /dev/null @@ -1,88 +0,0 @@ ---- -deleted: - commands: - - "no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3" - - "no ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105" - -merged: - commands: - - "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name merged_vrf track 150 tag 50" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name merged_route_1 tag 40" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name merged_route_2" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.3 name merged_route_3" - - "ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name merged_v6 tag 105" - -replaced: - commands: - - "no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3" - - "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name replaced_vrf track 155 tag 75" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.1 175 multicast name replaced_route tag 70" - - "ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name replaced_v6 tag 110" - -overridden: - commands: - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2" - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3" - - "no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50" - - "no ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.3 name override_route" - - "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name override_vrf track 150 tag 50" - - "ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name override_v6 tag 175" - -rendered: - commands: - - "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2" - - "ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3" - - "ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105" - -gathered: - config: - - address_families: - - afi: ipv4 - routes: - - dest: 192.0.2.0/24 - next_hops: - - forward_router_address: 192.0.2.1 - name: test_vrf - tag: 50 - track: 150 - vrf: ansible_temp_vrf - - address_families: - - afi: ipv6 - routes: - - dest: 2001:DB8:0:3::/64 - next_hops: - - forward_router_address: 2001:DB8:0:3::2 - name: test_v6 - tag: 105 - - afi: ipv4 - routes: - - dest: 198.51.100.0/24 - next_hops: - - distance_metric: 110 - forward_router_address: 198.51.101.1 - multicast: true - name: route_1 - tag: 40 - - distance_metric: 30 - forward_router_address: 198.51.101.2 - name: route_2 - - forward_router_address: 198.51.101.3 - name: route_3 - -rtt: - override_commands: - - "no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name rtt_route_1 tag 40" - - "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.12 name new_rtt_vrf track 150 tag 10" - - override_revert_commands: - - "ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name rtt_route_1 tag 40" diff --git a/test/integration/targets/ios_system/defaults/main.yaml b/test/integration/targets/ios_system/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_system/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_system/meta/main.yml b/test/integration/targets/ios_system/meta/main.yml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_system/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_system/tasks/cli.yaml b/test/integration/targets/ios_system/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_system/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_system/tasks/main.yaml b/test/integration/targets/ios_system/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_system/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_system/tests/cli/net_system.yaml b/test/integration/targets/ios_system/tests/cli/net_system.yaml deleted file mode 100644 index d5e36fea8d..0000000000 --- a/test/integration/targets/ios_system/tests/cli/net_system.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- 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 - 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 - - "'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 - provider: "{{ cli }}" - -- debug: msg="END ios cli/net_system.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/set_domain_list.yaml b/test/integration/targets/ios_system/tests/cli/set_domain_list.yaml deleted file mode 100644 index d371b7dbd7..0000000000 --- a/test/integration/targets/ios_system/tests/cli/set_domain_list.yaml +++ /dev/null @@ -1,122 +0,0 @@ ---- -- debug: msg="START cli/set_domain_search.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - no ip domain-list ansible.com - - no ip domain-list redhat.com - match: none - provider: "{{ cli }}" - -- name: configure domain_search - ios_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: verify domain_search - ios_system: - domain_search: - - ansible.com - - redhat.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: remove one entry - ios_system: - domain_search: - - ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'no ip domain list redhat.com' in result.commands" - -- name: verify remove one entry - ios_system: - domain_search: - - ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: add one entry - ios_system: - domain_search: - - ansible.com - - redhat.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'ip domain list redhat.com' in result.commands" - -- name: verify add one entry - ios_system: - domain_search: - - ansible.com - - redhat.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: add and remove one entry - ios_system: - domain_search: - - ansible.com - - eng.ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'no ip domain list redhat.com' in result.commands" - - "'ip domain list eng.ansible.com' in result.commands" - - result.commands|length == 2 - -- name: verify add and remove one entry - ios_system: - domain_search: - - ansible.com - - eng.ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: teardown - ios_config: - lines: - - no ip domain-list ansible.com - - no ip domain-list redhat.com - - no ip domain-list eng.ansible.com - match: none - provider: "{{ cli }}" - -- debug: msg="END cli/set_domain_search.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/set_domain_name.yaml b/test/integration/targets/ios_system/tests/cli/set_domain_name.yaml deleted file mode 100644 index 60a4659f65..0000000000 --- a/test/integration/targets/ios_system/tests/cli/set_domain_name.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: msg="START cli/set_domain_name.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: no ip domain-name - match: none - provider: "{{ cli }}" - -- name: configure domain_name - ios_system: - domain_name: eng.ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - -- name: verify domain_name - ios_system: - domain_name: eng.ansible.com - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: no ip domain-name - match: none - provider: "{{ cli }}" - -- debug: msg="END cli/set_domain_name.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/set_hostname.yaml b/test/integration/targets/ios_system/tests/cli/set_hostname.yaml deleted file mode 100644 index 1b39764c6e..0000000000 --- a/test/integration/targets/ios_system/tests/cli/set_hostname.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- debug: msg="START cli/set_hostname.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: hostname switch - match: none - provider: "{{ cli }}" - -- name: configure hostname - ios_system: - hostname: foo - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - -- name: verify hostname - ios_system: - hostname: foo - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - ios_config: - lines: "hostname {{ inventory_hostname }}" - match: none - provider: "{{ cli }}" - -- debug: msg="END cli/set_hostname.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/set_lookup_source.yaml b/test/integration/targets/ios_system/tests/cli/set_lookup_source.yaml deleted file mode 100644 index b8cf59d7b2..0000000000 --- a/test/integration/targets/ios_system/tests/cli/set_lookup_source.yaml +++ /dev/null @@ -1,94 +0,0 @@ ---- -- debug: msg="START cli/set_lookup_source.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - no ip domain lookup source-interface Loopback888 - - vrf definition ansible - match: none - provider: "{{ cli }}" - -- name: configure lookup_source - ios_system: - lookup_source: Loopback888 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'ip domain lookup source-interface Loopback888' in result.commands" - -- name: verify lookup_source - ios_system: - lookup_source: Loopback888 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -- name: Disable lookup_source - ios_system: - lookup_enabled: False - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'no ip domain lookup' in result.commands" - -- name: Disable lookup_source - ios_system: - lookup_enabled: True - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - "'ip domain lookup' in result.commands" - -#- name: change to vrf -# ios_system: -# lookup_source: -# - interface: Loopback10 -# vrf: ansible -# provider: "{{ cli }}" -# provider: "{{ cli }}" -# register: result -# -#- assert: -# that: -# - result.changed == true -# - "'no ip domain lookup source-interface Management1' in result.commands" -# - "'ip domain lookup vrf ansible source-interface Management1' in result.commands" -# - result.commands|length == 2 -# -#- name: verify change to vrf -# ios_system: -# lookup_source: -# - interface: Management1 -# vrf: ansible -# provider: "{{ cli }}" -# provider: "{{ cli }}" -# register: result -# -#- assert: -# that: -# - result.changed == false - -- name: teardown - ios_config: - lines: - - no ip domain lookup source-interface Loopback888 - - no vrf definition ansible - match: none - provider: "{{ cli }}" - ignore_errors: yes -# FIXME: Not sure why this is failing with msg": "no vrf definition ansible\r\n% IPv4 and IPv6 addresses from all interfaces in VRF ansible have been removed\r\nfoo(config)#", rc:1 - -- debug: msg="END cli/set_lookup_source.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_system/tests/cli/set_name_servers.yaml b/test/integration/targets/ios_system/tests/cli/set_name_servers.yaml deleted file mode 100644 index 5dcc32ed1f..0000000000 --- a/test/integration/targets/ios_system/tests/cli/set_name_servers.yaml +++ /dev/null @@ -1,91 +0,0 @@ ---- -- debug: msg="START cli/set_name_servers.yaml on connection={{ ansible_connection }}" - -- name: setup - ios_config: - lines: - - no ip name-server - match: none - provider: "{{ cli }}" - -- name: configure name_servers - ios_system: - name_servers: - - 192.0.2.1 - - 192.0.2.2 - - 192.0.2.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 3 - - "'ip name-server 192.0.2.1' in result.commands" - - "'ip name-server 192.0.2.2' in result.commands" - - "'ip name-server 192.0.2.3' in result.commands" - -- name: verify name_servers - ios_system: - name_servers: - - 192.0.2.1 - - 192.0.2.2 - - 192.0.2.3 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == false - -#- name: change to vrf -# ios_system: -# name_servers: -# - 192.0.2.1 -# - { server: 192.0.2.2, vrf: ansible } -# - 192.0.2.3 -# provider: "{{ cli }}" -# register: result - -#- assert: -# that: -# - result.changed == true -# - result.commands|length == 2 -# - "'no ip name-server 192.0.2.2' in result.commands" -# - "'ip name-server 192.0.2.2 vrf ansible' in result.commands" - -#- name: verify change to vrf -# ios_system: -# name_servers: -# - 192.0.2.1 -# - { server: 192.0.2.2, vrf: ansible } -# - 192.0.2.3 -# provider: "{{ cli }}" -# register: result -# -#- assert: -# that: -# - result.changed == false - -- name: remove one - ios_system: - name_servers: - - 192.0.2.1 - - 192.0.2.2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - result.changed == true - - result.commands|length == 1 - - "'no ip name-server 192.0.2.3' in result.commands" - -- name: teardown - ios_config: - lines: - - no ip name-server - match: none - provider: "{{ cli }}" - -- debug: msg="END cli/set_name_servers.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_user/defaults/main.yaml b/test/integration/targets/ios_user/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/ios_user/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/ios_user/files/test_rsa b/test/integration/targets/ios_user/files/test_rsa deleted file mode 100644 index 9fdc8c3af0..0000000000 --- a/test/integration/targets/ios_user/files/test_rsa +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAseTsv6oTMJbsRgOSaNEVBlsqE4tKI2MBEOHzTlUnE3GBRtZi -xlUlF9rZcjtk+hTIz3N3UrLtxMnWqv0YGM8tXZTcz50M9ANDE/oNXrXkkMKX5WWr -OcgDCAAZYSVJ/vIt/xZkYteax6zMZQqEBIc/rKo8KuxKZTUMqj0GHkCQbA/o7lBQ -hpdUZxtU/Y2uc9tXVhav3jVzTFUOdwZrCAJghdCCweJfwAj1DdHODip+/hNu+3Sk -DNl0bdhWoNNnUFCYPOUK2B79OMg2+r5bwH7xgURIoTuc54HlGectJpIzI7GB6VfL -UCsJn0uQ7HwX7XAtZjhJWP8dKPd1FuUgg5M8MwIDAQABAoIBACfBVz9GDN/Q+qBy -7+dIwoAXI4IWoMzjtTtGo48f7Iml1hQ0mQJlyNJZ8DpdF6XjuzTRQxtSLVzLFpRD -13zD4AmH2Qj0ug5WJEl0mkRONfQ76KI1ZFyXXEYPb5yMLssw6CKXqHuGX2q8LTlv -bi1s5Ef8C1I0WDPh9SCeXp2oJB5h2G+HtCXDyxASK2nAKqhkpQqPhg5Rd50mBOpD -WE/lor358hU0Aj/qhzjeWKNNK8pgeahXz5anEQZ69TUH102B6bNh8Ao4ZL2j3tr0 -6FbE3ooQT7+zOLm5xOFJ9OnJ2yDVW6Dj1Czllx2vJUcxKsKxaGF76xNCIPiSUUfS -mnOnEfECgYEA2bBFc9Pb8AI0bZZ8Q6XE7Jqa6BOaLbzyjK6IzdyAV/LKdk3yRfEZ -Rb2iNy8poBUYBqBUMfRsRVq5dabjYkz9X5e+75S8Lm/qiktlhTpQYWk5q+eBZdPm -I+dG64Tdyv+Y/NwN4enIsw8LGllY472iUf37ms2+uOA8/BysQ2n7ss0CgYEA0TPD -IhmLqNhQGkS2GU6tM8G7LyGOaIH3mmyCviYgEauWWw3bn/Hhiq/6tLtQc6pv2nIa -ifbACnI+GiIoBFwz8ofuFA8dm76uro7o6eWP5iUizoGISYSewCFpcCpp0xn7/FNR -3RT4YRBMt3yL8J1cVBpPRRbIwp/bZ+pRb0Ggqv8CgYEAoNAFHqHdkhou3N4UgmzN -YvR7hwIkHbG9hIvS6DECZvYm9upyFZUcVFbYpOekWmv6ybpbOGQWL83rv6w/wfia -HKofFSHNOojWvL8iCh+gDbYMMp/dCXpWQyOxUn9e0X2saO+vGbr41r5AN4DVl7gZ -V3THD/75691Lb/tGjq6Wj+kCgYB6ZhadNOUJfMYhGGKSm/2qcobaJH/1lVUQ/Lvi -FNxeek4WKB1/jz2urxe39oAzrFyVKn1sivoBIqZDFAjlxCyAkhcxlUZ1gTMi3mpX -rwBqXv/mYtMicH2RW/scrTQNVv6fuwACoepQoADCuhQGS4thiaMngRUlCfKM8gOD -XJpscQKBgQDIMURtVIV/2ZcGqHv/3G5jsPJPsTycv6YR4gTs5GUBy5If2Rs7DMWE -pJLIcU+SJhMeVKTZPrePibzCp2+rMSI5pc6T+9LC79RKsfie3UybWfLZrSmtnxJx -MgC49TR4NFP6yoYJPYiTdRJ/1Bu68WfVafFK86i9MKAI5OU2ba3/Bg== ------END RSA PRIVATE KEY----- diff --git a/test/integration/targets/ios_user/files/test_rsa.pub b/test/integration/targets/ios_user/files/test_rsa.pub deleted file mode 100644 index e6939a2955..0000000000 --- a/test/integration/targets/ios_user/files/test_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCx5Oy/qhMwluxGA5Jo0RUGWyoTi0ojYwEQ4fNOVScTcYFG1mLGVSUX2tlyO2T6FMjPc3dSsu3Eydaq/RgYzy1dlNzPnQz0A0MT+g1eteSQwpflZas5yAMIABlhJUn+8i3/FmRi15rHrMxlCoQEhz+sqjwq7EplNQyqPQYeQJBsD+juUFCGl1RnG1T9ja5z21dWFq/eNXNMVQ53BmsIAmCF0ILB4l/ACPUN0c4OKn7+E277dKQM2XRt2Fag02dQUJg85QrYHv04yDb6vlvAfvGBREihO5zngeUZ5y0mkjMjsYHpV8tQKwmfS5DsfBftcC1mOElY/x0o93UW5SCDkzwz ansible_ios_user_test diff --git a/test/integration/targets/ios_user/meta/main.yaml b/test/integration/targets/ios_user/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_user/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_user/tasks/cli.yaml b/test/integration/targets/ios_user/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_user/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_user/tasks/main.yaml b/test/integration/targets/ios_user/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_user/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_user/tests/cli/auth.yaml b/test/integration/targets/ios_user/tests/cli/auth.yaml deleted file mode 100644 index 7e7a7b000c..0000000000 --- a/test/integration/targets/ios_user/tests/cli/auth.yaml +++ /dev/null @@ -1,83 +0,0 @@ ---- -- block: - - name: Create user with password - ios_user: - name: auth_user - privilege: 15 - role: network-operator - state: present - provider: "{{ cli }}" - configured_password: pass123 - - - name: test login - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no show version" - responses: - (?i)password: "pass123" - - - name: test login with invalid password (should fail) - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no show version" - responses: - (?i)password: "badpass" - ignore_errors: yes - register: results - - - name: check that attempt failed - assert: - that: - - results.failed - - always: - - name: delete user - ios_user: - name: auth_user - state: absent - provider: "{{ cli }}" - register: result - - - name: reset connection - meta: reset_connection - - -- block: - - name: Ensure ssh key is not world readable - file: - path: "{{ role_path }}/files/test_rsa" - mode: 0600 - - - name: Create user with sshkey - ios_user: - name: ssh_user - privilege: 15 - role: network-operator - state: present - provider: "{{ cli }}" - sshkey: "{{ lookup('file', 'files/test_rsa.pub') }}" - - - name: test sshkey login - shell: "ssh ssh_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o IdentityFile={{ role_path }}/files/test_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o BatchMode=yes -o PubkeyAuthentication=yes show version" - - - name: test login without sshkey (should fail) - expect: - command: "ssh ssh_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no show version" - responses: - (?i)password: badpass - ignore_errors: yes - register: results - - - name: check that attempt failed - assert: - that: - - results.failed - - always: - - name: delete user - ios_user: - name: ssh_user - state: absent - provider: "{{ cli }}" - register: result - - - name: reset connection - meta: reset_connection diff --git a/test/integration/targets/ios_user/tests/cli/basic.yaml b/test/integration/targets/ios_user/tests/cli/basic.yaml deleted file mode 100644 index 144b073879..0000000000 --- a/test/integration/targets/ios_user/tests/cli/basic.yaml +++ /dev/null @@ -1,142 +0,0 @@ ---- -- name: tear down old users if they exist (Setup) - become: true - ios_user: - aggregate: - - name: ansibletest1 - - name: ansibletest2 - - name: ansibletest3 - - name: ansibletest4 - - name: ansibletest5 - - name: ansibletest6 - state: absent - provider: "{{ cli }}" - -- name: Create user (SetUp) - become: true - ios_user: - name: ansibletest1 - privilege: 15 - role: network-operator - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username ansibletest1 view network-operator", "username ansibletest1 privilege 15"]' - -- name: Collection of users (SetUp) - become: true - ios_user: - aggregate: - - name: ansibletest2 - - name: ansibletest3 - provider: "{{ cli }}" - state: present - view: network-admin - register: result - -- assert: - that: - - 'result.changed == true' - - 'result.commands == ["username ansibletest2 view network-admin", "username ansibletest3 view network-admin"]' - -- name: Add user again (Idempotent) - become: true - ios_user: - name: ansibletest1 - privilege: 15 - role: network-operator - state: present - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == false' - - 'result.commands | length == 0' - -- name: Add collection of users again (Idempotent) - become: true - ios_user: - aggregate: - - name: ansibletest2 - - name: ansibletest3 - provider: "{{ cli }}" - state: present - view: network-admin - register: result - -- assert: - that: - - 'result.changed == false' - - 'result.commands | length == 0' - -- name: Create user with password_type (password) - become: true - ios_user: - name: ansibleuser4 - password_type: password - configured_password: testpass - provider: "{{ cli }}" - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - "'username ansibleuser4 password' in result.commands[0]" - -- name: Create user with password_type (secret) - become: true - ios_user: - name: ansibleuser5 - password_type: secret - configured_password: testpass - provider: "{{ cli }}" - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - "'username ansibleuser5 secret' in result.commands[0]" - -- name: Create user with hashed_password - become: true - ios_user: - name: ansibleuser6 - hashed_password: - type: 5 - value: $3$8JcDilcYgFZi.yz4ApaqkHG2.8/ - provider: "{{ cli }}" - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - "'username ansibleuser6 secret' in result.commands[0]" - -- name: tearDown - become: true - ios_user: - aggregate: - - name: ansibletest1 - - name: ansibletest2 - - name: ansibletest3 - - name: ansibletest4 - - name: ansibletest5 - - name: ansibletest6 - state: absent - provider: "{{ cli }}" - register: result - -- assert: - that: - - 'result.changed == true' - - '"no username ansibletest1" in result.commands[0]["command"]' - - '"no username ansibletest2" in result.commands[1]["command"]' - - '"no username ansibletest3" in result.commands[2]["command"]' diff --git a/test/integration/targets/ios_vlan/defaults/main.yaml b/test/integration/targets/ios_vlan/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/ios_vlan/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/ios_vlan/meta/main.yaml b/test/integration/targets/ios_vlan/meta/main.yaml deleted file mode 100644 index 159cea8d38..0000000000 --- a/test/integration/targets/ios_vlan/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_ios_tests diff --git a/test/integration/targets/ios_vlan/tasks/cli.yaml b/test/integration/targets/ios_vlan/tasks/cli.yaml deleted file mode 100644 index 6b93fd5400..0000000000 --- a/test/integration/targets/ios_vlan/tasks/cli.yaml +++ /dev/null @@ -1,24 +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 cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli - -- 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 - tags: connection_local diff --git a/test/integration/targets/ios_vlan/tasks/main.yaml b/test/integration/targets/ios_vlan/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_vlan/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_vlan/tests/cli/basic.yaml b/test/integration/targets/ios_vlan/tests/cli/basic.yaml deleted file mode 100644 index 4f71458d22..0000000000 --- a/test/integration/targets/ios_vlan/tests/cli/basic.yaml +++ /dev/null @@ -1,239 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- set_fact: switch_type="{{ switch_type }}" - -- block: - - - name: setup - remove vlan used in test - ios_config: - lines: - - no vlan 100 - - no vlan 200 - - no vlan 300 - provider: "{{ cli }}" - - - name: setup - remove switchport settings on interfaces used in test - ios_config: - lines: - - switchport mode access - - no switchport access vlan 100 - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - - name: create vlan - ios_vlan: &create - vlan_id: 100 - name: test-vlan - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'vlan 100' in result.commands" - - "'name test-vlan' in result.commands" - - - name: create vlan(idempotence) - ios_vlan: *create - register: result - - - assert: - that: - - "result.changed == false" - - - name: Add interfaces to vlan - ios_vlan: &interfaces - vlan_id: 100 - interfaces: - - GigabitEthernet0/1 - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'interface GigabitEthernet0/1' in result.commands" - - "'switchport mode access' in result.commands" - - "'switchport access vlan 100' in result.commands" - - "'interface GigabitEthernet0/2' in result.commands" - - "'switchport mode access' in result.commands" - - "'switchport access vlan 100' in result.commands" - - - name: Add interfaces to vlan(idempotence) - ios_vlan: *interfaces - register: result - - - assert: - that: - - "result.changed == false" - - - name: Check interface assigned to vrf (intent) - ios_vlan: - vlan_id: 100 - associated_interfaces: - - GigabitEthernet0/1 - - GigabitEthernet0/2 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.failed == false" - - - name: Check interface assigned to vrf (fail) - ios_vlan: - vlan_id: 100 - associated_interfaces: - - test - provider: "{{ cli }}" - ignore_errors: yes - register: result - - - assert: - that: - - "result.failed == True" - - - name: Remove interface from vlan - ios_vlan: &single_int - vlan_id: 100 - interfaces: - - GigabitEthernet0/1 - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'vlan 100' in result.commands" - - "'interface GigabitEthernet0/2' in result.commands" - - "'switchport mode access' in result.commands" - - "'no switchport access vlan 100' in result.commands" - - - name: Remove interface from vlan(idempotence) - ios_vlan: *single_int - register: result - - - assert: - that: - - "result.changed == false" - - - name: Suspend vlan - ios_vlan: - vlan_id: 100 - state: suspend - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'vlan 100' in result.commands" - - "'state suspend' in result.commands" - - - name: Unsuspend vlan - ios_vlan: - vlan_id: 100 - state: active - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'vlan 100' in result.commands" - - "'state active' in result.commands" - - - name: delete vlan - ios_vlan: &delete - vlan_id: 100 - provider: "{{ cli }}" - state: absent - register: result - - - assert: - that: - - "result.changed == true" - - "'no vlan 100' in result.commands" - - - name: delete vlan(idempotence) - ios_vlan: *delete - register: result - - - assert: - that: - - "result.changed == false" - - - name: create vlans using aggregate - ios_vlan: &create_aggregate - aggregate: - - { vlan_id: 200, name: vlan-200 } - - { vlan_id: 300, name: vlan-300 } - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'vlan 200' in result.commands" - - "'name vlan-200' in result.commands" - - "'vlan 300' in result.commands" - - "'name vlan-300' in result.commands" - - - name: create vlans using aggregate(idempotence) - ios_vlan: *create_aggregate - register: result - - - assert: - that: - - "result.changed == false" - - - name: delete vlans using aggregate - ios_vlan: &delete_aggregate - aggregate: - - { vlan_id: 200, name: vlan-200 } - - { vlan_id: 300, name: vlan-300 } - state: absent - provider: "{{ cli }}" - register: result - - - assert: - that: - - "result.changed == true" - - "'no vlan 200' in result.commands" - - "'no vlan 300' in result.commands" - - - name: delete vlans using aggregate(idempotence) - ios_vlan: *delete_aggregate - register: result - - - assert: - that: - - "result.changed == false" - - - name: teardown(part1) - ios_config: - lines: - - no vlan 100 - - no vlan 200 - - no vlan 300 - provider: "{{ cli }}" - - - name: teardown(part2) - ios_config: - lines: - - switchport mode access - - no switchport access vlan 100 - provider: "{{ cli }}" - parents: "{{ item }}" - loop: - - interface GigabitEthernet0/1 - - interface GigabitEthernet0/2 - - when: switch_type == 'L2' - -- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_vlans/defaults/main.yaml b/test/integration/targets/ios_vlans/defaults/main.yaml deleted file mode 100644 index 164afead28..0000000000 --- a/test/integration/targets/ios_vlans/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "[^_].*" -test_items: [] diff --git a/test/integration/targets/ios_vlans/meta/main.yaml b/test/integration/targets/ios_vlans/meta/main.yaml deleted file mode 100644 index 32cf5dda7e..0000000000 --- a/test/integration/targets/ios_vlans/meta/main.yaml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/test/integration/targets/ios_vlans/tasks/cli.yaml b/test/integration/targets/ios_vlans/tasks/cli.yaml deleted file mode 100644 index 3bafcd702f..0000000000 --- a/test/integration/targets/ios_vlans/tasks/cli.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - use_regex: true - register: test_cases - delegate_to: localhost - -- name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - delegate_to: localhost - -- name: Get the IOS version - ios_facts: - gather_subset: all - -- name: Run test case (connection=network_cli) - include: "{{ test_case_to_run }}" - vars: - ansible_connection: network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_network_cli diff --git a/test/integration/targets/ios_vlans/tasks/main.yaml b/test/integration/targets/ios_vlans/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/ios_vlans/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/ios_vlans/tests/cli/_populate_config.yaml b/test/integration/targets/ios_vlans/tests/cli/_populate_config.yaml deleted file mode 100644 index c8c7402ee5..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/_populate_config.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Setup - cli_config: - config: "{{ lines }}" - vars: - lines: | - vlan 10 - vlan 20 - vlan 30 - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_vlans/tests/cli/_remove_config.yaml b/test/integration/targets/ios_vlans/tests/cli/_remove_config.yaml deleted file mode 100644 index 8b45b6fa11..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/_remove_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Remove Config - cli_config: - config: "{{ lines }}" - vars: - lines: | - no vlan 10 - no vlan 20 - no vlan 30 - no vlan 40 - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_vlans/tests/cli/deleted.yaml b/test/integration/targets/ios_vlans/tests/cli/deleted.yaml deleted file mode 100644 index 99ca146fd5..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/deleted.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- debug: - msg: "Start Deleted integration state for ios_vlans ansible_connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Delete VLANs attributes for all configured VLANs - ios_vlans: &deleted - state: deleted - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ deleted['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Delete VLANs attributes for all configured VLANs (IDEMPOTENT) - ios_vlans: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_vlans/tests/cli/empty_config.yaml b/test/integration/targets/ios_vlans/tests/cli/empty_config.yaml deleted file mode 100644 index f54c1f86de..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/empty_config.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: - msg: "START ios_vlans empty_config.yaml integration tests on connection={{ ansible_connection }}" - -- block: - - name: Merged with empty config should give appropriate error message - ios_vlans: - config: - state: merged - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state merged' - - - name: Replaced with empty config should give appropriate error message - ios_vlans: - config: - state: replaced - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state replaced' - - - name: Overridden with empty config should give appropriate error message - ios_vlans: - config: - state: overridden - register: result - ignore_errors: True - - - assert: - that: - - result.msg == 'value of config parameter must not be empty for state overridden' - when: ansible_net_version != "15.6(2)T" diff --git a/test/integration/targets/ios_vlans/tests/cli/merged.yaml b/test/integration/targets/ios_vlans/tests/cli/merged.yaml deleted file mode 100644 index 1e16cdd3a4..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/merged.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -- debug: - msg: "START Merged ios_vlans state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- block: - - name: Merge provided configuration with device configuration - ios_vlans: &merged - config: - - name: Vlan_10 - vlan_id: 10 - state: active - shutdown: disabled - remote_span: True - - name: Vlan_20 - vlan_id: 20 - mtu: 610 - state: active - shutdown: enabled - - name: Vlan_30 - vlan_id: 30 - state: suspend - shutdown: enabled - state: merged - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ merged['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ merged['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Merge provided configuration with device configuration (IDEMPOTENT) - ios_vlans: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_vlans/tests/cli/overridden.yaml b/test/integration/targets/ios_vlans/tests/cli/overridden.yaml deleted file mode 100644 index d464b91a26..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/overridden.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- debug: - msg: "START Overridden ios_vlans state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Override device configuration of all VLANs with provided configuration - ios_vlans: &overridden - config: - - name: VLAN_10 - vlan_id: 10 - mtu: 1000 - - name: VLAN_40 - vlan_id: 40 - mtu: 850 - state: overridden - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ overridden['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT) - ios_vlans: *overridden - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_vlans/tests/cli/replaced.yaml b/test/integration/targets/ios_vlans/tests/cli/replaced.yaml deleted file mode 100644 index 3fbeef796c..0000000000 --- a/test/integration/targets/ios_vlans/tests/cli/replaced.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- debug: - msg: "START Replaced ios_vlans state for integration tests on connection={{ ansible_connection }}" - -- include_tasks: _remove_config.yaml - -- include_tasks: _populate_config.yaml - -- block: - - name: Replaces device configuration of listed VLANs with provided configuration - ios_vlans: &replaced - config: - - vlan_id: 20 - name: Test_VLAN20 - mtu: 700 - shutdown: disabled - - vlan_id: 30 - name: Test_VLAN30 - mtu: 1000 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) | length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ replaced['before'] | symmetric_difference(result['before']) | length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) | length == 0 }}" - - - name: Replaces device configuration of listed interfaces with provided configuration (IDEMPOTENT) - ios_vlans: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - when: ansible_net_version != "15.6(2)T" - - always: - - include_tasks: _remove_config.yaml diff --git a/test/integration/targets/ios_vlans/vars/main.yaml b/test/integration/targets/ios_vlans/vars/main.yaml deleted file mode 100644 index 24e92dc898..0000000000 --- a/test/integration/targets/ios_vlans/vars/main.yaml +++ /dev/null @@ -1,345 +0,0 @@ ---- -merged: - before: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - - commands: - - "vlan 10" - - "name Vlan_10" - - "state active" - - "remote-span" - - "no shutdown" - - "vlan 20" - - "name Vlan_20" - - "state active" - - "mtu 610" - - "shutdown" - - "vlan 30" - - "name Vlan_30" - - "state suspend" - - "shutdown" - - after: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: Vlan_10 - remote_span: true - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 610 - name: Vlan_20 - shutdown: enabled - state: active - vlan_id: 20 - - mtu: 1500 - name: Vlan_30 - shutdown: enabled - state: suspend - vlan_id: 30 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - -replaced: - before: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: VLAN0010 - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 1500 - name: VLAN0020 - shutdown: disabled - state: active - vlan_id: 20 - - mtu: 1500 - name: VLAN0030 - shutdown: disabled - state: active - vlan_id: 30 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - - commands: - - "vlan 20" - - "name Test_VLAN20" - - "mtu 700" - - "vlan 30" - - "name Test_VLAN30" - - "mtu 1000" - - after: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: VLAN0010 - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 700 - name: Test_VLAN20 - shutdown: disabled - state: active - vlan_id: 20 - - mtu: 1000 - name: Test_VLAN30 - shutdown: disabled - state: active - vlan_id: 30 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - -overridden: - before: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: VLAN0010 - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 1500 - name: VLAN0020 - shutdown: disabled - state: active - vlan_id: 20 - - mtu: 1500 - name: VLAN0030 - shutdown: disabled - state: active - vlan_id: 30 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - - commands: - - "vlan 10" - - "name VLAN_10" - - "mtu 1000" - - "no vlan 20" - - "no vlan 30" - - "vlan 40" - - "name VLAN_40" - - "mtu 850" - - after: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1000 - name: VLAN_10 - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 850 - name: VLAN_40 - shutdown: disabled - state: active - vlan_id: 40 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - -deleted: - before: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: VLAN0010 - shutdown: disabled - state: active - vlan_id: 10 - - mtu: 1500 - name: VLAN0020 - shutdown: disabled - state: active - vlan_id: 20 - - mtu: 1500 - name: VLAN0030 - shutdown: disabled - state: active - vlan_id: 30 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 - - commands: - - "no vlan 10" - - "no vlan 20" - - "no vlan 30" - - after: - - mtu: 1500 - name: default - shutdown: disabled - state: active - vlan_id: 1 - - mtu: 1500 - name: fddi-default - shutdown: enabled - state: active - vlan_id: 1002 - - mtu: 1500 - name: token-ring-default - shutdown: enabled - state: active - vlan_id: 1003 - - mtu: 1500 - name: fddinet-default - shutdown: enabled - state: active - vlan_id: 1004 - - mtu: 1500 - name: trnet-default - shutdown: enabled - state: active - vlan_id: 1005 |