cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [25/29] git commit: updated refs/heads/master-6-17-stable to 93712c2
Date Fri, 28 Jun 2013 19:22:46 GMT
Test Volumes: do not assume max.volumes attachable to guest

1.Current Implementation assumes 6 as the max volumes that can be
attached to disk.  Actually it depends on the hypervisor capabilities.

2.Modified the script to get the max limit from hypervsior capabilities.

Signed-off-by: sanjeevneelarapu <sanjeev.neelarapu@citrix.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 64e3074c7ea74afa3f48c21949335bb9208aca40)


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

Branch: refs/heads/master-6-17-stable
Commit: 8312741cc01dd444c385fccf37974ea033b44058
Parents: c7e2ca5
Author: sanjeevneelarapu <sanjeev.neelarapu@citrix.com>
Authored: Fri Jun 21 16:00:42 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Sat Jun 29 00:52:08 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_volumes.py | 65 +++++++++++++++++++++++--
 1 file changed, 60 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8312741c/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index 369cefc..e06bac9 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -58,7 +58,6 @@ class Services:
                         },
                         "volume": {
                                 "diskname": "TestDiskServ",
-                                "max": 6,
                         },
                          "virtual_machine": {
                                     "displayname": "testVM",
@@ -97,6 +96,7 @@ class TestAttachVolume(cloudstackTestCase):
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.api_client, cls.services)
         cls.zone = get_zone(cls.api_client, cls.services)
+        cls.pod = get_pod(cls.api_client, cls.zone.id, cls.services)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
                                     cls.api_client,
@@ -110,7 +110,25 @@ class TestAttachVolume(cloudstackTestCase):
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-
+        #get max data volumes limit based on the hypervisor type and version
+        listHost = Host.list(
+                             cls.api_client,
+                             hypervisor = cls.services["virtual_machine"]["hypervisor"],
+                             type ='Routing',
+                             zoneid = cls.zone.id,
+                             podid = cls.pod.id,
+                             )
+        ver = listHost[0].hypervisorversion
+        cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
+        cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+        res = cls.api_client.listHypervisorCapabilities(cmd)
+        cls.debug('Hypervisor Capabilities: {}'.format(res))
+        for i in range(len(res)):
+            if res[i].hypervisorversion == ver:
+                break
+        max_data_volumes = int(res[i].maxdatavolumeslimit)
+        cls.debug('max data volumes:{}'.format(max_data_volumes))
+        cls.services["volume"]["max"] = max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
                             cls.api_client,
@@ -368,6 +386,7 @@ class TestAttachDetachVolume(cloudstackTestCase):
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.api_client, cls.services)
         cls.zone = get_zone(cls.api_client, cls.services)
+        cls.pod = get_pod(cls.api_client, cls.zone.id, cls.services)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
                                     cls.api_client,
@@ -381,7 +400,25 @@ class TestAttachDetachVolume(cloudstackTestCase):
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-
+        #get max data volumes limit based on the hypervisor type and version
+        listHost = Host.list(
+                             cls.api_client,
+                             hypervisor = cls.services["virtual_machine"]["hypervisor"],
+                             type ='Routing',
+                             zoneid = cls.zone.id,
+                             podid = cls.pod.id,
+                             )
+        ver = listHost[0].hypervisorversion
+        cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
+        cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+        res = cls.api_client.listHypervisorCapabilities(cmd)
+        cls.debug('Hypervisor Capabilities: {}'.format(res))
+        for i in range(len(res)):
+            if res[i].hypervisorversion == ver:
+                break
+        max_data_volumes = int(res[i].maxdatavolumeslimit)
+        cls.debug('max data volumes:{}'.format(max_data_volumes))
+        cls.services["volume"]["max"] = max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
                             cls.api_client,
@@ -614,6 +651,7 @@ class TestAttachVolumeISO(cloudstackTestCase):
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.api_client, cls.services)
         cls.zone = get_zone(cls.api_client, cls.services)
+        cls.pod = get_pod(cls.api_client, cls.zone.id, cls.services)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
                                     cls.api_client,
@@ -628,14 +666,31 @@ class TestAttachVolumeISO(cloudstackTestCase):
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["iso"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-
+        #get max data volumes limit based on the hypervisor type and version
+        listHost = Host.list(
+                             cls.api_client,
+                             hypervisor = cls.services["virtual_machine"]["hypervisor"],
+                             type ='Routing',
+                             zoneid = cls.zone.id,
+                             podid = cls.pod.id,
+                             )
+        ver = listHost[0].hypervisorversion
+        cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
+        cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+        res = cls.api_client.listHypervisorCapabilities(cmd)
+        cls.debug('Hypervisor Capabilities: {}'.format(res))
+        for i in range(len(res)):
+            if res[i].hypervisorversion == ver:
+                break
+        max_data_volumes = int(res[i].maxdatavolumeslimit)
+        cls.debug('max data volumes:{}'.format(max_data_volumes))
+        cls.services["volume"]["max"] = max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
                             cls.api_client,
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
-
         cls.services["account"] = cls.account.name
         cls.service_offering = ServiceOffering.create(
                                             cls.api_client,


Mime
View raw message