summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-09-28 11:53:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 07:43:34 +0100
commitdf09a6f4e30ae66db69a3d5e7ce2b5488b68e60b (patch)
tree99907f70a640c11765d4c13198bb9cc3b9131b67 /meta/lib/oeqa/oetest.py
parent7a6cb2ed3a6250d0b3708c46eaef234bd1a55fff (diff)
downloadpoky-df09a6f4e30ae66db69a3d5e7ce2b5488b68e60b.tar.gz
oetest: Change logic of a failed test
Currently the logic to check if a test failed was to check for an exception in the thread, but some decorators used in the syslog runtime test would generate and handle exceptions; this will mess with the current check logic and will dump the host and the target as if the test failed. This patch changes the check logic to verify if the test that just happend is in the failure test list and dump the host and target accordingly. [YOCTO #8406] (From OE-Core rev: 8b97d9320b989023c62db8246f5d8d2126c3723e) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r--meta/lib/oeqa/oetest.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index a7c7203201..e3bbc46905 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -16,8 +16,7 @@ try:
16except ImportError: 16except ImportError:
17 pass 17 pass
18import logging 18import logging
19from oeqa.utils.decorators import LogResults, gettag 19from oeqa.utils.decorators import LogResults, gettag, getResults
20from sys import exc_info, exc_clear
21 20
22logger = logging.getLogger("BitBake") 21logger = logging.getLogger("BitBake")
23 22
@@ -184,17 +183,18 @@ class oeRuntimeTest(oeTest):
184 pass 183 pass
185 184
186 def tearDown(self): 185 def tearDown(self):
187 # If a test fails or there is an exception 186 res = getResults()
188 if not exc_info() == (None, None, None): 187 # If a test fails or there is an exception dump
189 exc_clear() 188 # for QemuTarget only
190 #Only dump for QemuTarget 189 if (type(self.target).__name__ == "QemuTarget" and
191 if (type(self.target).__name__ == "QemuTarget"): 190 (self.id() in res.getErrorList() or
192 self.tc.host_dumper.create_dir(self._testMethodName) 191 self.id() in res.getFailList())):
193 self.tc.host_dumper.dump_host() 192 self.tc.host_dumper.create_dir(self._testMethodName)
194 self.target.target_dumper.dump_target( 193 self.tc.host_dumper.dump_host()
195 self.tc.host_dumper.dump_dir) 194 self.target.target_dumper.dump_target(
196 print ("%s dump data stored in %s" % (self._testMethodName, 195 self.tc.host_dumper.dump_dir)
197 self.tc.host_dumper.dump_dir)) 196 print ("%s dump data stored in %s" % (self._testMethodName,
197 self.tc.host_dumper.dump_dir))
198 198
199 #TODO: use package_manager.py to install packages on any type of image 199 #TODO: use package_manager.py to install packages on any type of image
200 def install_packages(self, packagelist): 200 def install_packages(self, packagelist):