From 9375ab69b3396337e04bd5a3c9b682f952822ba2 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Fri, 11 Nov 2022 15:56:14 +0530 Subject: [PATCH] updated test playbooks --- tests/pb.juniper_junos_rpc.yml | 42 ++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/tests/pb.juniper_junos_rpc.yml b/tests/pb.juniper_junos_rpc.yml index 9f108294..06b96227 100644 --- a/tests/pb.juniper_junos_rpc.yml +++ b/tests/pb.juniper_junos_rpc.yml @@ -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 @@ -97,7 +98,7 @@ - "get-interface-information" kwargs: - {} - - "interface_name=em0" + - interface_name: "lo0.0" register: test5 ignore_errors: True tags: [ test5 ] @@ -122,7 +123,7 @@ - "get-interface-information" kwargs: - {} - - "interface_name=em0" + - interface_name: "lo0.0" dest_dir: "out" register: test6 ignore_errors: True @@ -130,12 +131,12 @@ - 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 @@ -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 ] +