From b3a3490b28160fa6e496f04052ee5a95f06e515d Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 3 Nov 2022 17:14:09 +0530 Subject: [PATCH] updated test playbooks --- tests/junos_jsnapy/test_junos_storage.yml | 2 +- tests/pb.juniper_junos_config.yml | 8 ++++++++ tests/pb.juniper_junos_jsnapy.yml | 6 ++++-- tests/pb.juniper_junos_software.yml | 4 ++-- tests/pb.juniper_junos_system.yml | 4 ++++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/junos_jsnapy/test_junos_storage.yml b/tests/junos_jsnapy/test_junos_storage.yml index 3473c27e..1be2c82b 100644 --- a/tests/junos_jsnapy/test_junos_storage.yml +++ b/tests/junos_jsnapy/test_junos_storage.yml @@ -4,7 +4,7 @@ tests_include: check_storage: - command: show system storage - iterate: - xpath: //system-storage-information/filesystem[normalize-space(mounted-on)='/'] + xpath: //system-storage-information/filesystem[normalize-space(mounted-on)='/.mount'] tests: - is-lt: used-percent, 95 info: "File system {{post['mounted-on']}} use less than 95%" diff --git a/tests/pb.juniper_junos_config.yml b/tests/pb.juniper_junos_config.yml index 4e95dee5..0a85a84c 100644 --- a/tests/pb.juniper_junos_config.yml +++ b/tests/pb.juniper_junos_config.yml @@ -91,6 +91,14 @@ # path: out # state: absent ################ + - name: Append .foo to the hostname using private config mode. + config: + config_mode: 'private' + load: 'merge' + lines: + - "set system services netconf ssh" + comment: "Configured system services" + - name: Retrieve [edit system services] of current committed config. config: retrieve: 'committed' diff --git a/tests/pb.juniper_junos_jsnapy.yml b/tests/pb.juniper_junos_jsnapy.yml index 0bcf749a..08f10004 100644 --- a/tests/pb.juniper_junos_jsnapy.yml +++ b/tests/pb.juniper_junos_jsnapy.yml @@ -138,8 +138,10 @@ ignore_errors: True tags: [ test7 ] - - name: Wait for loopback to come up - pause: seconds=15 + - name: Sleep for 15 seconds for loopback to come up + ansible.builtin.wait_for: + timeout: 15 + delegate_to: localhost - name: "TEST 7 - SNAP_POST with additional loopback" jsnapy: diff --git a/tests/pb.juniper_junos_software.yml b/tests/pb.juniper_junos_software.yml index e1de7691..2f8170ce 100644 --- a/tests/pb.juniper_junos_software.yml +++ b/tests/pb.juniper_junos_software.yml @@ -34,9 +34,9 @@ - name: Check TEST - 1 assert: that: - - test1.failed == "false" + - test1.failed == false handlers: - name: wait_reboot wait_for: host={{ ansible_ssh_host }} port=830 timeout={{ wait_time }} - when: not test.check_mode + when: not test1.check_mode diff --git a/tests/pb.juniper_junos_system.yml b/tests/pb.juniper_junos_system.yml index 94216973..f2428221 100644 --- a/tests/pb.juniper_junos_system.yml +++ b/tests/pb.juniper_junos_system.yml @@ -19,3 +19,7 @@ that: - test1.reboot == true tags: [ test1 ] + + - name: Checking NETCONF connectivity + wait_for: host={{ ansible_ssh_host }} port=830 timeout=360 +