You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/01/20 06:58:05 UTC
[09/12] git commit: updated refs/heads/4.5 to 30598e9
CLOUDSTACK-7996: Fixed the script test_tags.py - Tags and Template should belong to the User Account to test the case
(cherry picked from commit b0d74ad6fc68fd7022ec6cf378736430f0908a75)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1b7a1006
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1b7a1006
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1b7a1006
Branch: refs/heads/4.5
Commit: 1b7a10068877c7bcd997029c5ef3ba8884d49f18
Parents: 535c037
Author: Chandan Purushothama <Ch...@citrix.com>
Authored: Mon Dec 1 14:33:29 2014 -0800
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 20 10:29:41 2015 +0530
----------------------------------------------------------------------
test/integration/component/test_tags.py | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1b7a1006/test/integration/component/test_tags.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_tags.py b/test/integration/component/test_tags.py
index 824cf01..2b05fbb 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'
)