From 77aa85d257fea40902c2475008f4b361e69e662b Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Mon, 22 Jul 2013 12:15:12 +0530 Subject: [PATCH] CLOUDSTACK-3075: append module/suite name If the test doesn't create the account within the testXxx method we miss the trail of the accountname because the setUpClass() created the account. Append the module name in advance in such cases to identify the account that was created in the suite before any tests were executed. Signed-off-by: Prasanna Santhanam --- tools/marvin/marvin/marvinPlugin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index a0ec3d5eb20..19930d43186 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -110,12 +110,16 @@ class MarvinPlugin(Plugin): return self.testrunner def wantClass(self, cls): + if cls.__name__ == 'cloudstackTestCase': + return False if issubclass(cls, cloudstackTestCase): return True return None def loadTestsFromTestCase(self, cls): - self._injectClients(cls) + if cls.__name__ != 'cloudstackTestCase': + self.testclient.identifier = cls.__name__ + self._injectClients(cls) def setClient(self, client): if client is not None: @@ -126,11 +130,14 @@ class MarvinPlugin(Plugin): self.config = config def beforeTest(self, test): - self.testclient.identifier = test.__str__().split()[0] + testname = test.__str__().split()[0] + self.testclient.identifier = '-'.join([self.testclient.identifier, testname]) def _injectClients(self, test): testcaselogger = logging.getLogger("testclient.testcase.%s" % test.__name__) + + self.debug_stream. \ setFormatter(logging. Formatter("%(asctime)s - %(levelname)s - %(name)s" +