You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ta...@apache.org on 2015/01/13 10:50:03 UTC

[1/4] git commit: updated refs/heads/master to f11e570

Repository: cloudstack
Updated Branches:
  refs/heads/master 06d4458d0 -> f11e57079


CLOUDSTACK-8152: Adding delay before creating snapshot/template from root disk after writing data to disk - test_vm_passwordenabled.py

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


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

Branch: refs/heads/master
Commit: d79837b67a481e618c8291152a9ecec299ff02dd
Parents: 06d4458
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Jan 13 13:56:41 2015 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Tue Jan 13 15:09:58 2015 +0530

----------------------------------------------------------------------
 .../component/test_vm_passwdenabled.py          | 97 ++++++++++++--------
 1 file changed, 59 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d79837b6/test/integration/component/test_vm_passwdenabled.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py
index d998ed5..77d3013 100644
--- a/test/integration/component/test_vm_passwdenabled.py
+++ b/test/integration/component/test_vm_passwdenabled.py
@@ -14,24 +14,33 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-import marvin
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.sshClient import SshClient
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import cleanup_resources
+from marvin.lib.base import (Account,
+                             ServiceOffering,
+                             VirtualMachine,
+                             EgressFireWallRule,
+                             Template)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template,
+                               list_virtual_machines,
+                               list_volumes)
 from nose.plugins.attrib import attr
+import time
 
 
 _multiprocess_shared_ = True
+
+
 class Services:
+
     """Test VM Life Cycle Services
     """
 
     def __init__(self):
         self.services = {
-            "disk_offering":{
+            "disk_offering": {
                 "displaytext": "Small",
                 "name": "Small",
                 "disksize": 1
@@ -44,26 +53,26 @@ class Services:
                 # Random characters are appended in create account to
                 # ensure unique username generated each time
                 "password": "password",
-                },
+            },
             "small":
             # Create a small virtual machine instance with disk offering
                 {
                     "displayname": "testserver",
-                    "username": "root", # VM creds for SSH
+                    "username": "root",  # VM creds for SSH
                     "password": "password",
                     "ssh_port": 22,
                     "hypervisor": 'XenServer',
                     "privateport": 22,
                     "publicport": 22,
                     "protocol": 'TCP',
-                    },
+            },
             "egress": {
                     "name": 'web',
                     "protocol": 'TCP',
                     "startport": 80,
                     "endport": 80,
                     "cidrlist": '0.0.0.0/0',
-                },
+            },
             "service_offerings":
                 {
                     "small":
@@ -75,19 +84,20 @@ class Services:
                             "cpunumber": 1,
                             "cpuspeed": 100,
                             "memory": 256,
-                            },
-                },
+                        },
+            },
             "template": {
                 "displaytext": "Cent OS Template",
                 "name": "Cent OS Template",
                 "passwordenabled": True,
-                },
+            },
             "sleep": 60,
             "timeout": 10,
             "ostype": 'CentOS 5.3 (64-bit)',
             # CentOS 5.3 (64-bit)
         }
 
+
 class TestVMPasswordEnabled(cloudstackTestCase):
 
     @classmethod
@@ -132,33 +142,39 @@ class TestVMPasswordEnabled(cloudstackTestCase):
 
         networkid = cls.virtual_machine.nic[0].networkid
 
-        # create egress rule to allow wget of my cloud-set-guest-password script
+        # create egress rule to allow wget of my cloud-set-guest-password
+        # script
         if zone.networktype.lower() == 'advanced':
-            EgressFireWallRule.create(cls.api_client,
-                                  networkid=networkid,
-                                  protocol=cls.services["egress"]["protocol"],
-                                  startport=cls.services["egress"]["startport"],
-                                  endport=cls.services["egress"]["endport"],
-                                  cidrlist=cls.services["egress"]["cidrlist"])
+            EgressFireWallRule.create(
+                cls.api_client,
+                networkid=networkid,
+                protocol=cls.services["egress"]["protocol"],
+                startport=cls.services["egress"]["startport"],
+                endport=cls.services["egress"]["endport"],
+                cidrlist=cls.services["egress"]["cidrlist"])
 
         cls.virtual_machine.password = cls.services["small"]["password"]
         ssh = cls.virtual_machine.get_ssh_client()
 
-        #below steps are required to get the new password from VR(reset password)
-        #http://cloudstack.org/dl/cloud-set-guest-password
-        #Copy this file to /etc/init.d
-        #chmod +x /etc/init.d/cloud-set-guest-password
-        #chkconfig --add cloud-set-guest-password
+        # below steps are required to get the new password from VR
+        # (reset password)
+        # http://cloudstack.org/dl/cloud-set-guest-password
+        # Copy this file to /etc/init.d
+        # chmod +x /etc/init.d/cloud-set-guest-password
+        # chkconfig --add cloud-set-guest-password
 
         cmds = [
             "cd /etc/init.d;wget http://people.apache.org/~tsp/cloud-set-guest-password",
             "chmod +x /etc/init.d/cloud-set-guest-password",
             "chkconfig --add cloud-set-guest-password",
-            ]
+        ]
         for c in cmds:
-            result = ssh.execute(c)
+            ssh.execute(c)
+
+        # Adding delay of 120 sec to avoid data loss due to timing issue
+        time.sleep(120)
 
-        #Stop virtual machine
+        # Stop virtual machine
         cls.virtual_machine.stop(cls.api_client)
 
         # Poll listVM to ensure VM is stopped properly
@@ -200,7 +216,7 @@ class TestVMPasswordEnabled(cloudstackTestCase):
 
         cls.services["template"]["ostype"] = cls.services["ostype"]
         cls.services["template"]["ispublic"] = True
-        #Create templates for Edit, Delete & update permissions testcases
+        # Create templates for Edit, Delete & update permissions testcases
         cls.pw_enabled_template = Template.create(
             cls.api_client,
             cls.services["template"],
@@ -236,11 +252,18 @@ class TestVMPasswordEnabled(cloudstackTestCase):
         self.cleanup = []
 
     def tearDown(self):
-        #Clean up, terminate the created instances
+        # Clean up, terminate the created instances
         cleanup_resources(self.apiclient, self.cleanup)
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
+    @attr(
+        tags=[
+            "advanced",
+            "advancedns",
+            "smoke",
+            "basic",
+            "sg"],
+        required_hardware="true")
     def test_11_get_vm_password(self):
         """Test get VM password for password enabled template"""
 
@@ -254,9 +277,6 @@ class TestVMPasswordEnabled(cloudstackTestCase):
         self.debug("Stopping VM: %s" % self.vm.name)
         self.vm.stop(self.apiclient)
 
-        # Sleep to ensure VM is stopped properly
-        time.sleep(self.services["sleep"])
-
         self.debug("Resetting VM password for VM: %s" % self.vm.name)
         password = self.vm.resetPassword(self.apiclient)
         self.debug("Password reset to: %s" % password)
@@ -281,7 +301,8 @@ class TestVMPasswordEnabled(cloudstackTestCase):
         try:
             self.debug("SSHing into VM: %s" % self.vm.ssh_ip)
             self.vm.password = password
-            ssh = self.vm.get_ssh_client()
+            self.vm.get_ssh_client()
         except Exception as e:
-            self.fail("SSH into VM: %s failed" % self.vm.ssh_ip)
+            self.fail("SSH into VM: %s failed: %s" %
+                      (self.vm.ssh_ip, e))
         return


[4/4] git commit: updated refs/heads/master to f11e570

Posted by ta...@apache.org.
CLOUDSTACK-8145: Adding new test to test blocker bugs and modifying other test case to work around the bug

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


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

Branch: refs/heads/master
Commit: f11e5707961f7a8e18238d06848d1bce6f0172ab
Parents: 9056e4c
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri Jan 9 15:41:03 2015 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Tue Jan 13 15:15:10 2015 +0530

----------------------------------------------------------------------
 test/integration/component/test_blocker_bugs.py | 146 ++++++++++++++++++-
 .../component/test_reset_ssh_keypair.py         |   6 +
 2 files changed, 150 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f11e5707/test/integration/component/test_blocker_bugs.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py
index 8ba563f..3ea7545 100644
--- a/test/integration/component/test_blocker_bugs.py
+++ b/test/integration/component/test_blocker_bugs.py
@@ -106,7 +106,6 @@ class Services:
                         "sleep": 180,
                      }
 
-
 class TestTemplate(cloudstackTestCase):
 
     def setUp(self):
@@ -253,7 +252,6 @@ class TestTemplate(cloudstackTestCase):
                         )
         return
 
-
 class TestNATRules(cloudstackTestCase):
 
     @classmethod
@@ -1005,3 +1003,147 @@ class TestTemplates(cloudstackTestCase):
                             "Check the name of the template"
                         )
         return
+
+class TestDataPersistency(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+
+        cls.testClient = super(TestDataPersistency, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = cls.testClient.getParsedTestDataConfig()
+        # Get Zone, Domain and templates
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.domain = get_domain(cls.api_client)
+        cls.services['mode'] = cls.zone.networktype
+        template = get_template(
+                            cls.api_client,
+                            cls.zone.id,
+                            cls.services["ostype"]
+                            )
+        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+        #Create an account, network, VM and IP addresses
+        cls.account = Account.create(
+                                     cls.api_client,
+                                     cls.services["account"],
+                                     domainid=cls.domain.id
+                                     )
+
+        cls.userapiclient = cls.testClient.getUserApiClient(
+                            UserName=cls.account.name,
+                            DomainName=cls.account.domain)
+
+        cls.service_offering = ServiceOffering.create(
+                                            cls.api_client,
+                                            cls.services["service_offering"]
+                                            )
+        cls.virtual_machine = VirtualMachine.create(
+                                    cls.api_client,
+                                    cls.services["virtual_machine"],
+                                    templateid=template.id,
+                                    accountid=cls.account.name,
+                                    domainid=cls.account.domainid,
+                                    serviceofferingid=cls.service_offering.id,
+                                    mode=cls.services["mode"]
+                                    )
+        cls.cleanup = [
+                       cls.account,
+                       cls.service_offering
+                       ]
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            #Clean up, terminate the created templates
+            cleanup_resources(cls.api_client, cls.cleanup)
+
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        return
+
+    def tearDown(self):
+        # No need
+        return
+
+    @attr(tags=["advanced", "basic", "advancedns", "eip"], required_hardware="true")
+    def test_01_data_persistency_root_disk(self):
+        """
+        Test the timing issue of root disk data sync
+
+        # 1. Write data to root disk of a VM
+        # 2. Create a template from the root disk of VM
+        # 3. Create a new VM from this template
+        # 4. Check that the data is present in the new VM
+
+        This is to test that data is persisted on root disk of VM or not
+        when template is created immediately from it
+        """
+
+        ssh = self.virtual_machine.get_ssh_client()
+
+        sampleText = "This is sample data"
+
+        cmds = [
+                "cd /root/",
+                "touch testFile.txt",
+                "chmod 600 testFile.txt",
+                "echo %s >> testFile.txt" % sampleText
+                ]
+        for c in cmds:
+            ssh.execute(c)
+
+        #Stop virtual machine
+        self.virtual_machine.stop(self.api_client)
+
+        list_volume = Volume.list(
+                            self.api_client,
+                            virtualmachineid=self.virtual_machine.id,
+                            type='ROOT',
+                            listall=True)
+
+        if isinstance(list_volume, list):
+            self.volume = list_volume[0]
+        else:
+            raise Exception(
+                "Exception: Unable to find root volume for VM: %s" %
+                self.virtual_machine.id)
+
+        self.services["template"]["ostype"] = self.services["ostype"]
+        #Create templates for Edit, Delete & update permissions testcases
+        customTemplate = Template.create(
+                self.userapiclient,
+                self.services["template"],
+                self.volume.id,
+                account=self.account.name,
+                domainid=self.account.domainid
+            )
+        self.cleanup.append(customTemplate)
+        # Delete the VM - No longer needed
+        self.virtual_machine.delete(self.apiclient)
+
+        virtual_machine = VirtualMachine.create(
+                                    self.apiclient,
+                                    self.services["virtual_machine"],
+                                    templateid=customTemplate.id,
+                                    accountid=self.account.name,
+                                    domainid=self.account.domainid,
+                                    serviceofferingid=self.service_offering.id,
+                                    mode=self.services["mode"]
+                                    )
+
+        ssh = virtual_machine.get_ssh_client()
+
+        response = ssh.execute("cat /root/testFile.txt")
+        res = str(response[0])
+
+        self.assertEqual(res, sampleText, "The data %s does not match\
+                with sample test %s" %
+                (res, sampleText))
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f11e5707/test/integration/component/test_reset_ssh_keypair.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_reset_ssh_keypair.py b/test/integration/component/test_reset_ssh_keypair.py
index a2e743a..db7e9b8 100644
--- a/test/integration/component/test_reset_ssh_keypair.py
+++ b/test/integration/component/test_reset_ssh_keypair.py
@@ -200,6 +200,9 @@ class TestResetSSHKeypair(cloudstackTestCase):
             for c in cmds:
                 ssh.execute(c)
 
+            # Adding delay of 120 sec to avoid data loss due to timing issue
+            time.sleep(120)
+
             #Stop virtual machine
             cls.virtual_machine.stop(cls.api_client)
 
@@ -1031,6 +1034,9 @@ class TestResetSSHKeyUserRights(cloudstackTestCase):
         for c in cmds:
             ssh.execute(c)
 
+        # Adding delay of 120 sec to avoid data loss due to timing issue
+        time.sleep(120)
+
         try:
             #Stop virtual machine
             cls.virtual_machine.stop(cls.api_client)


[2/4] git commit: updated refs/heads/master to f11e570

Posted by ta...@apache.org.
CLOUDSTACK-8149: Code-refactor - test_VirtualRouter_alerts.py

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


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

Branch: refs/heads/master
Commit: d0b6234e516c3d36b461c575c8945fcbbdd3181d
Parents: d79837b
Author: Ashutosh K <as...@clogeny.com>
Authored: Mon Jan 12 18:47:29 2015 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Tue Jan 13 15:13:06 2015 +0530

----------------------------------------------------------------------
 .../component/test_VirtualRouter_alerts.py      | 187 +++++++------------
 1 file changed, 70 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0b6234e/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 bff12f9..91a4fcf 100644
--- a/test/integration/component/test_VirtualRouter_alerts.py
+++ b/test/integration/component/test_VirtualRouter_alerts.py
@@ -16,13 +16,20 @@
 # under the License.
 """ P1 tests for alert receiving from VR on service failure in VR
 """
-#Import Local Modules
-import marvin
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+# Import Local Modules
+# import marvin
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import (get_process_status,
+                              cleanup_resources)
+from marvin.lib.base import (Account,
+                             ServiceOffering,
+                             VirtualMachine)
+
+from marvin.lib.common import (list_hosts,
+                               list_routers,
+                               get_zone,
+                               get_domain,
+                               get_template)
 from nose.plugins.attrib import attr
 from marvin.codes import FAILED
 import time
@@ -30,76 +37,16 @@ import time
 
 _multiprocess_shared_ = True
 
-class Services:
-    """Test VM Life Cycle Services
-    """
-
-    def __init__(self):
-        self.services = {
-
-            "account": {
-                "email": "test@test.com",
-                "firstname": "Test",
-                "lastname": "User",
-                "username": "test",
-                # Random characters are appended in create account to
-                # ensure unique username generated each time
-                "password": "password",
-                },
-            "small":
-            # Create a small virtual machine instance with disk offering
-                {
-                    "displayname": "testserver",
-                    "username": "root", # VM creds for SSH
-                    "password": "password",
-                    "ssh_port": 22,
-                    "hypervisor": 'XenServer',
-                    "privateport": 22,
-                    "publicport": 22,
-                    "protocol": 'TCP',
-                    },
-            "service_offerings":
-                {
-                    "small":
-                        {
-                            # Small service offering ID to for change VM
-                            # service offering from medium to small
-                            "name": "SmallInstance",
-                            "displaytext": "SmallInstance",
-                            "cpunumber": 1,
-                            "cpuspeed": 100,
-                            "memory": 256,
-                            },
-                    "big":
-                        {
-                            # Big service offering ID to for change VM
-                            "name": "BigInstance",
-                            "displaytext": "BigInstance",
-                            "cpunumber": 1,
-                            "cpuspeed": 100,
-                            "memory": 512,
-                            }
-                },
-            #Change this
-            "template": {
-                "displaytext": "xs",
-                "name": "xs",
-                "passwordenabled": False,
-                },
-            "sleep": 60,
-            "timeout": 10,
-            #Migrate VM to hostid
-            "ostype": 'CentOS 5.3 (64-bit)',
-            # CentOS 5.3 (64-bit)
-        }
-
 
 class TestVRServiceFailureAlerting(cloudstackTestCase):
+
     @classmethod
     def setUpClass(cls):
-        cls.testClient = super(TestVRServiceFailureAlerting, cls).getClsTestClient()
+        cls.testClient = super(
+            TestVRServiceFailureAlerting,
+            cls).getClsTestClient()
         cls.api_client = cls.testClient.getApiClient()
-        cls.services = Services().services
+        cls.services = cls.testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
         cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
@@ -113,7 +60,8 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
         )
 
         if template == FAILED:
-            assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
+            assert False, "get_template() failed to return template with \
+                           description %s" % cls.services["ostype"]
         # Set Zones and disk offerings ??
         cls.services["small"]["zoneid"] = cls.zone.id
         cls.services["small"]["template"] = template.id
@@ -130,7 +78,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
             cls.services["service_offerings"]["small"]
         )
 
-        #create a virtual machine
+        # create a virtual machine
         cls.virtual_machine = VirtualMachine.create(
             cls.api_client,
             cls.services["small"],
@@ -146,7 +94,9 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
 
     @classmethod
     def tearDownClass(cls):
-        cls.api_client = super(TestVRServiceFailureAlerting, cls).getClsTestClient().getApiClient()
+        cls.api_client = super(
+            TestVRServiceFailureAlerting,
+            cls).getClsTestClient().getApiClient()
         cleanup_resources(cls.api_client, cls._cleanup)
         return
 
@@ -157,7 +107,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
         self.cleanup = []
 
     def tearDown(self):
-        #Clean up, terminate the created ISOs
+        # Clean up, terminate the created ISOs
         cleanup_resources(self.apiclient, self.cleanup)
         return
 
@@ -165,7 +115,6 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
     @attr(tags=["advanced", "basic"])
     def test_01_VRServiceFailureAlerting(self):
 
-
         if self.zone.networktype == "Basic":
             list_router_response = list_routers(
                 self.apiclient,
@@ -184,67 +133,71 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
         )
         router = list_router_response[0]
 
-        hosts = list_hosts(
-            self.apiclient,
-            zoneid=router.zoneid,
-            type='Routing',
-            state='Up',
-            id=router.hostid
-        )
-        self.assertEqual(
-            isinstance(hosts, list),
-            True,
-            "Check list host returns a valid list"
-        )
-        host = hosts[0]
-
         self.debug("Router ID: %s, state: %s" % (router.id, router.state))
 
         self.assertEqual(
-        router.state,
-        'Running',
-        "Check list router response for router state"
+            router.state,
+            'Running',
+            "Check list router response for router state"
         )
 
         alertSubject = "Monitoring Service on VR " + router.name
 
         if self.hypervisor.lower() in ('vmware', 'hyperv'):
             result = get_process_status(
-                        self.apiclient.connection.mgtSvr,
-                        22,
-                        self.apiclient.connection.user,
-                        self.apiclient.connection.passwd,
-                        router.linklocalip,
-                        "service dnsmasq status",
-                        hypervisor=self.hypervisor
-                        )
+                self.apiclient.connection.mgtSvr,
+                22,
+                self.apiclient.connection.user,
+                self.apiclient.connection.passwd,
+                router.linklocalip,
+                "service dnsmasq status",
+                hypervisor=self.hypervisor
+            )
         else:
             try:
-                host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
+                hosts = list_hosts(
+                    self.apiclient,
+                    zoneid=router.zoneid,
+                    type='Routing',
+                    state='Up',
+                    id=router.hostid
+                )
+
+                self.assertEqual(
+                    isinstance(hosts, list),
+                    True,
+                    "Check list host returns a valid list"
+                )
+
+                host = hosts[0]
                 result = get_process_status(
-                            host.ipaddress,
-                            22,
-                            host.user,
-                            host.passwd,
-                            router.linklocalip,
-                            "service apache2 stop"
-                            )
-            except KeyError:
-                self.skipTest("Marvin configuration has no host credentials to check router services")
+                    host.ipaddress,
+                    22,
+                    self.services["configurableData"]["host"]["username"],
+                    self.services["configurableData"]["host"]["password"],
+                    router.linklocalip,
+                    "service apache2 stop"
+                )
+
+            except Exception as e:
+                raise Exception("Exception raised in getting host\
+                        credentials: %s " % e)
 
         res = str(result)
         self.debug("apache process status: %s" % res)
 
-        time.sleep(2400) #wait for 40 minutes meanwhile monitor service on VR starts the apache service (router.alerts.check.interval default value is 30minutes)
+        time.sleep(2400)
+        # wait for 40 minutes meanwhile monitor service on
+        # VR starts the apache service (
+        # router.alerts.check.interval default value is
+        # 30minutes)
 
         qresultset = self.dbclient.execute(
-            "select id from alert where subject = '%s' ORDER BY id DESC LIMIT 1;" \
-            % str(alertSubject)
-        )
+            "select id from alert where subject = '%s' ORDER BY id DESC LIMIT 1;" %
+            str(alertSubject))
         self.assertNotEqual(
             len(qresultset),
             0,
             "Check DB Query result set"
         )
-
         return


[3/4] git commit: updated refs/heads/master to f11e570

Posted by ta...@apache.org.
CLOUDSTACK-8147: Fixed typo in test case test_redundant_router.py

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


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

Branch: refs/heads/master
Commit: 9056e4c3fb568a4cbb978ef0c798bc2dd2c43bf1
Parents: d0b6234
Author: Ashutosh K <as...@clogeny.com>
Authored: Mon Jan 12 18:11:20 2015 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Tue Jan 13 15:13:59 2015 +0530

----------------------------------------------------------------------
 test/integration/component/maint/test_redundant_router.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9056e4c3/test/integration/component/maint/test_redundant_router.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_redundant_router.py b/test/integration/component/maint/test_redundant_router.py
index 01d635b..98b0bae 100644
--- a/test/integration/component/maint/test_redundant_router.py
+++ b/test/integration/component/maint/test_redundant_router.py
@@ -787,7 +787,7 @@ class TestRVRInternals(cloudstackTestCase):
                 self.apiclient.connection.mgtSvr,
                 22,
                 self.apiclient.connection.user,
-                self.apiclient.connction.passwd,
+                self.apiclient.connection.passwd,
                 backup_router.linklocalip,
                 'ip addr show eth2',
                 hypervisor=self.hypervisor