diff options
Diffstat (limited to 'ansible_collections/cisco/iosxr/tests/integration')
14 files changed, 10 insertions, 436 deletions
diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/backup.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/backup.yaml index f33fedff6..26ecf9931 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/backup.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/backup.yaml @@ -19,7 +19,7 @@ - ansible.builtin.assert: that: - result.changed == true - - result.updates is not defined + - result.updates is defined - name: Delete configurable backup file path ansible.builtin.file: diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml index cbb59f6e8..b361b6c32 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml @@ -20,7 +20,6 @@ - ansible.builtin.assert: that: - result.changed == false - - result.updates is not defined - "'comment argument cannot be more than 60 characters' in result.msg" - ansible.builtin.debug: msg="END cli/comment-too-long.yaml on connection={{ ansible_connection }}" diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment.yaml index dcbbe78a8..7b8ba6dec 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/comment.yaml @@ -20,7 +20,7 @@ - ansible.builtin.assert: that: - result.changed == true - - result.updates is not defined + - result.updates is defined - name: Check device with configuration register: result @@ -31,7 +31,6 @@ - ansible.builtin.assert: that: - result.changed == false - - result.updates is not defined - name: Assert accurately report configuration failure during pseudo-atomic operation register: result diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/replace_block.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/replace_block.yaml index b5dce6496..e3977bb74 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/replace_block.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/replace_block.yaml @@ -31,3 +31,9 @@ that: - result2.changed == true - result1.commands == result2.commands + +- name: Cleanup + cisco.iosxr.iosxr_config: + commands: + - no interface GigabitEthernet 0/0/0/5 + ignore_errors: true diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_basic.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_basic.yaml index dd79ebe07..e4a7e9393 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_basic.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_basic.yaml @@ -18,7 +18,7 @@ - ansible.builtin.assert: that: - result.changed == true - - result.updates is not defined + - result.updates is defined - name: Check device with configuration register: result @@ -28,6 +28,5 @@ - ansible.builtin.assert: that: - result.changed == false - - result.updates is not defined - ansible.builtin.debug: msg="END cli/src_basic.yaml on connection={{ ansible_connection }}" diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_match_none.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_match_none.yaml index 7794ab371..3e804679c 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_match_none.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_config/tests/cli/src_match_none.yaml @@ -19,7 +19,7 @@ - ansible.builtin.assert: that: - result.changed == true - - result.updates is not defined + - result.updates is defined - name: Check device with configuration register: result @@ -29,6 +29,5 @@ - ansible.builtin.assert: that: - result.changed == false - - result.updates is not defined - ansible.builtin.debug: msg="END cli/src_match_none.yaml on connection={{ ansible_connection }}" diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/defaults/main.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/defaults/main.yaml deleted file mode 100644 index 9ef5ba516..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/meta/main.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/meta/main.yaml deleted file mode 100644 index be631e5d8..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/meta/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - prepare_iosxr_tests diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/cli.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/cli.yaml deleted file mode 100644 index 88e4708f8..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/cli.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Collect all CLI test cases - ansible.builtin.find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: Set test_items - ansible.builtin.set_fact: - test_items: "{{ test_cases.files | map(attribute='path') | list }}" - -- name: Run test case (connection=ansible.netcommon.network_cli) - ansible.builtin.include_tasks: "{{ test_case_to_run }}" - vars: - ansible_connection: ansible.netcommon.network_cli - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: Reset connection - ansible.builtin.meta: reset_connection diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/main.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/main.yaml deleted file mode 100644 index 419a6cde6..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Include the CLI tasks - ansible.builtin.include_tasks: cli.yaml - -- name: Include the netconf tasks - ansible.builtin.include_tasks: netconf.yaml diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/netconf.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/netconf.yaml deleted file mode 100644 index 26f9ab49a..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tasks/netconf.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Collect all CLI test cases - ansible.builtin.find: - paths: "{{ role_path }}/tests/netconf" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: Set test_items - ansible.builtin.set_fact: - test_items: "{{ test_cases.files | map(attribute='path') | list }}" - -- name: Run test case (connection=ansible.netcommon.netconf) - ansible.builtin.include_tasks: "{{ test_case_to_run }}" - vars: - ansible_connection: ansible.netcommon.netconf - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: - - netconf - -- name: Reset connection - ansible.builtin.meta: reset_connection diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/cli/basic.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/cli/basic.yaml deleted file mode 100644 index 02280f4a0..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/cli/basic.yaml +++ /dev/null @@ -1,140 +0,0 @@ ---- -- name: Remove host logging - cisco.iosxr.iosxr_logging: - dest: host - name: 172.16.0.1 - state: absent - -- name: Remove console logging - register: result - cisco.iosxr.iosxr_logging: - dest: console - state: absent - -- name: Remove buffered logging - register: result - cisco.iosxr.iosxr_logging: - dest: buffered - size: 2097155 - state: absent - -- name: Set up syslog host logging - register: result - cisco.iosxr.iosxr_logging: &id001 - dest: host - name: 172.16.0.1 - level: errors - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"logging 172.16.0.1 vrf default severity error" in result.commands' - -- name: Set up syslog host logging (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id001 -- ansible.builtin.assert: &id003 - that: - - result.changed == false - -- name: Delete/disable syslog host logging - register: result - cisco.iosxr.iosxr_logging: &id002 - dest: host - name: 172.16.0.1 - state: absent - -- ansible.builtin.assert: - that: - - result.changed == true - - '"no logging 172.16.0.1 vrf default" in result.commands' - -- name: Delete/disable syslog host logging (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id002 -- ansible.builtin.assert: *id003 -- name: Add console logging with level warning - register: result - cisco.iosxr.iosxr_logging: &id004 - dest: console - level: warning - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"logging console warning" in result.commands' - -- name: Console logging with level warning (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id004 -- ansible.builtin.assert: *id003 -- name: Remove console logging with level warning - register: result - cisco.iosxr.iosxr_logging: - dest: console - level: warning - state: absent - -- ansible.builtin.assert: &id006 - that: - - result.changed == true - -- name: Configure buffered logging size - register: result - cisco.iosxr.iosxr_logging: &id005 - dest: buffered - size: 4800000 - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"logging buffered 4800000" in result.commands' - -- name: Configure buffered logging size (idempotence) - register: result - cisco.iosxr.iosxr_logging: *id005 -- ansible.builtin.assert: *id003 -- name: Remove buffered logging size - register: result - cisco.iosxr.iosxr_logging: - dest: buffered - size: 4800000 - state: absent - -- ansible.builtin.assert: *id006 -- name: Change logging parameters using aggregate - register: result - cisco.iosxr.iosxr_logging: - aggregate: - - dest: console - level: notifications - - - dest: buffered - size: 4700000 - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"logging buffered 4700000" in result.commands' - - '"logging console notifications" in result.commands' - -- name: Remove logging parameters using aggregate - register: result - cisco.iosxr.iosxr_logging: - aggregate: - - dest: console - level: notifications - - - dest: buffered - size: 4700000 - state: absent - -- ansible.builtin.assert: - that: - - result.changed == true - - '"no logging console" in result.commands' - - '"no logging buffered" in result.commands' diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml deleted file mode 100644 index 2bd05e511..000000000 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml +++ /dev/null @@ -1,208 +0,0 @@ ---- -- name: Remove host logging - cisco.iosxr.iosxr_logging: - dest: host - name: 172.16.0.1 - state: absent - -- name: Remove console logging - register: result - cisco.iosxr.iosxr_logging: - dest: console - level: warning - state: absent - -- name: Remove buffered logging - register: result - cisco.iosxr.iosxr_logging: - dest: buffered - size: 2097155 - state: absent - -- name: Set up syslog host logging - register: result - cisco.iosxr.iosxr_logging: &id001 - dest: host - name: 172.16.0.1 - level: errors - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"172.16.0.1" in result.xml[0]' - -- name: Set up syslog host logging (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id001 -- ansible.builtin.assert: &id003 - that: - - result.changed == false - -- name: Delete/disable syslog host logging - register: result - cisco.iosxr.iosxr_logging: &id002 - dest: host - name: 172.16.0.1 - state: absent - -- ansible.builtin.assert: - that: - - result.changed == true - - '"172.16.0.1" in result.xml[0]' - - '"delete" in result.xml[0]' - -- name: Delete/disable syslog host logging (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id002 -- ansible.builtin.assert: *id003 -- name: Add console logging with level warning - register: result - cisco.iosxr.iosxr_logging: &id004 - dest: console - level: warning - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"console" in result.xml[0]' - - '"warning" in result.xml[0]' - -- name: Console logging with level warning (idempotent) - register: result - cisco.iosxr.iosxr_logging: *id004 -- ansible.builtin.assert: *id003 -- name: Remove console logging with level warning - register: result - cisco.iosxr.iosxr_logging: - dest: console - level: warning - state: absent - -- ansible.builtin.assert: &id006 - that: - - result.changed == true - -- name: Configure buffered logging size - register: result - cisco.iosxr.iosxr_logging: &id005 - dest: buffered - size: 4800000 - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"buffered" in result.xml[0]' - - '"4800000" in result.xml[0]' - -- name: Configure buffered logging size (idempotence) - register: result - cisco.iosxr.iosxr_logging: *id005 -- ansible.builtin.assert: *id003 -- name: Remove buffered logging size - register: result - cisco.iosxr.iosxr_logging: - dest: buffered - size: 4800000 - state: absent - -- ansible.builtin.assert: *id006 -- name: Change logging parameters using aggregate - register: result - cisco.iosxr.iosxr_logging: - aggregate: - - dest: console - level: notifications - - - dest: buffered - size: 4700000 - - - dest: monitor - level: alerts - - - dest: host - name: 10.10.10.1 - level: errors - - - dest: host - name: 10.10.10.2 - - - dest: file - name: file1 - size: 2048 - level: critical - path: /file1 - - - dest: file - name: file2 - size: 2048 - path: /file2 - - - facility: local3 - - - hostnameprefix: host3 - state: present - -- ansible.builtin.assert: - that: - - result.changed == true - - '"file1" in result.xml[0]' - - '"file2" in result.xml[0]' - - '"10.10.10.1" in result.xml[1]' - - '"10.10.10.2" in result.xml[1]' - - '"notice" in result.xml[2]' - - '"alert" in result.xml[3]' - - '"4700000" in result.xml[4]' - - '"debug" in result.xml[4]' - - '"local3" in result.xml[5]' - - '"host3" in result.xml[6]' - -- name: Remove logging parameters using aggregate - register: result - cisco.iosxr.iosxr_logging: - aggregate: - - dest: console - level: notifications - - - dest: buffered - size: 4700000 - - - dest: monitor - level: alerts - - - dest: host - name: 10.10.10.1 - level: errors - - - dest: host - name: 10.10.10.2 - - - dest: file - name: file1 - size: 2048 - level: critical - - - dest: file - name: file2 - size: 2048 - - - facility: local3 - - - hostnameprefix: host3 - state: absent - -- ansible.builtin.assert: - that: - - result.changed == true - - '"file1" in result.xml[0]' - - '"file2" in result.xml[0]' - - '"10.10.10.1" in result.xml[1]' - - '"10.10.10.2" in result.xml[1]' - - '"notice" in result.xml[2]' - - '"alert" in result.xml[3]' - - '"4700000" in result.xml[4]' - - '"debug" in result.xml[4]' - - '"local3" in result.xml[5]' - - '"host3" in result.xml[6]' diff --git a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_smoke/tests/netconf/common_netconf.yaml b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_smoke/tests/netconf/common_netconf.yaml index 2ab0957ae..5f08fd677 100644 --- a/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_smoke/tests/netconf/common_netconf.yaml +++ b/ansible_collections/cisco/iosxr/tests/integration/targets/iosxr_smoke/tests/netconf/common_netconf.yaml @@ -23,24 +23,4 @@ - "'this is my login banner' in result.xml" - "'that has a multiline' in result.xml" -# hit etree_findall() -- name: Remove host logging - cisco.iosxr.iosxr_logging: - dest: host - name: 172.16.0.1 - state: absent - -- name: Set up syslog host logging - cisco.iosxr.iosxr_logging: - dest: host - name: 172.16.0.1 - level: errors - state: present - register: result - -- ansible.builtin.assert: - that: - - "result.changed == true" - - '"172.16.0.1" in result.xml[0]' - - ansible.builtin.debug: msg="END iosxr netconf/common_netconf.yaml on connection={{ ansible_connection }}" |