|
|
|
@ -10,14 +10,14 @@
|
|
|
|
|
- assert:
|
|
|
|
|
that:
|
|
|
|
|
- "result.changed == false"
|
|
|
|
|
- "'<name>\nem0\n</name>' in result['xml']"
|
|
|
|
|
- "'<interface-information' in result['xml']"
|
|
|
|
|
- "result.output is defined"
|
|
|
|
|
|
|
|
|
|
- name: Execute RPC with args on device
|
|
|
|
|
junos_rpc:
|
|
|
|
|
rpc: get-interface-information
|
|
|
|
|
args:
|
|
|
|
|
interface-name: em0
|
|
|
|
|
interface-name: lo0
|
|
|
|
|
media: True
|
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
register: result
|
|
|
|
@ -25,8 +25,9 @@
|
|
|
|
|
- assert:
|
|
|
|
|
that:
|
|
|
|
|
- "result.changed == false"
|
|
|
|
|
- "'<name>\nem0\n</name>' in result['xml']"
|
|
|
|
|
- "'<name>\nlo0\n</name>' not in result['xml']"
|
|
|
|
|
- "'<name>\nlo0\n</name>' in result['xml']"
|
|
|
|
|
- "'<name>\nem0\n</name>' not in result['xml']"
|
|
|
|
|
- "'<name>\fxp0\n</name>' not in result['xml']"
|
|
|
|
|
|
|
|
|
|
- name: Execute RPC on device and get output in text format
|
|
|
|
|
junos_rpc:
|
|
|
|
@ -40,14 +41,14 @@
|
|
|
|
|
- "result.changed == false"
|
|
|
|
|
- "result.output is defined"
|
|
|
|
|
- "result.output_lines is defined"
|
|
|
|
|
- "'Physical interface: em0' in result['output']"
|
|
|
|
|
- "'Physical interface' 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
|
|
|
|
|
interface-name: lo0
|
|
|
|
|
media: True
|
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
register: result
|
|
|
|
@ -56,7 +57,7 @@
|
|
|
|
|
that:
|
|
|
|
|
- "result.changed == false"
|
|
|
|
|
- "result.output is defined"
|
|
|
|
|
- "result['output']['interface-information'][0]['physical-interface'][0]['name'][0]['data'] == \"em0\""
|
|
|
|
|
- "result['output']['interface-information'][0]['physical-interface'][0]['name'][0]['data'] == \"lo0\""
|
|
|
|
|
|
|
|
|
|
- name: Execute invalid RPC
|
|
|
|
|
junos_rpc:
|
|
|
|
|