From c4da245bc4b5691f1d6223218098b1449371de72 Mon Sep 17 00:00:00 2001 From: Aleksey Kasatkin Date: Fri, 23 May 2014 10:39:51 +0300 Subject: [PATCH] Increase the count of ping probes It's allowed now to get at least 3 answers for no more than 10 requests. Pipes to grep are removed as command result is checked rather than its output. Interval between connectivity checks is increaced (30 -> 60 sec). Closes-Bug: #1322102 Change-Id: I0b227e3426c3d8b453986e6545829a11e125ce0b --- fuel_health/nmanager.py | 6 ++---- fuel_health/tests/sanity/test_sanity_infrastructure.py | 3 +-- .../smoke/test_nova_create_instance_with_connectivity.py | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/fuel_health/nmanager.py b/fuel_health/nmanager.py index bbe73d0e..d4d86c3a 100644 --- a/fuel_health/nmanager.py +++ b/fuel_health/nmanager.py @@ -540,8 +540,7 @@ class NovaNetworkScenarioTest(OfficialClientTest): def _ping_ip_address(self, ip_address, timeout, retries): def ping(): - cmd = "ping -q -c3 -w3 %s | grep 'received' |" \ - " grep -v '0 packets received'" % ip_address + cmd = "ping -q -c3 -w10 %s" % ip_address if self.host: try: @@ -582,8 +581,7 @@ class NovaNetworkScenarioTest(OfficialClientTest): except Exception as exc: LOG.debug(traceback.format_exc()) - command = "ping -q -c3 -w3 8.8.8.8 | grep 'received' |" \ - " grep -v '0 packets received'" + command = "ping -q -c3 -w10 8.8.8.8" return self.retry_command(retries[0], retries[1], ssh.exec_command_on_vm, diff --git a/fuel_health/tests/sanity/test_sanity_infrastructure.py b/fuel_health/tests/sanity/test_sanity_infrastructure.py index 3859a41d..917d6aaf 100644 --- a/fuel_health/tests/sanity/test_sanity_infrastructure.py +++ b/fuel_health/tests/sanity/test_sanity_infrastructure.py @@ -92,8 +92,7 @@ class SanityInfrastructureTest(nmanager.SanityChecksTest): if not self.computes: self.fail('There are no compute nodes') - cmd = "ping -q -c3 -w3 8.8.8.8 | grep 'received' |" \ - " grep -v '0 received'" + cmd = "ping -q -c3 -w10 8.8.8.8" ssh_client = SSHClient(self.computes[0], self.usr, diff --git a/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py b/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py index 67787849..de7dd757 100644 --- a/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py +++ b/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py @@ -224,16 +224,16 @@ class TestNovaNetwork(nmanager.NovaNetworkScenarioTest): LOG.info('is address is {0}'.format(ip_address)) LOG.debug(ip_address) - self.verify(250, self._check_vm_connectivity, 5, + self.verify(400, self._check_vm_connectivity, 5, "VM connectivity doesn`t function properly.", 'VM connectivity checking', ip_address, - 30, (6, 30)) + 30, (6, 60)) - self.verify(250, self._check_connectivity_from_vm, + self.verify(400, self._check_connectivity_from_vm, 6, ("Connectivity to 8.8.8.8 from the VM doesn`t " "function properly."), 'public connectivity checking from VM', ip_address, - 30, (6, 30)) + 30, (6, 60)) self.verify(10, self.compute_client.servers.remove_floating_ip, 7, "Floating IP cannot be removed.",