diff --git a/test/integration/component/test_snapshots_improvement.py b/test/integration/component/test_snapshots_improvement.py index 1646b69e051..6638dddf035 100644 --- a/test/integration/component/test_snapshots_improvement.py +++ b/test/integration/component/test_snapshots_improvement.py @@ -615,8 +615,13 @@ class TestCreateSnapshot(cloudstackTestCase): self.debug("Create a template from snapshot: %s" % snapshot.name) jobs.append(self.create_Template_from_Snapshot(snapshot)) + + userapiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain) + # Verify IO usage by submitting the concurrent jobs - self.testClient.submitCmdsAndWait(jobs) + self.testClient.submitCmdsAndWait(jobs, apiclient=userapiclient) self.debug("Verifying if templates are created properly or not?") templates = Template.list( diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 521d043009f..ce7ffc9b509 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -417,12 +417,14 @@ class CSTestClient(object): return FAILED return self.__createUserApiClient(UserName, DomainName, type) - def submitCmdsAndWait(self, cmds, workers=1): + def submitCmdsAndWait(self, cmds, workers=1, apiclient=None): ''' @Desc : FixME, httplib has issue if more than one thread submitted ''' + if not apiclient: + apiclient = self.__apiClient if self.__asyncJobMgr is None: - self.__asyncJobMgr = asyncJobMgr(self.__apiClient, + self.__asyncJobMgr = asyncJobMgr(apiclient, self.__dbConnection) return self.__asyncJobMgr.submitCmdsAndWait(cmds, workers)