rahulbcn27 commented on code in PR #7149:
URL: https://github.com/apache/cloudstack/pull/7149#discussion_r1104158446
##########
test/integration/smoke/test_projects.py:
##########
@@ -1820,3 +1820,159 @@ def test_10_project_activation(self):
"VM should be in Running state after project activation"
)
return
+
+class TestProjectUpdateName(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.testClient = super(
+ TestProjectUpdateName,
+ cls).getClsTestClient()
+ cls.api_client = cls.testClient.getApiClient()
+
+ cls.services = Services().services
+ # Get Zone
+ cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+ cls.hypervisor = cls.testClient.getHypervisorInfo()
+ cls.domain = get_domain(cls.api_client)
+ cls.services['mode'] = cls.zone.networktype
+ cls.template = get_test_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.hypervisor
+ )
+ cls._cleanup = []
+ cls.isGlobalSettingInvalid = False
+ configs = Configurations.list(
+ cls.api_client,
+ name='project.invite.required'
+ )
+
+ if (configs[0].value).lower() != 'false':
+ cls.isGlobalSettingInvalid = True
+ return
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ admin=True,
+ domainid=cls.domain.id
+ )
+ cls._cleanup.append(cls.account)
+ cls.user = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ admin=True,
+ domainid=cls.domain.id
+ )
+ cls._cleanup.append(cls.user)
+
+ # Create project as a domain admin
+ cls.project = Project.create(
+ cls.api_client,
+ cls.services["project"],
+ account=cls.account.name,
+ domainid=cls.account.domainid
+ )
+ cls._cleanup.append(cls.project)
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+ return
+
+ @classmethod
+ def tearDownClass(cls):
+ try:
+ # Cleanup resources used
+ cleanup_resources(cls.api_client, reversed(cls._cleanup))
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.cleanup = []
+
+ if self.isGlobalSettingInvalid:
+ self.skipTest("'project.invite.required' should be set to false")
+ return
+
+ def tearDown(self):
+ try:
+ # Clean up, terminate the created accounts, domains etc
+ cleanup_resources(self.apiclient, reversed(self.cleanup))
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+ return
Review Comment:
Fixed.
##########
test/integration/smoke/test_projects.py:
##########
@@ -1820,3 +1820,159 @@ def test_10_project_activation(self):
"VM should be in Running state after project activation"
)
return
+
+class TestProjectUpdateName(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.testClient = super(
+ TestProjectUpdateName,
+ cls).getClsTestClient()
+ cls.api_client = cls.testClient.getApiClient()
+
+ cls.services = Services().services
+ # Get Zone
+ cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+ cls.hypervisor = cls.testClient.getHypervisorInfo()
+ cls.domain = get_domain(cls.api_client)
+ cls.services['mode'] = cls.zone.networktype
+ cls.template = get_test_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.hypervisor
+ )
+ cls._cleanup = []
+ cls.isGlobalSettingInvalid = False
+ configs = Configurations.list(
+ cls.api_client,
+ name='project.invite.required'
+ )
+
+ if (configs[0].value).lower() != 'false':
+ cls.isGlobalSettingInvalid = True
+ return
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ admin=True,
+ domainid=cls.domain.id
+ )
+ cls._cleanup.append(cls.account)
+ cls.user = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ admin=True,
+ domainid=cls.domain.id
+ )
+ cls._cleanup.append(cls.user)
+
+ # Create project as a domain admin
+ cls.project = Project.create(
+ cls.api_client,
+ cls.services["project"],
+ account=cls.account.name,
+ domainid=cls.account.domainid
+ )
+ cls._cleanup.append(cls.project)
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+ return
+
+ @classmethod
+ def tearDownClass(cls):
+ try:
+ # Cleanup resources used
+ cleanup_resources(cls.api_client, reversed(cls._cleanup))
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+ return
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]