cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject [43/50] [abbrv] git commit: updated refs/heads/ldapplugin to 7bc705e
Date Wed, 17 Jul 2013 17:35:42 GMT
CLOUDSTACK-2273: cleanup using user api client for domain admins

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/9f9510be
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9f9510be
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9f9510be

Branch: refs/heads/ldapplugin
Commit: 9f9510be9189346ed72ff92705d284de91d53c6f
Parents: cfd892f
Author: ashutoshkelkar <ashutosh@clogeny.com>
Authored: Wed Jul 17 15:26:34 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed Jul 17 19:23:57 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_assign_vm.py | 29 +++++++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f9510be/test/integration/component/test_assign_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_assign_vm.py b/test/integration/component/test_assign_vm.py
index 8bc98fe..55c174b 100644
--- a/test/integration/component/test_assign_vm.py
+++ b/test/integration/component/test_assign_vm.py
@@ -353,8 +353,11 @@ class TestVMOwnership(cloudstackTestCase):
         # 1. deploy VM in sub subdomain1
         # 2. stop VM in sub subdomain1
         # 3. assignVirtualMachine to subdomain2
+        userapiclient = self.testClient.getUserApiClient(account=self.sdomain_account_user1['account'].name,
+                                                         domain=self.sdomain_account_user1['domain'].name,
+                                                         type=2)
         self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'])
-        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, userapiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
 
     @attr(tags = ["advanced"])
     @log_test_exceptions
@@ -386,8 +389,11 @@ class TestVMOwnership(cloudstackTestCase):
         # Validate the following:
         # 1. deploy VM in sub subdomain1 with volumes.
         # 3. assignVirtualMachine to subdomain2
+        userapiclient = self.testClient.getUserApiClient(account=self.sdomain_account_user1['account'].name,
+                                                         domain=self.sdomain_account_user1['domain'].name,
+                                                         type=2)
         self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],volume=self.sdomain_account_user1['volume'])
-        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, userapiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
          # Check all volumes attached to same VM
         list_volume_response = list_volumes(self.apiclient,
                                             virtualmachineid=self.virtual_machine.id,
@@ -398,6 +404,8 @@ class TestVMOwnership(cloudstackTestCase):
                          "Check list volumes response for valid list")
 
         self.assertNotEqual(list_volume_response[0].domainid, self.sdomain_account_user2['domain'].id,
"Volume ownership not changed.")
+        self.virtual_machine.detach_volume(self.apiclient,
+                                           self.sdomain_account_user1['volume'])
 
     @attr(tags = ["advanced"])
     @log_test_exceptions
@@ -423,8 +431,11 @@ class TestVMOwnership(cloudstackTestCase):
         # Validate the following:
         # 1. deploy VM in sub subdomain1 with snapshot.
         # 3. assignVirtualMachine to subdomain2
+        userapiclient = self.testClient.getUserApiClient(account=self.sdomain_account_user1['account'].name,
+                                                         domain=self.sdomain_account_user1['domain'].name,
+                                                         type=2)
         self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],
project=self.sdomain_account_user1['project'])
-        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, userapiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
 
     @attr(tags = ["advanced"])
     @log_test_exceptions
@@ -439,8 +450,11 @@ class TestVMOwnership(cloudstackTestCase):
                               account=self.sdomain_account_user2['account'].name,
                               domainid=self.sdomain_account_user2['domain'].id,
                               max=0)
+        userapiclient = self.testClient.getUserApiClient(account=self.sdomain_account_user1['account'].name,
+                                                         domain=self.sdomain_account_user1['domain'].name,
+                                                         type=2)
         self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],
snapshot=True)
-        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, userapiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
 
     @attr(tags = ["advanced"])
     @log_test_exceptions
@@ -456,5 +470,10 @@ class TestVMOwnership(cloudstackTestCase):
                               account=self.sdomain_account_user2['account'].name,
                               domainid=self.sdomain_account_user2['domain'].id,
                               max=0)
+        userapiclient = self.testClient.getUserApiClient(account=self.sdomain_account_user1['account'].name,
+                                                         domain=self.sdomain_account_user1['domain'].name,
+                                                         type=2)
         self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],
snapshot=True, volume=self.sdomain_account_user1['volume'])
-        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, userapiclient,
self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id)
+        self.virtual_machine.detach_volume(self.apiclient,
+                                            self.sdomain_account_user1['volume'])


Mime
View raw message