Skip to content

Commit 3cc59c1

Browse files
author
Paul Angus
committed
fix ping tests to properly recognise successful ping test
1 parent 9eb8b2e commit 3cc59c1

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

test/integration/smoke/test_password_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ def test_ssh_command(self, vm, nat_rule, rule_label):
181181
ssh = vm.get_ssh_client(ipaddress=nat_rule.ipaddress, port=self.services[rule_label]["publicport"], retries=5)
182182
result = str(ssh.execute(ssh_command))
183183

184-
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count("3 packets received")))
184+
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count(" 0% packet loss")))
185185
except:
186186
self.fail("Failed to SSH into VM - %s" % (nat_rule.ipaddress))
187187

188188
self.assertEqual(
189-
result.count("3 packets received"),
189+
result.count(" 0% packet loss"),
190190
1,
191191
"Ping to outside world from VM should be successful"
192192
)

test/integration/smoke/test_router_dhcphosts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ def test_ssh_command(self, vm, nat_rule, rule_label):
190190
ssh = vm.get_ssh_client(ipaddress=nat_rule.ipaddress, port=self.services[rule_label]["publicport"], retries=5)
191191
result = str(ssh.execute(ssh_command))
192192

193-
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count("3 packets received")))
193+
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count(" 0% packet loss")))
194194
except:
195195
self.fail("Failed to SSH into VM - %s" % (nat_rule.ipaddress))
196196

197197
self.assertEqual(
198-
result.count("3 packets received"),
198+
result.count(" 0% packet loss"),
199199
1,
200200
"Ping to outside world from VM should be successful"
201201
)

test/integration/smoke/test_routers_network_ops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
270270
# Test SSH after closing port 22
271271
expected = 1
272272
ssh_command = "ping -c 3 8.8.8.8"
273-
check_string = "3 packets received"
273+
check_string = " 0% packet loss"
274274
result = check_router_command(virtual_machine, nat_rule.ipaddress, ssh_command, check_string, self)
275275

276276
self.assertEqual(
@@ -434,7 +434,7 @@ def test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false(self):
434434

435435
expected = 0
436436
ssh_command = "ping -c 3 8.8.8.8"
437-
check_string = "3 packets received"
437+
check_string = " 0% packet loss"
438438
result = check_router_command(virtual_machine, nat_rule.ipaddress, ssh_command, check_string, self)
439439

440440
self.assertEqual(
@@ -822,7 +822,7 @@ def test_01_isolate_network_FW_PF_default_routes_egress_true(self):
822822
# Test SSH after closing port 22
823823
expected = 1
824824
ssh_command = "ping -c 3 8.8.8.8"
825-
check_string = "3 packets received"
825+
check_string = " 0% packet loss"
826826
result = check_router_command(virtual_machine, nat_rule.ipaddress, ssh_command, check_string, self)
827827

828828
self.assertEqual(
@@ -977,7 +977,7 @@ def test_02_isolate_network_FW_PF_default_routes_egress_false(self):
977977

978978
expected = 0
979979
ssh_command = "ping -c 3 8.8.8.8"
980-
check_string = "3 packets received"
980+
check_string = " 0% packet loss"
981981
result = check_router_command(virtual_machine, nat_rule.ipaddress, ssh_command, check_string, self)
982982

983983
self.assertEqual(

test/integration/smoke/test_vpc_redundant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,14 @@ def do_default_routes_test(self):
695695
self.logger.debug("Ping to google.com from VM")
696696
result = str(ssh.execute(ssh_command))
697697

698-
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count("3 packets received")))
698+
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count(" 0% packet loss")))
699699
except Exception as e:
700700
self.fail("SSH Access failed for %s: %s" % \
701701
(vmObj.get_ip(), e)
702702
)
703703

704704
self.assertEqual(
705-
result.count("3 packets received"),
705+
result.count(" 0% packet loss"),
706706
1,
707707
"Ping to outside world from VM should be successful"
708708
)

test/integration/smoke/test_vpc_router_nics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,14 @@ def do_default_routes_test(self):
464464
self.logger.debug("Ping to google.com from VM")
465465
result = str(ssh.execute(ssh_command))
466466

467-
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count("3 packets received")))
467+
self.logger.debug("SSH result: %s; COUNT is ==> %s" % (result, result.count(" 0% packet loss")))
468468
except Exception as e:
469469
self.fail("SSH Access failed for %s: %s" % \
470470
(vmObj.get_ip(), e)
471471
)
472472

473473
self.assertEqual(
474-
result.count("3 packets received"),
474+
result.count(" 0% packet loss"),
475475
1,
476476
"Ping to outside world from VM should be successful"
477477
)

0 commit comments

Comments
 (0)