From 47559dc029988ffff591c7a992b4a5b275280d84 Mon Sep 17 00:00:00 2001 From: "Rodolfo D. Arce S" Date: Wed, 16 Jan 2019 15:09:30 -0400 Subject: [PATCH] Windows ping with another parameter --- verify/backend/iosxe.py | 11 ++++++++--- verify/backend/nfvis.py | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/verify/backend/iosxe.py b/verify/backend/iosxe.py index c114ddfcb..c67087702 100755 --- a/verify/backend/iosxe.py +++ b/verify/backend/iosxe.py @@ -67,9 +67,14 @@ def verify() -> bool: for device in devices: print("Testing Device {}".format(device["host"])) # Test: Is device pingable - response = os.system( - "ping -c 2 {} >> iosxe_tests.txt".format(device["host"]) - ) + if os.name == 'nt': + response = os.system( + "ping {} >> iosxe_tests.txt".format(device["host"]) + ) + else: + response = os.system( + "ping -c 2 {} >> iosxe_tests.txt".format(device["host"]) + ) # and then check the response... if response == 0: pingstatus = "Ping Success" diff --git a/verify/backend/nfvis.py b/verify/backend/nfvis.py index c2ca588a8..a62901cb1 100755 --- a/verify/backend/nfvis.py +++ b/verify/backend/nfvis.py @@ -68,9 +68,14 @@ def verify() -> bool: s.verify = False # Test: Is device pingable - response = os.system( - "ping -c 2 {} >> nfvis_tests.txt".format(nip) - ) + if os.name == 'nt': + response = os.system( + "ping -n 2 {} >> nfvis_tests.txt".format(nip) + ) + else: + response = os.system( + "ping -c 2 {} >> nfvis_tests.txt".format(nip) + ) # and then check the response... if response == 0: pingstatus = "Ping Success"