cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [40/48] git commit: updated refs/heads/ui-vm-affinity to 96999be
Date Thu, 11 Apr 2013 22:13:48 GMT
affinitygroup bvt: changes to the bvt for affinity groups

Added tags for the test, base.py extensions for list, craete, delete and
fixes to the test

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/ui-vm-affinity
Commit: 9de7a68e922951d9a92c6f6ac3ae1f06199a943c
Parents: 7201eb9
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Tue Apr 9 16:31:18 2013 +0530
Committer: Prachi Damle <prachi@cloud.com>
Committed: Thu Apr 11 13:23:39 2013 -0700

----------------------------------------------------------------------
 test/integration/smoke/test_affinity_groups.py |   23 +++++++++--------
 tools/marvin/marvin/integration/lib/base.py    |   25 +++++++++++-------
 2 files changed, 27 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9de7a68e/test/integration/smoke/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py
index 0d06e64..832c4a4 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -52,12 +52,12 @@ class Services:
                 # In MBs
             },
             "ostype": 'CentOS 5.3 (64-bit)',
-            "mode": 'advanced',
             "virtual_machine" : {
                 "affinity": {
                     "name": "webvms",
                     "type": "host anti-affinity",
-                }
+                },
+                "hypervisor" : "XenServer",
             }
         }
 
@@ -98,19 +98,22 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             cls.services["service_offering"]
         )
 
-        cls.ag = AffinityGroup.create(cls.api_client, cls.services["virtual_machine"]["affinity"],
domainid=cls.domain.id)
+        cls.ag = AffinityGroup.create(cls.api_client, cls.services["virtual_machine"]["affinity"],
+            account=cls.services["account"], domainid=cls.domain.id)
 
         cls._cleanup = [
             cls.service_offering,
-            cls.disk_offering,
             cls.account,
         ]
         return
 
-    @attr(tags=["simulator", "basic", "advanced"])
+    @attr(tags=["simulator", "basic", "advanced", "multihost"])
     def test_DeployVmAntiAffinityGroup(self):
         """
-        Deploys a couple of VMs in the same affinity group and verifies they are not on the
same host
+        test DeployVM in anti-affinity groups
+
+        deploy VM1 and VM2 in the same host-anti-affinity groups
+        Verify that the vms are deployed on separate hosts
         """
         #deploy VM1 in affinity group created in setUp
         vm1 = VirtualMachine.create(
@@ -120,8 +123,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             accountid=self.account.account.name,
             domainid=self.account.account.domainid,
             serviceofferingid=self.service_offering.id,
-            affinitygroupnames=self.ag.name,
-            mode=self.services["mode"]
+            affinitygroupnames=[self.ag.name]
         )
 
         list_vm1 = list_virtual_machines(
@@ -154,12 +156,11 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             accountid=self.account.account.name,
             domainid=self.account.account.domainid,
             serviceofferingid=self.service_offering.id,
-            affinitygroupnames=self.ag.name,
-            mode=self.services["mode"]
+            affinitygroupnames=[self.ag.name]
         )
         list_vm2 = list_virtual_machines(
             self.api_client,
-            id=self.vm1.id
+            id=vm2.id
         )
         self.assertEqual(
             isinstance(list_vm2, list),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9de7a68e/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 8c7470e..d27ab3b 100644
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -90,10 +90,7 @@ class Account:
         cmd.firstname = services["firstname"]
         cmd.lastname = services["lastname"]
 
-        # Password Encoding
-        mdf = hashlib.md5()
-        mdf.update(services["password"])
-        cmd.password = mdf.hexdigest()
+        cmd.password = services["password"]
         cmd.username = "-".join([services["username"], random_gen()])
 
         if domainid:
@@ -223,7 +220,7 @@ class VirtualMachine:
     def create(cls, apiclient, services, templateid=None, accountid=None,
                     domainid=None, zoneid=None, networkids=None, serviceofferingid=None,
                     securitygroupids=None, projectid=None, startvm=None,
-                    diskofferingid=None, affinitygroupname=None, hostid=None, mode='basic'):
+                    diskofferingid=None, affinitygroupnames=None, hostid=None, mode='basic'):
         """Create the instance"""
 
         cmd = deployVirtualMachine.deployVirtualMachineCmd()
@@ -270,6 +267,8 @@ class VirtualMachine:
 
         if "affinitygroupnames" in services:
             cmd.affinitygroupnames  = services["affinitygroupnames"]
+        elif affinitygroupnames:
+            cmd.affinitygroupnames  = affinitygroupnames
 
         if projectid:
             cmd.projectid = projectid
@@ -2441,13 +2440,19 @@ class AffinityGroup:
         agCmd.type = services['type']
         agCmd.account = services['account'] if 'account' in services else account
         agCmd.domainid = services['domainid'] if 'domainid' in services else domainid
+        return AffinityGroup(apiclient.createAffinityGroup(agCmd).__dict__)
 
-    def update(self):
+    def update(self, apiclient):
         pass
 
-    def delete(self):
-        pass
+    def delete(self, apiclient):
+        cmd = deleteAffinityGroup.deleteAffinityGroupCmd()
+        cmd.id = self.id
+        return apiclient.deleteVPC(cmd)
+
 
     @classmethod
-    def list(cls):
-        pass
\ No newline at end of file
+    def list(cls, apiclient, **kwargs):
+        cmd = listAffinityGroups.listAffinityGroupsCmd()
+        [setattr(cmd, k, v) for k, v in kwargs.items()]
+        return(apiclient.listVPCs(cmd))


Mime
View raw message