diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-05-29 22:53:06 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 10:56:15 +0100 |
commit | a07d03cc6f67c88feb9813ae7deb6e4a93552dfe (patch) | |
tree | d95be4dce79dfdce785d92b18f82dfa656a529f4 /meta/classes/imagetest-qemu.bbclass | |
parent | b1ea93143a473f006b31ab22f88baf41661971a7 (diff) | |
download | openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.gz openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.bz2 openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.zip |
meta: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found
More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements
[YOCTO #2454]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/imagetest-qemu.bbclass')
-rw-r--r-- | meta/classes/imagetest-qemu.bbclass | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass index d56b44b5c4..f51eeba98c 100644 --- a/meta/classes/imagetest-qemu.bbclass +++ b/meta/classes/imagetest-qemu.bbclass @@ -28,6 +28,7 @@ def qemuimagetest_main(d): import re import os import shutil + import subprocess """ Test Controller for automated testing. @@ -58,7 +59,7 @@ def qemuimagetest_main(d): logpath = d.getVar('TEST_LOG', True) bb.utils.mkdirhier("%s/%s" % (logpath, scen)) caselog = os.path.join(logpath, "%s/log_%s.%s" % (scen, case, d.getVar('DATETIME', True))) - os.system("touch %s" % caselog) + subprocess.call("touch %s" % caselog, shell=True) """export TEST_TMP, TEST_RESULT, DEPLOY_DIR and QEMUARCH""" os.environ["PATH"] = d.getVar("PATH", True) @@ -78,7 +79,7 @@ def qemuimagetest_main(d): """run Test Case""" bb.note("Run %s test in scenario %s" % (case, scen)) - os.system("%s" % fulltestpath) + subprocess.call("%s" % fulltestpath, shell=True) """function to check testcase list and remove inappropriate cases""" def check_list(list): @@ -168,7 +169,7 @@ def qemuimagetest_main(d): test_status = d.getVar('TEST_STATUS', True) if os.path.exists(test_status): os.remove(test_status) - os.system("touch %s" % test_status) + subprocess.call("touch %s" % test_status, shell=True) """initialize result file""" resultpath = d.getVar('TEST_RESULT', True) @@ -180,7 +181,7 @@ def qemuimagetest_main(d): if os.path.exists(sresultfile): os.remove(sresultfile) - os.system("touch %s" % resultfile) + subprocess.call("touch %s" % resultfile, shell=True) os.symlink(resultfile, sresultfile) f = open(sresultfile, "a") f.write("\tTest Result for %s %s\n" % (machine, pname)) |