mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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
This commit is contained in:
@@ -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' }
|
||||
|
||||
@@ -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'] }
|
||||
|
||||
16
test/integration/targets/netconf_get/tasks/sros.yaml
Normal file
16
test/integration/targets/netconf_get/tasks/sros.yaml
Normal file
@@ -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
|
||||
56
test/integration/targets/netconf_get/tests/sros/basic.yaml
Normal file
56
test/integration/targets/netconf_get/tests/sros/basic.yaml
Normal file
@@ -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 }}"
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- debug: msg="START prepare_sros_tests/main.yaml"
|
||||
|
||||
- name: wait until everything is ready to go
|
||||
pause:
|
||||
seconds: 1
|
||||
Reference in New Issue
Block a user