summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/decorators.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 615fd956b5..25f9c54e6b 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -189,10 +189,24 @@ def LogResults(original_class):
189 if passed: 189 if passed:
190 local_log.results("Testcase "+str(test_case)+": PASSED") 190 local_log.results("Testcase "+str(test_case)+": PASSED")
191 191
192 # XXX: In order to avoid race condition when test if exists the linkfile
193 # use bb.utils.lock, the best solution is to create a unique name for the
194 # link file.
195 try:
196 import bb
197 has_bb = True
198 lockfilename = linkfile + '.lock'
199 except ImportError:
200 has_bb = False
201
202 if has_bb:
203 lf = bb.utils.lockfile(lockfilename, block=True)
192 # Create symlink to the current log 204 # Create symlink to the current log
193 if os.path.lexists(linkfile): 205 if os.path.lexists(linkfile):
194 os.remove(linkfile) 206 os.remove(linkfile)
195 os.symlink(logfile, linkfile) 207 os.symlink(logfile, linkfile)
208 if has_bb:
209 bb.utils.unlockfile(lf)
196 210
197 original_class.run = run 211 original_class.run = run
198 212