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 C227210E38 for ; Thu, 13 Mar 2014 23:55:57 +0000 (UTC) Received: (qmail 24622 invoked by uid 500); 13 Mar 2014 23:55:13 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 24442 invoked by uid 500); 13 Mar 2014 23:55:10 -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 23876 invoked by uid 99); 13 Mar 2014 23:54:56 -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, 13 Mar 2014 23:54:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 47F0498077B; Thu, 13 Mar 2014 23:54:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Date: Thu, 13 Mar 2014 23:55:19 -0000 Message-Id: In-Reply-To: <12b9daed0a9e4902903d5ca04a968f98@git.apache.org> References: <12b9daed0a9e4902903d5ca04a968f98@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/50] [abbrv] git commit: updated refs/heads/master to 8ff9460 List VM marvin test fix. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/91882e26 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/91882e26 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/91882e26 Branch: refs/heads/master Commit: 91882e26bffc15a2f6ea630492acd4c8f5e58dd4 Parents: 61b4785 Author: Min Chen Authored: Mon Mar 3 17:25:22 2014 -0800 Committer: Min Chen Committed: Mon Mar 3 17:26:16 2014 -0800 ---------------------------------------------------------------------- test/integration/smoke/test_vm_iam.py | 46 +++++++++++++----------- tools/marvin/marvin/integration/lib/base.py | 2 +- 2 files changed, 26 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91882e26/test/integration/smoke/test_vm_iam.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_iam.py b/test/integration/smoke/test_vm_iam.py index 89e1c1c..11dffe2 100644 --- a/test/integration/smoke/test_vm_iam.py +++ b/test/integration/smoke/test_vm_iam.py @@ -106,7 +106,7 @@ class TestVMIam(cloudstackTestCase): self.apiclient = super(TestVMIam, self).getClsTestClient().getApiClient() self.services = Services().services - # backup default apikey and secretkey + # backup default apikey and secretkey self.default_apikey = self.apiclient.connection.apiKey self.default_secretkey = self.apiclient.connection.securityKey @@ -236,6 +236,10 @@ class TestVMIam(cloudstackTestCase): self.services["vm_readonly_iam_policy"] ) + self.srv_desk_grp.attachPolicy( + self.apiclient, [self.vm_read_policy] + ) + vm_grant_policy_params = {} vm_grant_policy_params['name'] = "policyGrantVirtualMachine" + self.virtual_machine_1A.id vm_grant_policy_params['description'] = "Policy to grant permission to VirtualMachine " + self.virtual_machine_1A.id @@ -255,7 +259,7 @@ class TestVMIam(cloudstackTestCase): self.srv_desk_grp, self.vm_grant_policy ] - + @classmethod def tearDownClass(self): self.apiclient = super(TestVMIAM, self).getClsTestClient().getApiClient() @@ -275,6 +279,7 @@ class TestVMIam(cloudstackTestCase): return + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"]) def test_01_list_own_vm(self): # listVM command should return owne's VM @@ -291,9 +296,9 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), - 0, + 1, "Check VM available in List Virtual Machines" ) @@ -314,9 +319,9 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), - 0, + 1, "Check VM available in List Virtual Machines" ) @@ -338,9 +343,9 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), - 0, + 1, "Check VM available in List Virtual Machines" ) @@ -351,7 +356,6 @@ class TestVMIam(cloudstackTestCase): ) return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"]) def test_02_grant_domain_vm(self): @@ -381,7 +385,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 2, "Check VM available in List Virtual Machines" @@ -429,7 +433,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 3, "Check VM available in List Virtual Machines" @@ -482,7 +486,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 2, "Check VM available in List Virtual Machines" @@ -525,7 +529,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 1, "Check VM available in List Virtual Machines" @@ -533,7 +537,7 @@ class TestVMIam(cloudstackTestCase): self.assertEqual( list_vm_response[0].name, - self.virtual_machine_2A.name, + self.virtual_machine_1B.name, "Virtual Machine names do not match" ) @@ -566,7 +570,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 2, "Check VM available in List Virtual Machines" @@ -613,7 +617,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 1, "Check VM available in List Virtual Machines" @@ -621,7 +625,7 @@ class TestVMIam(cloudstackTestCase): self.assertEqual( list_vm_response[0].name, - self.virtual_machine_2A.name, + self.virtual_machine_1B.name, "Virtual Machine names do not match" ) @@ -656,7 +660,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 2, "Check VM available in List Virtual Machines" @@ -683,7 +687,7 @@ class TestVMIam(cloudstackTestCase): # 1. Revoking a particular vm access from account_1B by detaching policy from account # 2. listVM command should return account_1B VMs. - self.debug("Revoking VM %s read only access from account: %s by attaching policy to account" % (self.virtual_machine_1A.name, self.account_1B.name)) + self.debug("Revoking VM %s read only access from account: %s by detaching policy from account" % (self.virtual_machine_1A.name, self.account_1B.name)) self.vm_grant_policy.detachAccount(self.apiclient, [self.account_1B]) @@ -698,7 +702,7 @@ class TestVMIam(cloudstackTestCase): True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertEqual( len(list_vm_response), 1, "Check VM available in List Virtual Machines" @@ -706,7 +710,7 @@ class TestVMIam(cloudstackTestCase): self.assertEqual( list_vm_response[0].name, - self.virtual_machine_2A.name, + self.virtual_machine_1B.name, "Virtual Machine names do not match" ) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91882e26/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 15f59ca..d281f7b 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -3733,7 +3733,7 @@ class IAMPolicy: cmd.entitytype = permission['entitytype'] cmd.scope = permission['scope'] cmd.scopeid = permission['scopeid'] - apiclient.addIAMPermissionToIAMPolicy(cmd) + apiclient.removeIAMPermissionFromIAMPolicy(cmd) return def attachAccount(self, apiclient, accts):