Skip to content

Commit ceab66b

Browse files
author
rsmekala
committed
Fixed tests for juniper_junos_rpc
1 parent cfccc22 commit ceab66b

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

tests/pb.juniper_junos_rpc.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
- Juniper.junos
88

99
tasks:
10-
##################################################
11-
#### TEST 1 ##
12-
##################################################
10+
#################
1311
- name: "Execute single RPC get-software-information without any kwargs"
1412
juniper_junos_rpc:
1513
host: "{{ ansible_ssh_host }}"
@@ -28,9 +26,7 @@
2826
- test1|succeeded
2927
tags: [ test1 ]
3028

31-
##################################################
32-
#### TEST 2 ##
33-
##################################################
29+
#################
3430
- name: "Get Device Configuration with dest"
3531
juniper_junos_rpc:
3632
host: "{{ ansible_ssh_host }}"
@@ -56,6 +52,9 @@
5652
tags: [ test2 ]
5753

5854
- name: Clean up TEST 2
55+
file:
56+
path: get_config.conf
57+
state: absent
5958

6059

6160
#################
@@ -159,8 +158,12 @@
159158
- stat_result_1.stat.exists == True
160159
tags: [ test6 ]
161160

162-
#################
161+
- name: Clean up TEST 6
162+
file:
163+
path: get_config.conf
164+
state: absent
163165

166+
#################
164167
- name: Get Device Configuration for interface
165168
juniper_junos_rpc:
166169
host: "{{ ansible_ssh_host }}"
@@ -179,4 +182,23 @@
179182
- test7|succeeded
180183
tags: [ test7 ]
181184

182-
#################
185+
#################
186+
- name: "Execute wrong RPC to generate RPC error"
187+
juniper_junos_rpc:
188+
host: "{{ ansible_ssh_host }}"
189+
port: "{{ ansible_ssh_port }}"
190+
user: "{{ ansible_ssh_user }}"
191+
passwd: "{{ ansible_ssh_pass }}"
192+
rpcs:
193+
- "wrong-rpc"
194+
register: test8
195+
ignore_errors: True
196+
tags: [ test5 ]
197+
198+
- name: Check TEST 8
199+
assert:
200+
that:
201+
- test8|failed
202+
tags: [ test8 ]
203+
204+
#################

0 commit comments

Comments
 (0)