summaryrefslogtreecommitdiff
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:40:22 +0100
commit8b97d9320b989023c62db8246f5d8d2126c3723e (patch)
treeed84297a2f5e5849ae35924cdf64978ae1720ab3
parentbc4dfe74ecd8d4f233baf16325dae31972da269a (diff)
downloadopenembedded-core-8b97d9320b989023c62db8246f5d8d2126c3723e.tar.gz
openembedded-core-8b97d9320b989023c62db8246f5d8d2126c3723e.tar.bz2
openembedded-core-8b97d9320b989023c62db8246f5d8d2126c3723e.zip
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] 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>
-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:
except ImportError:
pass
import logging
-from oeqa.utils.decorators import LogResults, gettag
-from sys import exc_info, exc_clear
+from oeqa.utils.decorators import LogResults, gettag, getResults
logger = logging.getLogger("BitBake")
@@ -184,17 +183,18 @@ class oeRuntimeTest(oeTest):
pass
def tearDown(self):
- # If a test fails or there is an exception
- if not exc_info() == (None, None, None):
- exc_clear()
- #Only dump for QemuTarget
- if (type(self.target).__name__ == "QemuTarget"):
- self.tc.host_dumper.create_dir(self._testMethodName)
- self.tc.host_dumper.dump_host()
- self.target.target_dumper.dump_target(
- self.tc.host_dumper.dump_dir)
- print ("%s dump data stored in %s" % (self._testMethodName,
- self.tc.host_dumper.dump_dir))
+ res = getResults()
+ # If a test fails or there is an exception dump
+ # for QemuTarget only
+ if (type(self.target).__name__ == "QemuTarget" and
+ (self.id() in res.getErrorList() or
+ self.id() in res.getFailList())):
+ self.tc.host_dumper.create_dir(self._testMethodName)
+ self.tc.host_dumper.dump_host()
+ self.target.target_dumper.dump_target(
+ self.tc.host_dumper.dump_dir)
+ print ("%s dump data stored in %s" % (self._testMethodName,
+ self.tc.host_dumper.dump_dir))
#TODO: use package_manager.py to install packages on any type of image
def install_packages(self, packagelist):