Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A7FAF13D for ; Thu, 11 Apr 2013 22:13:16 +0000 (UTC) Received: (qmail 95455 invoked by uid 500); 11 Apr 2013 22:13:11 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 95393 invoked by uid 500); 11 Apr 2013 22:13:11 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 94847 invoked by uid 99); 11 Apr 2013 22:13:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Apr 2013 22:13:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DBA7D880EC6; Thu, 11 Apr 2013 22:13:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: commits@cloudstack.apache.org Date: Thu, 11 Apr 2013 22:13:48 -0000 Message-Id: <7421fb2ec31a403bb4a8cd9ae879f581@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [40/48] git commit: updated refs/heads/ui-vm-affinity to 96999be 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 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 Authored: Tue Apr 9 16:31:18 2013 +0530 Committer: Prachi Damle 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))