CLOUDSTACK-8149: Fixed test_Virtualrouter_alerts.py for VMware

Signed-off-by: SrikanteswaraRao Talluri <tall...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/eab63a6d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/eab63a6d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/eab63a6d

Branch: refs/heads/hotfix/scp-exception
Commit: eab63a6dd911d3358a1903acf8e510880bfa9ea9
Parents: d849a66
Author: Gaurav Aradhye <gaurav.arad...@clogeny.com>
Authored: Wed Feb 11 01:18:54 2015 -0800
Committer: SrikanteswaraRao Talluri <tall...@apache.org>
Committed: Fri Feb 13 12:40:09 2015 +0530

----------------------------------------------------------------------
 .../component/test_VirtualRouter_alerts.py      | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eab63a6d/test/integration/component/test_VirtualRouter_alerts.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_VirtualRouter_alerts.py 
b/test/integration/component/test_VirtualRouter_alerts.py
index 91a4fcf..5a3bbf0 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)

Reply via email to