1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/junos_rpc/tests/netconf/rpc.yaml
Ganesh Nalawade 1c8c51d05c
Fix junos integration failures (#34571)
*  Add connection=netconf in individual roles for modules that run using netconf connection
plugin
*  Add connection=network_cli for junos_netconf and junos_command
at applicable places
2018-01-08 17:58:47 +05:30

72 lines
1.7 KiB
YAML

---
- debug: msg="START netconf/rpc.yaml on connection={{ ansible_connection }}"
- name: Execute RPC on device
junos_rpc:
rpc: get-interface-information
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- "'<name>\nem0\n</name>' in result['xml']"
- "result.output is defined"
- name: Execute RPC with args on device
junos_rpc:
rpc: get-interface-information
args:
interface-name: em0
media: True
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- "'<name>\nem0\n</name>' in result['xml']"
- "'<name>\nlo0\n</name>' not in result['xml']"
- name: Execute RPC on device and get output in text format
junos_rpc:
rpc: get-interface-information
output: text
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.output is defined"
- "result.output_lines is defined"
- "'Physical interface: em0' in result['output']"
- name: Execute RPC on device and get output in json format
junos_rpc:
rpc: get-interface-information
output: json
args:
interface-name: em0
media: True
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.output is defined"
- "result['output']['interface-information'][0]['physical-interface'][0]['name'][0]['data'] == \"em0\""
- name: Execute invalid RPC
junos_rpc:
rpc: show-interface-information
provider: "{{ netconf }}"
register: result
ignore_errors: yes
- assert:
that:
- "result.failed == true"
- debug: msg="END netconf/rpc.yaml on connection={{ ansible_connection }}"