]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/decorators: Fixed a problem with decorator logs link.
authorLucian Musat <george.l.musat@intel.com>
Tue, 29 Sep 2015 11:52:57 +0000 (14:52 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Sep 2015 14:15:48 +0000 (15:15 +0100)
When not doing actual tests with testimage, like for example
exporting tests, the link to the log file was still created
although the actual log file was not existent. Fixed it by
moving the link creation part into the run() method.

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/decorators.py

index 7116208380dbc8dc65f97763a8911318eb01dde8..7a86970873515ae6bf2b7a53765503a3c671d799 100644 (file)
@@ -167,14 +167,12 @@ def LogResults(original_class):
         if passed:
             local_log.results("Testcase "+str(test_case)+": PASSED")
 
-    original_class.run = run
-
-    # Create symlink to the current log
-    if os.path.islink(linkfile):
-        os.unlink(linkfile)
-    elif os.path.isfile(linkfile):
+        # Create symlink to the current log
+        if os.path.exists(linkfile):
             os.remove(linkfile)
-    os.symlink(logfile, linkfile)
+        os.symlink(logfile, linkfile)
+
+    original_class.run = run
 
     return original_class