From eab63a6dd911d3358a1903acf8e510880bfa9ea9 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 11 Feb 2015 01:18:54 -0800 Subject: [PATCH] CLOUDSTACK-8149: Fixed test_Virtualrouter_alerts.py for VMware Signed-off-by: SrikanteswaraRao Talluri --- .../component/test_VirtualRouter_alerts.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/integration/component/test_VirtualRouter_alerts.py b/test/integration/component/test_VirtualRouter_alerts.py index 91a4fcf88f8..5a3bbf09408 100644 --- a/test/integration/component/test_VirtualRouter_alerts.py +++ b/test/integration/component/test_VirtualRouter_alerts.py @@ -23,8 +23,8 @@ from marvin.lib.utils import (get_process_status, cleanup_resources) from marvin.lib.base import (Account, ServiceOffering, - VirtualMachine) - + VirtualMachine, + Configurations) from marvin.lib.common import (list_hosts, list_routers, get_zone, @@ -150,7 +150,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): self.apiclient.connection.user, self.apiclient.connection.passwd, router.linklocalip, - "service dnsmasq status", + "service dnsmasq stop", hypervisor=self.hypervisor ) else: @@ -186,8 +186,18 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): res = str(result) self.debug("apache process status: %s" % res) - time.sleep(2400) - # wait for 40 minutes meanwhile monitor service on + configs = Configurations.list( + self.apiclient, + name='router.alerts.check.interval' + ) + + # Set the value for one more minute than + # actual range to be on safer side + waitingPeriod = ( + int(configs[0].value) + 600) # in seconds + + time.sleep(waitingPeriod) + # wait for (router.alerts.check.interval + 10) minutes meanwhile monitor service on # VR starts the apache service ( # router.alerts.check.interval default value is # 30minutes)