diff options
Diffstat (limited to 'test/integration')
30 files changed, 0 insertions, 875 deletions
diff --git a/test/integration/targets/filter_ipaddr/aliases b/test/integration/targets/filter_ipaddr/aliases deleted file mode 100644 index 1603f4351b..0000000000 --- a/test/integration/targets/filter_ipaddr/aliases +++ /dev/null @@ -1,3 +0,0 @@ -shippable/posix/group2 -skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller -skip/aix diff --git a/test/integration/targets/filter_ipaddr/runme.sh b/test/integration/targets/filter_ipaddr/runme.sh deleted file mode 100755 index d498a5fc67..0000000000 --- a/test/integration/targets/filter_ipaddr/runme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -source virtualenv.sh - -# Requirements have to be installed prior to running ansible-playbook -# because plugins and requirements are loaded before the task runs - -pip install netaddr - -ANSIBLE_ROLES_PATH=../ ansible-playbook runme.yml "$@" diff --git a/test/integration/targets/filter_ipaddr/runme.yml b/test/integration/targets/filter_ipaddr/runme.yml deleted file mode 100644 index d2c5bda732..0000000000 --- a/test/integration/targets/filter_ipaddr/runme.yml +++ /dev/null @@ -1,3 +0,0 @@ -- hosts: localhost - roles: - - { role: filter_ipaddr } diff --git a/test/integration/targets/filter_ipaddr/tasks/main.yml b/test/integration/targets/filter_ipaddr/tasks/main.yml deleted file mode 100644 index c0fde7ced8..0000000000 --- a/test/integration/targets/filter_ipaddr/tasks/main.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Test ipaddr filter - assert: - that: - - "'192.168.0.1/32' | ipaddr('netmask') == '255.255.255.255'" - - "'192.168.0.1/24' | ipaddr('netmask') == '255.255.255.0'" - - "not '192.168.0.1/31' | ipaddr('broadcast')" - - "'192.168.0.1/24' | ipaddr('broadcast') == '192.168.0.255'" - - "'192.168.0.1/24' | ipaddr('prefix') == 24" - - "'192.168.0.1/24' | ipaddr('address') == '192.168.0.1'" - - "'192.168.0.1/24' | ipaddr('network') == '192.168.0.0'" - - "'fe80::dead:beef/64' | ipaddr('broadcast') == 'fe80::ffff:ffff:ffff:ffff'" - - "'::1/120' | ipaddr('netmask') == 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00'" - - "{{ subnets | ipaddr(1) }} == ['10.1.1.1/24', '10.1.2.1/24']" - - "{{ subnets | ipaddr('1') }} == ['10.1.1.1/24', '10.1.2.1/24']" - - "{{ subnets | ipaddr(-1) }} == ['10.1.1.255/24', '10.1.2.255/24']" - - "{{ subnets | ipaddr('-1') }} == ['10.1.1.255/24', '10.1.2.255/24']" - - "'{{ prefix | ipaddr(1) }}' == '10.1.1.1/24'" - - "'{{ prefix | ipaddr('1') }}' == '10.1.1.1/24'" - - "'{{ prefix | ipaddr('network') }}' == '10.1.1.0'" - - "'{{ prefix | ipaddr('-1') }}' == '10.1.1.255/24'" - vars: - subnets: ['10.1.1.0/24', '10.1.2.0/24'] - prefix: '10.1.1.0/24' diff --git a/test/integration/targets/netconf_config/defaults/main.yaml b/test/integration/targets/netconf_config/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/netconf_config/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/netconf_config/meta/main.yml b/test/integration/targets/netconf_config/meta/main.yml deleted file mode 100644 index 3403f48112..0000000000 --- a/test/integration/targets/netconf_config/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - { role: prepare_junos_tests, when: ansible_network_os == 'junos' } - - { role: prepare_iosxr_tests, when: ansible_network_os == 'iosxr' } diff --git a/test/integration/targets/netconf_config/tasks/iosxr.yaml b/test/integration/targets/netconf_config/tasks/iosxr.yaml deleted file mode 100644 index 4f36f4c54d..0000000000 --- a/test/integration/targets/netconf_config/tasks/iosxr.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/iosxr" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_config/tasks/junos.yaml b/test/integration/targets/netconf_config/tasks/junos.yaml deleted file mode 100644 index 86c56f83a5..0000000000 --- a/test/integration/targets/netconf_config/tasks/junos.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/junos" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_config/tasks/main.yaml b/test/integration/targets/netconf_config/tasks/main.yaml deleted file mode 100644 index 4d8eb94cd5..0000000000 --- a/test/integration/targets/netconf_config/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: junos.yaml, when: ansible_network_os == 'junos', tags: ['netconf'] } -- { include: iosxr.yaml, when: ansible_network_os == 'iosxr', tags: ['netconf'] } diff --git a/test/integration/targets/netconf_config/tests/iosxr/basic.yaml b/test/integration/targets/netconf_config/tests/iosxr/basic.yaml deleted file mode 100644 index c2cd38974d..0000000000 --- a/test/integration/targets/netconf_config/tests/iosxr/basic.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- debug: msg="START netconf_config iosxr/basic.yaml on connection={{ ansible_connection }}" - -- name: save config test - netconf_config: - backup: yes - register: result - connection: netconf - -- assert: - that: - - "'backup_path' in result" - -- debug: msg="END netconf_config iosxr/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_config/tests/junos/basic.yaml b/test/integration/targets/netconf_config/tests/junos/basic.yaml deleted file mode 100644 index c9d4d169db..0000000000 --- a/test/integration/targets/netconf_config/tests/junos/basic.yaml +++ /dev/null @@ -1,75 +0,0 @@ ---- -- debug: msg="START netconf_config junos/basic.yaml on connection={{ ansible_connection }}" - -- include_vars: "{{playbook_dir }}/targets/netconf_config/tests/junos/fixtures/config.yml" - -- name: syslog file config- setup - junos_config: - lines: - - delete system syslog file test_netconf_config - -- name: configure syslog file - netconf_config: - content: "{{ syslog_config }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'<name>test_netconf_config</name>' in result.diff.after" - -- name: configure syslog file (idempotent) - netconf_config: - content: "{{ syslog_config }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: replace default operation fail - netconf_config: - content: "{{ syslog_config_replace }}" - default_operation: 'replace' - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed == true" - - "'Missing mandatory statement' in result.msg" - -- name: replace syslog config with operation key in content - netconf_config: - content: "{{ syslog_config_replace }}" - register: result - -- assert: - that: - - "result.changed == true" - -- name: test backup - netconf_config: - content: "{{ syslog_config }}" - backup: True - register: result - -- assert: - that: - - "'backup_path' in result" - -- name: syslog file config- teardown - junos_config: - lines: - - delete system syslog file test_netconf_config - -- name: save config - netconf_config: - backup: yes - register: result - -- assert: - that: - - "'backup_path' in result" - -- debug: msg="END netconf_config junos/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_config/tests/junos/fixtures/config.yml b/test/integration/targets/netconf_config/tests/junos/fixtures/config.yml deleted file mode 100644 index 86de0f9da5..0000000000 --- a/test/integration/targets/netconf_config/tests/junos/fixtures/config.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -syslog_config: | - <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> - <configuration> - <system> - <syslog> - <file> - <name>test_netconf_config</name> - <contents> - <name>any</name> - <any/> - </contents> - <contents> - <name>kernel</name> - <critical/> - </contents> - </file> - </syslog> - </system> - </configuration> - </config> - -syslog_config_replace: | - <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> - <configuration> - <system> - <syslog operation="replace"> - <file> - <name>test_netconf_config</name> - <contents> - <name>any</name> - <any/> - </contents> - </file> - </syslog> - </system> - </configuration> - </config> diff --git a/test/integration/targets/netconf_get/defaults/main.yaml b/test/integration/targets/netconf_get/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/netconf_get/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/netconf_get/meta/main.yml b/test/integration/targets/netconf_get/meta/main.yml deleted file mode 100644 index 0fb2b09f0e..0000000000 --- a/test/integration/targets/netconf_get/meta/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -dependencies: - - { role: prepare_junos_tests, when: ansible_network_os == 'junos' } - - { role: prepare_iosxr_tests, when: ansible_network_os == 'iosxr' } - - { role: prepare_sros_tests, when: ansible_network_os == 'sros' } diff --git a/test/integration/targets/netconf_get/tasks/iosxr.yaml b/test/integration/targets/netconf_get/tasks/iosxr.yaml deleted file mode 100644 index 4f36f4c54d..0000000000 --- a/test/integration/targets/netconf_get/tasks/iosxr.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/iosxr" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_get/tasks/junos.yaml b/test/integration/targets/netconf_get/tasks/junos.yaml deleted file mode 100644 index 86c56f83a5..0000000000 --- a/test/integration/targets/netconf_get/tasks/junos.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/junos" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_get/tasks/main.yaml b/test/integration/targets/netconf_get/tasks/main.yaml deleted file mode 100644 index a34a2fecd6..0000000000 --- a/test/integration/targets/netconf_get/tasks/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- { include: junos.yaml, when: ansible_network_os == 'junos', tags: ['netconf'] } -- { include: iosxr.yaml, when: ansible_network_os == 'iosxr', tags: ['netconf'] } -- { include: sros.yaml, when: ansible_network_os == 'sros', tags: ['netconf'] } diff --git a/test/integration/targets/netconf_get/tasks/sros.yaml b/test/integration/targets/netconf_get/tasks/sros.yaml deleted file mode 100644 index bc8728b82e..0000000000 --- a/test/integration/targets/netconf_get/tasks/sros.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/sros" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_get/tests/iosxr/basic.yaml b/test/integration/targets/netconf_get/tests/iosxr/basic.yaml deleted file mode 100644 index 0a6066d4fa..0000000000 --- a/test/integration/targets/netconf_get/tests/iosxr/basic.yaml +++ /dev/null @@ -1,163 +0,0 @@ ---- -- debug: msg="START netconf_get iosxr/basic.yaml on connection={{ ansible_connection }}" - -- name: setup interface - iosxr_config: - commands: - - description this is test interface Loopback999 - - no shutdown - parents: - - interface Loopback999 - match: none - connection: network_cli - -- name: get running interface confiugration with filter - netconf_get: - source: running - filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations> - register: result - connection: netconf - -- assert: - that: - - "'<description>this is test interface Loopback999</description>' in result.stdout" - - "'<usernames>' not in result.stdout" - -- name: test lock=never, get-config, running interface confiugration with filter without lock - netconf_get: - source: running - lock: never - filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations> - register: result - connection: netconf - -- assert: - that: - - "'<description>this is test interface Loopback999</description>' in result.stdout" - - "'<usernames>' not in result.stdout" - -- name: test lock=if-supported, get-config, running interface confiugration with filter without lock - netconf_get: - source: running - lock: if-supported - filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations> - register: result - connection: netconf - -- assert: - that: - - "'<description>this is test interface Loopback999</description>' in result.stdout" - - "'<usernames>' not in result.stdout" - -- name: Failure scenario, get-config information with lock - netconf_get: - source: running - lock: always - register: result - ignore_errors: True - connection: netconf - -- assert: - that: - - "'<bad-element>running</bad-element>' in result.msg" - -- name: Failure scenario, fetch config from startup - netconf_get: - source: startup - register: result - ignore_errors: True - connection: netconf - -- assert: - that: - - "'startup source is not supported' in result.msg" - -- name: test get, information from running datastore without lock - netconf_get: - lock: never - filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations> - register: result - connection: netconf - -- assert: - that: - - "'<description>this is test interface Loopback999</description>' in result.stdout" - -- name: test get, information from running datastore with lock if supported - netconf_get: - lock: if-supported - filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations> - register: result - connection: netconf - -- assert: - that: - - "'<description>this is test interface Loopback999</description>' in result.stdout" - -- name: Failure scenario, get information from running with lock - netconf_get: - lock: always - register: result - ignore_errors: True - connection: netconf - -- assert: - that: - - "'<bad-element>running</bad-element>' in result.msg" - -- name: get configuration and state data in json format - netconf_get: - source: running - display: json - register: result - connection: netconf - -- assert: - that: - - "{{ result['output']['data']['aaa'] is defined}}" - -- name: get configuration data in xml pretty format - netconf_get: - source: running - display: pretty - register: result - connection: netconf - -- assert: - that: - - "{{ result['output'] is defined}}" - -- name: get configuration data in xml with namespace stripped - netconf_get: - source: running - display: xml - register: result - connection: netconf - -- assert: - that: - - "{{ result['output'] is defined}}" - - "{{ 'xmlns' not in result.output }}" - -- name: Failure scenario, unsupported filter - netconf_get: - filter: configuration/state - register: result - ignore_errors: True - connection: netconf - -- assert: - that: - - "'filter value \\'configuration/state\\' of type xpath is not supported' in result.msg" - -- name: setup - teardown - iosxr_config: - commands: - - no description - - shutdown - parents: - - interface Loopback999 - match: none - connection: network_cli - -- debug: msg="END netconf_get iosxr/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_get/tests/junos/basic.yaml b/test/integration/targets/netconf_get/tests/junos/basic.yaml deleted file mode 100644 index 3eee81e920..0000000000 --- a/test/integration/targets/netconf_get/tests/junos/basic.yaml +++ /dev/null @@ -1,126 +0,0 @@ ---- -- debug: msg="START netconf_get junos/basic.yaml on connection={{ ansible_connection }}" - -- name: Configure syslog file - setup - junos_config: - lines: - - set system syslog file test1 any any - register: result - -- name: Get system configuration data from running datastore state - netconf_get: - source: running - filter: <configuration><system><syslog></syslog></system></configuration> - register: result - -- assert: - that: - - "'<name>test1</name>' in result.stdout" - - "'<name>any</name>' in result.stdout" - - "'<any/>' in result.stdout" - - "'<login>' not in result.stdout" - - "'<interface>' not in result.stdout" - -- name: Failure scenario, fetch config from startup - netconf_get: - source: startup - register: result - ignore_errors: True - -- assert: - that: - - "'startup source is not supported' in result.msg" - -- name: Failure scenario, fetch config from running with lock - netconf_get: - lock: always - source: running - register: result - ignore_errors: True - -- assert: - that: - - "'syntax error' in result.msg" - -- name: Get system configuration data from running datastore state and lock if-supported - netconf_get: - source: running - filter: <configuration><system><syslog></syslog></system></configuration> - lock: if-supported - register: result - -- assert: - that: - - "'<name>test1</name>' in result.stdout" - - "'<name>any</name>' in result.stdout" - - "'<any/>' in result.stdout" - - "'<login>' not in result.stdout" - - "'<interface>' not in result.stdout" - -- name: get configuration and state data in json format - netconf_get: - source: running - display: json - register: result - -- assert: - that: - - "{{ result['output']['rpc-reply']['data']['configuration'] is defined}}" - -- name: get configuration and state data in xml pretty format - netconf_get: - source: running - display: pretty - register: result - -- assert: - that: - - "{{ result['output'] is defined}}" - -- name: get configuration data in xml with namespace stripped - netconf_get: - source: running - display: xml - register: result - -- assert: - that: - - "{{ result['output'] is defined}}" - - "{{ 'xmlns' not in result.output }}" - -- name: get configuration and state data without datastore lock - netconf_get: - lock: never - register: result - -- assert: - that: - - "'<database-status-information>' in result.stdout" - - "'</configuration>' in result.stdout" - -- name: get configuration and state data and lock data-store if supported - netconf_get: - lock: if-supported - register: result - -- assert: - that: - - "'<database-status-information>' in result.stdout" - - "'</configuration>' in result.stdout" - -- name: Failure scenario, unsupported filter - netconf_get: - filter: configuration/state - register: result - ignore_errors: True - -- assert: - that: - - "'filter value \\'configuration/state\\' of type xpath is not supported' in result.msg" - -- name: Configure syslog file - teardown - junos_config: - lines: - - delete system syslog file test1 any any - -- debug: msg="END netconf_get junos/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_get/tests/sros/basic.yaml b/test/integration/targets/netconf_get/tests/sros/basic.yaml deleted file mode 100644 index 1a68ff3243..0000000000 --- a/test/integration/targets/netconf_get/tests/sros/basic.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -- debug: msg="START netconf_get sros/basic.yaml on connection={{ ansible_connection }}" - -- name: Get complete configuration data (SROS) - netconf_get: - filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"/> - register: result - -- assert: - that: - - "'urn:nokia.com:sros:ns:yang:sr:conf' in result.stdout" - - "'urn:nokia.com:sros:ns:yang:sr:state' not in result.stdout" - -- name: Get complete state data (SROS) - netconf_get: - filter: <state xmlns="urn:nokia.com:sros:ns:yang:sr:state"/> - register: result - -- assert: - that: - - "'urn:nokia.com:sros:ns:yang:sr:state' in result.stdout" - - "'urn:nokia.com:sros:ns:yang:sr:conf' not in result.stdout" - -- name: Get service configuration data from candidate datastore (SROS) - netconf_get: - source: candidate - filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"><service/></configure> - display: json - register: result - -- assert: - that: - - "'<service>' in result.stdout" - -- name: Get system configuration data from running datastore (SROS) - netconf_get: - source: running - filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"><system/></configure> - register: result - -- assert: - that: - - "'<system>' in result.stdout" - -- name: Get complete configuration and state data (SROS) - netconf_get: - register: result - -- assert: - that: - - "'<service>' in result.stdout" - - "'<system>' in result.stdout" - - "'urn:nokia.com:sros:ns:yang:sr:conf' in result.stdout" - - "'urn:nokia.com:sros:ns:yang:sr:state' in result.stdout" - -- debug: msg="END netconf_get sros/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_rpc/defaults/main.yaml b/test/integration/targets/netconf_rpc/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/netconf_rpc/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/netconf_rpc/meta/main.yml b/test/integration/targets/netconf_rpc/meta/main.yml deleted file mode 100644 index 3403f48112..0000000000 --- a/test/integration/targets/netconf_rpc/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - { role: prepare_junos_tests, when: ansible_network_os == 'junos' } - - { role: prepare_iosxr_tests, when: ansible_network_os == 'iosxr' } diff --git a/test/integration/targets/netconf_rpc/tasks/iosxr.yaml b/test/integration/targets/netconf_rpc/tasks/iosxr.yaml deleted file mode 100644 index 7894985531..0000000000 --- a/test/integration/targets/netconf_rpc/tasks/iosxr.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/iosxr" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_rpc/tasks/junos.yaml b/test/integration/targets/netconf_rpc/tasks/junos.yaml deleted file mode 100644 index 86c56f83a5..0000000000 --- a/test/integration/targets/netconf_rpc/tasks/junos.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/junos" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_rpc/tasks/main.yaml b/test/integration/targets/netconf_rpc/tasks/main.yaml deleted file mode 100644 index a34a2fecd6..0000000000 --- a/test/integration/targets/netconf_rpc/tasks/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- { include: junos.yaml, when: ansible_network_os == 'junos', tags: ['netconf'] } -- { include: iosxr.yaml, when: ansible_network_os == 'iosxr', tags: ['netconf'] } -- { include: sros.yaml, when: ansible_network_os == 'sros', tags: ['netconf'] } diff --git a/test/integration/targets/netconf_rpc/tasks/sros.yaml b/test/integration/targets/netconf_rpc/tasks/sros.yaml deleted file mode 100644 index bc8728b82e..0000000000 --- a/test/integration/targets/netconf_rpc/tasks/sros.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all netconf test cases - find: - paths: "{{ role_path }}/tests/sros" - patterns: "{{ testcase }}.yaml" - register: test_cases - connection: local - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=netconf) - include: "{{ test_case_to_run }} ansible_connection=netconf" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/netconf_rpc/tests/iosxr/basic.yaml b/test/integration/targets/netconf_rpc/tests/iosxr/basic.yaml deleted file mode 100644 index 992d051692..0000000000 --- a/test/integration/targets/netconf_rpc/tests/iosxr/basic.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- debug: msg="START netconf_rpc iosxr/basic.yaml on connection={{ ansible_connection }}" - -- name: discard changes - netconf_rpc: - rpc: discard-changes - -- debug: msg="END netconf_rpc iosxr/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_rpc/tests/junos/basic.yaml b/test/integration/targets/netconf_rpc/tests/junos/basic.yaml deleted file mode 100644 index 956a1e424d..0000000000 --- a/test/integration/targets/netconf_rpc/tests/junos/basic.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- debug: msg="START netconf_rpc junos/basic.yaml on connection={{ ansible_connection }}" - -- name: discard changes - netconf_rpc: - rpc: discard-changes - -- debug: msg="END netconf_rpc junos/basic.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/netconf_rpc/tests/sros/basic.yaml b/test/integration/targets/netconf_rpc/tests/sros/basic.yaml deleted file mode 100644 index f7e58a3651..0000000000 --- a/test/integration/targets/netconf_rpc/tests/sros/basic.yaml +++ /dev/null @@ -1,188 +0,0 @@ ---- -- debug: msg="START netconf_rpc sros/basic.yaml on connection={{ ansible_connection }}" - -- name: lock candidate (content is dict) - netconf_rpc: - rpc: lock - content: - target: - candidate: - register: result - connection: netconf - -- name: discard changes (w/o content) - netconf_rpc: - rpc: discard-changes - display: xml - register: result - connection: netconf - -- name: unlock candidate (content is dict as json) - netconf_rpc: - rpc: unlock - xmlns: "urn:ietf:params:xml:ns:netconf:base:1.0" - content: "{'target': {'candidate': None}}" - display: json - register: result - connection: netconf - -- assert: - that: - - "{{ result['output']['rpc-reply'] is defined}}" - - "{{ result['output']['rpc-reply']['ok'] is defined}}" - -- name: validate candidate (content is single line of XML) - netconf_rpc: - rpc: validate - content: "<source><candidate/></source>" - display: json - register: result - connection: netconf - -- assert: - that: - - "{{ result['output']['rpc-reply'] is defined}}" - - "{{ result['output']['rpc-reply']['ok'] is defined}}" - -- name: copy running to startup - netconf_rpc: - rpc: copy-config - content: - source: - running: - target: - startup: - register: result - connection: netconf - -- name: get schema list (content is multiple lines of XML) - netconf_rpc: - rpc: get - content: | - <filter> - <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"> - <schemas/> - </netconf-state> - </filter> - display: json - register: result - connection: netconf - -- assert: - that: - - "{{ result['output']['data'] is defined}}" - - "{{ result['output']['data']['netconf-state'] is defined}}" - - "{{ result['output']['data']['netconf-state']['schemas'] is defined}}" - - "{{ result['output']['data']['netconf-state']['schemas']['schema'] is defined}}" - -# The following two test-cases have been validated against a pre-release implementation. -# To make this playbook work with the regular Nokia SROS 16.0 release, those test-cases -# have been commented out. As soon the <get-schema> operation is supported by SROS -# those test-cases shall be included. - -#- name: get-schema -# netconf_rpc: -# rpc: get-schema -# xmlns: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring -# content: -# identifier: ietf-netconf -# version: "2011-06-01" -# register: result -# connection: netconf - -#- name: get schema using XML request -# netconf_rpc: -# rpc: "get-schema" -# xmlns: "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring" -# content: | -# <identifier>ietf-netconf-monitoring</identifier> -# <version>2010-10-04</version> -# display: pretty -# register: result -# connection: netconf - -- name: Failure scenario, unsupported content (xpath value) - netconf_rpc: - rpc: get - content: schemas/schema[identifier=ietf-netconf-monitoring] - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'unsupported content value' in result.msg" - -- name: Failure scenario, unsupported content type (list) - netconf_rpc: - rpc: get - content: - - value1 - - value2 - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'unsupported content data-type' in result.msg" - -- name: Failure scenario, RPC is close-session - netconf_rpc: - rpc: close-session - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'unsupported operation' in result.msg" - -- name: Failure scenario, attribute rpc missing - netconf_rpc: - display: json - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'missing required arguments' in result.msg" - -- name: Failure scenario, attribute rpc is None - netconf_rpc: - rpc: - display: json - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'must not be None' in result.msg" - -- name: Failure scenario, attribute rpc is zero-length string - netconf_rpc: - rpc: "" - display: json - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'must not be empty' in result.msg" - -- name: Failure scenario, attribute rpc only contains white-spaces - netconf_rpc: - rpc: " " - display: json - register: result - connection: netconf - ignore_errors: True - -- assert: - that: - - "'must not be empty' in result.msg" - -- debug: msg="END netconf_rpc sros/basic.yaml on connection={{ ansible_connection }}" |