Skip to content

Commit

Permalink
updated test playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
chidanandpujar committed Nov 11, 2022
1 parent 60547b6 commit 9375ab6
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions tests/pb.juniper_junos_rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
- name: "Get Device Configuration in text"
rpc:
rpc: get-interface-information
kwargs: "interface_name=em0"
kwargs:
interface_name: "lo0.0"
format: text
register: test3
ignore_errors: True
Expand Down Expand Up @@ -97,7 +98,7 @@
- "get-interface-information"
kwargs:
- {}
- "interface_name=em0"
- interface_name: "lo0.0"
register: test5
ignore_errors: True
tags: [ test5 ]
Expand All @@ -122,20 +123,20 @@
- "get-interface-information"
kwargs:
- {}
- "interface_name=em0"
- interface_name: "lo0.0"
dest_dir: "out"
register: test6
ignore_errors: True
tags: [ test6 ]

- name: Check get-interface-information.xml exists
stat:
path: "out/{{ ansible_ssh_host }}_get-interface-information.xml"
path: "out/test_get-interface-information.xml"
register: stat_result_1

- name: Check get-software-information.xml exists
stat:
path: "out/{{ ansible_ssh_host }}_get-software-information.xml"
path: "out/test_get-software-information.xml"
register: stat_result_2

- name: Check TEST 6
Expand Down Expand Up @@ -183,3 +184,34 @@
tags: [ test8 ]

#################
- name: "Check configuration for errors"
rpc:
rpcs:
- "open-configuration"
- "load-configuration"
- "close-configuration"
attrs:
- {}
- action: 'set'
format: 'text'
- {}
kwargs:
- private: true
- configuration_set: 'set system syslog file test1 any any'
- {}
register: test9
tags: [ test9 ]

- name: Check TEST 9
debug:
var: test9
tags: [ test9 ]

- name: Check TEST 9
assert:
that:
- test9.results[0].msg == "The RPC executed successfully."
- test9.results[1].msg == "The RPC executed successfully."
- test9.results[2].msg == "The RPC executed successfully."
tags: [ test9 ]

0 comments on commit 9375ab6

Please sign in to comment.