You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2016/02/10 06:28:02 UTC

[1/2] git commit: updated refs/heads/master to f61f23c

Repository: cloudstack
Updated Branches:
  refs/heads/master 7017a829e -> f61f23c7f


CLOUDSTACK-8895: Verify if storage can be selected when attaching uploaded data volume to VM


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

Branch: refs/heads/master
Commit: e13352928940792df255995aa1e9069322906978
Parents: a527d27
Author: Priti Sarap <pr...@clogeny.com>
Authored: Tue Sep 22 13:11:44 2015 +0530
Committer: Priti Sarap <pr...@clogeny.com>
Committed: Tue Sep 22 13:17:10 2015 +0530

----------------------------------------------------------------------
 .../testpaths/testpath_attach_disk_zwps.py      | 188 ++++++++++++++++++-
 1 file changed, 187 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e1335292/test/integration/testpaths/testpath_attach_disk_zwps.py
----------------------------------------------------------------------
diff --git a/test/integration/testpaths/testpath_attach_disk_zwps.py b/test/integration/testpaths/testpath_attach_disk_zwps.py
index d386438..1f1e073 100644
--- a/test/integration/testpaths/testpath_attach_disk_zwps.py
+++ b/test/integration/testpaths/testpath_attach_disk_zwps.py
@@ -34,7 +34,8 @@ from marvin.lib.common import (get_domain,
                                )
 
 from marvin.codes import (PASS,
-                          ZONETAG1)
+                          ZONETAG1,
+                          CLUSTERTAG1)
 
 
 class TestAttachDataDisk(cloudstackTestCase):
@@ -207,3 +208,188 @@ class TestAttachDataDisk(cloudstackTestCase):
             "Check: Data if Disk is attached to VM")
 
         return
+
+
+class TestAttachDataDiskOnCWPS(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        testClient = super(TestAttachDataDiskOnCWPS, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.testdata = testClient.getParsedTestDataConfig()
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
+        cls._cleanup = []
+        cls.template = get_template(
+            cls.apiclient,
+            cls.zone.id,
+            cls.testdata["ostype"])
+        cls.skiptest = False
+
+        try:
+            cls.pools = StoragePool.list(
+                cls.apiclient,
+                zoneid=cls.zone.id,
+                scope="CLUSTER")
+        except Exception as e:
+            cls.skiptest = True
+            return
+        try:
+
+            # Create an account
+            cls.account = Account.create(
+                cls.apiclient,
+                cls.testdata["account"],
+                domainid=cls.domain.id
+            )
+            cls._cleanup.append(cls.account)
+
+            # Create user api client of the account
+            cls.userapiclient = testClient.getUserApiClient(
+                UserName=cls.account.name,
+                DomainName=cls.account.domain
+            )
+            # Create Service offering
+            cls.service_offering = ServiceOffering.create(
+                cls.apiclient,
+                cls.testdata["service_offering"],
+            )
+            cls._cleanup.append(cls.service_offering)
+
+            # Create Disk offering
+            cls.disk_offering = DiskOffering.create(
+                cls.apiclient,
+                cls.testdata["disk_offering"],
+                custom=True,
+                tags=CLUSTERTAG1,
+            )
+
+            cls._cleanup.append(cls.disk_offering)
+
+        except Exception as e:
+            cls.tearDownClass()
+            raise e
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            cleanup_resources(cls.apiclient, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+
+    def tearDown(self):
+        try:
+            for storagePool in self.pools:
+                StoragePool.update(self.apiclient, id=storagePool.id, tags="")
+
+            if hasattr(self, "data_volume_created"):
+                data_volumes_list = Volume.list(
+                    self.userapiclient,
+                    id=self.data_volume_created.id,
+                    virtualmachineid=self.vm.id
+                )
+                if data_volumes_list:
+                    self.vm.detach_volume(
+                        self.userapiclient,
+                        data_volumes_list[0]
+                    )
+
+                status = validateList(data_volumes_list)
+                self.assertEqual(
+                    status[0],
+                    PASS,
+                    "DATA Volume List Validation Failed")
+
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    @attr(tags=["basic", "advanced"], required_hardware="true")
+    def test_01_attach_datadisk_to_vm_on_zwps(self):
+        """ Attach Data Disk on CWPS To VM 
+            1.  Check if zwps storage pool exists.
+            2.  Adding tag to zone wide primary storage
+            3.  Launch a VM
+            4.  Attach data disk to vm.
+            5.  Verify disk is attached and in correct storage pool.
+        """
+
+        # Step 1
+        if len(list(self.pools)) < 1:
+            self.skipTest("There must be at least one zone wide \
+                storage pools available in the setup")
+
+        # Step 2
+        # Adding tags to Storage Pools
+        StoragePool.update(
+            self.apiclient,
+            id=self.pools[0].id,
+            tags=[CLUSTERTAG1])
+
+        # Launch VM
+        self.vm = VirtualMachine.create(
+            self.apiclient,
+            self.testdata["small"],
+            templateid=self.template.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_zone1.id,
+            zoneid=self.zone.id
+        )
+
+        self.testdata["volume"]["zoneid"] = self.zone.id
+        self.testdata["volume"]["customdisksize"] = 1
+        self.data_volume_created = Volume.create_custom_disk(
+            self.userapiclient,
+            self.testdata["volume"],
+            account=self.account.name,
+            domainid=self.account.domainid,
+            diskofferingid=self.disk_offering.id,
+        )
+
+        self.cleanup.append(self.data_volume_created)
+
+        # Step 4
+        self.vm.attach_volume(
+            self.userapiclient,
+            self.data_volume_created
+        )
+
+        data_volumes_list = Volume.list(
+            self.userapiclient,
+            virtualmachineid=self.vm.id,
+            type="DATA",
+            listall=True
+        )
+
+        self.debug("list volumes using vm id %s" % dir(data_volumes_list[0]))
+
+        data_volumes_list = Volume.list(self.apiclient,
+                                        id=self.data_volume_created.id,
+                                        listall=True)
+        data_volume = data_volumes_list[0]
+        status = validateList(data_volume)
+        # Step 5
+        self.assertEqual(
+            status[0],
+            PASS,
+            "Check: volume list is valid")
+
+        self.assertEqual(
+            data_volume.state,
+            "Ready",
+            "Check: Data volume is attached to VM")
+
+        if data_volume.storage != self.pools[0].name:
+            self.fail("check if volume is created in correct storage pool")
+        return


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

Posted by sa...@apache.org.
Merge pull request #869 from pritisarap12/CLOUDSTACK-8895-Verify-if-storage-can-be-selected-when-attaching-uploaded-data-volume-to-VM

CLOUDSTACK-8895: Verify if storage on storage pool can be attached to VMTest case to verify if data volume uploaded in a storage pool(Cluster wide storage pool) is available for attachment to a Virtual Machine.and also check that after attachment the volume is in correct storage pool.

* pr/869:
  CLOUDSTACK-8895: Verify if storage can be selected when attaching uploaded data volume to VM

Signed-off-by: sanjeev <sa...@apache.org>


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

Branch: refs/heads/master
Commit: f61f23c7fa2c815c22968a5c6108c6fdd184791c
Parents: 7017a82 e133529
Author: sanjeev <sa...@apache.org>
Authored: Wed Feb 10 10:57:16 2016 +0530
Committer: sanjeev <sa...@apache.org>
Committed: Wed Feb 10 10:57:19 2016 +0530

----------------------------------------------------------------------
 .../testpaths/testpath_attach_disk_zwps.py      | 188 ++++++++++++++++++-
 1 file changed, 187 insertions(+), 1 deletion(-)
----------------------------------------------------------------------