diff options
author | wiso <wisotzky@users.noreply.github.com> | 2018-05-24 12:14:39 +0200 |
---|---|---|
committer | Ganesh Nalawade <ganesh634@gmail.com> | 2018-05-24 15:44:39 +0530 |
commit | 160bf82544eca98e8ac2287ab7be8287097c14b9 (patch) | |
tree | b4fe0887098aa6c07c63be6e919ea6b7b96a48a6 /test/integration/targets/netconf_get | |
parent | 387a23c3d14f6c29ef6e78ca333c6a054eac5730 (diff) | |
download | ansible-160bf82544eca98e8ac2287ab7be8287097c14b9.tar.gz |
Add NETCONF support for SROS devices (#40330)
* added NETCONF support for SROS devices
* corrected alu mapping
* fix pep8 in sros.py
* BOT META file updated
Diffstat (limited to 'test/integration/targets/netconf_get')
4 files changed, 74 insertions, 0 deletions
diff --git a/test/integration/targets/netconf_get/meta/main.yml b/test/integration/targets/netconf_get/meta/main.yml index 3403f48112..0fb2b09f0e 100644 --- a/test/integration/targets/netconf_get/meta/main.yml +++ b/test/integration/targets/netconf_get/meta/main.yml @@ -2,3 +2,4 @@ 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/main.yaml b/test/integration/targets/netconf_get/tasks/main.yaml index 4d8eb94cd5..a34a2fecd6 100644 --- a/test/integration/targets/netconf_get/tasks/main.yaml +++ b/test/integration/targets/netconf_get/tasks/main.yaml @@ -1,3 +1,4 @@ --- - { 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 new file mode 100644 index 0000000000..bc8728b82e --- /dev/null +++ b/test/integration/targets/netconf_get/tasks/sros.yaml @@ -0,0 +1,16 @@ +--- +- 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/sros/basic.yaml b/test/integration/targets/netconf_get/tests/sros/basic.yaml new file mode 100644 index 0000000000..1a68ff3243 --- /dev/null +++ b/test/integration/targets/netconf_get/tests/sros/basic.yaml @@ -0,0 +1,56 @@ +--- +- 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 }}" |