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 1A0B310695 for ; Thu, 18 Jul 2013 09:37:01 +0000 (UTC) Received: (qmail 52944 invoked by uid 500); 18 Jul 2013 09:36:55 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 52861 invoked by uid 500); 18 Jul 2013 09:36:54 -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 52783 invoked by uid 99); 18 Jul 2013 09:36:53 -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, 18 Jul 2013 09:36:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id EE1318AD252; Thu, 18 Jul 2013 09:36:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tsp@apache.org To: commits@cloudstack.apache.org Date: Thu, 18 Jul 2013 09:36:47 -0000 Message-Id: <1a4fc9a3dd7c47a8b5b0c1831427939b@git.apache.org> In-Reply-To: <02306e5c462f4889959474184d85fa21@git.apache.org> References: <02306e5c462f4889959474184d85fa21@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] git commit: updated refs/heads/4.2 to f2d9a7b Delete the affinity group by id and not name Adding some docstrings to the tests so the test runner reports them. 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/296c2f6a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/296c2f6a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/296c2f6a Branch: refs/heads/4.2 Commit: 296c2f6a7018cc6d6ee94262600b71847965cbfd Parents: 8bc3757 Author: Prasanna Santhanam Authored: Thu Jul 18 15:01:32 2013 +0530 Committer: Prasanna Santhanam Committed: Thu Jul 18 15:01:32 2013 +0530 ---------------------------------------------------------------------- .../component/test_affinity_groups.py | 39 ++++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/296c2f6a/test/integration/component/test_affinity_groups.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index be93827..dfef21d 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -163,22 +163,31 @@ class TestCreateAffinityGroup(cloudstackTestCase): domainid = self.domain.id try: - self.aff_grp = AffinityGroup.create(api_client, aff_grp, acc, domainid) + return AffinityGroup.create(api_client, aff_grp, acc, domainid) except Exception as e: raise Exception("Error: Creation of Affinity Group failed : %s" %e) - @attr(tags=["simulator", "basic", "advanced"]) + @attr(tags=["simulator", "basic", "advanced", "needle"]) def test_01_admin_create_aff_grp(self): + """ + Test create affinity group as admin + @return: + """ - self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"]) - self.debug("Created Affinity Group: %s" %self.aff_grp.name) + aff_group = self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"], + acc=self.account.name, domainid=self.account.domainid) + self.debug("Created Affinity Group: %s" % aff_group.name) - list_aff_grps = AffinityGroup.list(self.api_client) - AffinityGroup.delete(self.api_client, list_aff_grps[0].name) - self.debug("Deleted Affinity Group: %s" %list_aff_grps[0].name) + list_aff_grps = AffinityGroup.list(self.api_client, id=aff_group.id) + AffinityGroup.delete(self.api_client, id=list_aff_grps[0].id) + self.debug("Deleted Affinity Group: %s" % list_aff_grps[0].name) @attr(tags=["simulator", "basic", "advanced"]) def test_02_doadmin_create_aff_grp(self): + """ + Test create affinity group as domain admin + @return: + """ self.new_domain = Domain.create(self.api_client, self.services["new_domain"]) self.do_admin = Account.create(self.api_client, self.services["new_account"], @@ -196,6 +205,10 @@ class TestCreateAffinityGroup(cloudstackTestCase): @attr(tags=["simulator", "basic", "advanced"]) def test_03_user_create_aff_grp(self): + """ + Test create affinity group as user + @return: + """ self.user = Account.create(self.api_client, self.services["new_account"], domainid=self.domain.id) @@ -211,6 +224,10 @@ class TestCreateAffinityGroup(cloudstackTestCase): @attr(tags=["simulator", "basic", "advanced"]) def test_04_user_create_aff_grp_existing_name(self): + """ + Test create affinity group that exists (same name) + @return: + """ self.user = Account.create(self.api_client, self.services["new_account"], domainid=self.domain.id) @@ -228,6 +245,10 @@ class TestCreateAffinityGroup(cloudstackTestCase): @attr(tags=["simulator", "basic", "advanced"]) def test_05_create_aff_grp_same_name_diff_acc(self): + """ + Test create affinity group with existing name but within different account + @return: + """ self.user = Account.create(self.api_client, self.services["new_account"], domainid=self.domain.id) @@ -247,6 +268,10 @@ class TestCreateAffinityGroup(cloudstackTestCase): @attr(tags=["simulator", "basic", "advanced"]) def test_06_create_aff_grp_nonexisting_type(self): + """ + Test create affinity group of non-existing type + @return: + """ self.non_existing_aff_grp = { "name": "TestAffGrp_HA",