cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sangeet...@apache.org
Subject git commit: updated refs/heads/master to b0d74ad
Date Tue, 02 Dec 2014 22:02:33 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 6b4271b75 -> b0d74ad6f


CLOUDSTACK-7996: Fixed the script test_tags.py - Tags and Template should belong to the User
Account to test the case


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

Branch: refs/heads/master
Commit: b0d74ad6fc68fd7022ec6cf378736430f0908a75
Parents: 6b4271b
Author: Chandan Purushothama <Chandan.Purushothama@citrix.com>
Authored: Mon Dec 1 14:33:29 2014 -0800
Committer: Sangeetha Hariharan <sangeetha.hariharan@citrix.com>
Committed: Tue Dec 2 16:48:20 2014 -0800

----------------------------------------------------------------------
 test/integration/component/test_tags.py | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0d74ad6/test/integration/component/test_tags.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_tags.py b/test/integration/component/test_tags.py
index c5a8ced..2a31ba3 100644
--- a/test/integration/component/test_tags.py
+++ b/test/integration/component/test_tags.py
@@ -212,6 +212,12 @@ class TestResourceTags(cloudstackTestCase):
                             cls.services["account"],
                             admin=True,
                             )
+        
+        cls.user_api_client = cls.testClient.getUserApiClient(
+                UserName=cls.account.name,
+                DomainName=cls.account.domain
+            )
+        
         # Create service offerings, disk offerings etc
         cls.service_offering = ServiceOffering.create(
                                     cls.api_client,
@@ -943,14 +949,14 @@ class TestResourceTags(cloudstackTestCase):
         try:
             self.debug("Stopping the virtual machine: %s" % self.vm_1.name)
             #Stop virtual machine
-            self.vm_1.stop(self.apiclient)
+            self.vm_1.stop(self.user_api_client)
         except Exception as e:
             self.fail("Failed to stop VM: %s" % e)
 
         timeout = self.services["timeout"]
         while True:
             list_volume = Volume.list(
-                                   self.apiclient,
+                                   self.user_api_client,
                                    virtualmachineid=self.vm_1.id,
                                    type='ROOT',
                                    listall=True
@@ -969,18 +975,18 @@ class TestResourceTags(cloudstackTestCase):
                                                             self.vm_1.name)
         #Create template from volume
         template = Template.create(
-                                    self.apiclient,
+                                    self.user_api_client,
                                     self.services["template"],
                                     self.volume.id
                                 )
         self.cleanup.append(template)
         self.debug("Created the template(%s). Now restarting the userVm: %s" %
                                             (template.name, self.vm_1.name))
-        self.vm_1.start(self.apiclient)
+        self.vm_1.start(self.user_api_client)
 
         self.debug("Creating a tag for the template")
         tag = Tag.create(
-                         self.apiclient,
+                         self.user_api_client,
                          resourceIds=template.id,
                          resourceType='Template',
                          tags={'OS': 'CentOS'}
@@ -988,11 +994,9 @@ class TestResourceTags(cloudstackTestCase):
         self.debug("Tag created: %s" % tag.__dict__)
 
         tags = Tag.list(
-                        self.apiclient,
+                        self.user_api_client,
                         listall=True,
                         resourceType='Template',
-                        account=self.account.name,
-                        domainid=self.account.domainid,
                         key='OS',
                         value='CentOS'
                         )
@@ -1008,7 +1012,7 @@ class TestResourceTags(cloudstackTestCase):
                          )
 
         Template.list(
-                  self.apiclient,
+                  self.user_api_client,
                   templatefilter=\
                   self.services["template"]["templatefilter"],
                   listall=True,
@@ -1019,7 +1023,7 @@ class TestResourceTags(cloudstackTestCase):
         self.debug("Deleting the created tag..")
         try:
             tag.delete(
-                       self.apiclient,
+                       self.user_api_client,
                        resourceIds=template.id,
                        resourceType='Template',
                        tags={'OS': 'CentOS'}
@@ -1029,11 +1033,9 @@ class TestResourceTags(cloudstackTestCase):
 
         self.debug("Verifying if tag is actually deleted!")
         tags = Tag.list(
-                        self.apiclient,
+                        self.user_api_client,
                         listall=True,
                         resourceType='Template',
-                        account=self.account.name,
-                        domainid=self.account.domainid,
                         key='OS',
                         value='CentOS'
                         )


Mime
View raw message