summaryrefslogtreecommitdiffstats
path: root/meta/classes/imagetest-qemu.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/imagetest-qemu.bbclass')
-rw-r--r--meta/classes/imagetest-qemu.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
index daeb8d8c9c..e259ae9baa 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -27,6 +27,7 @@ def qemuimagetest_main(d):
27 import sys 27 import sys
28 import re 28 import re
29 import os 29 import os
30 import shutil
30 31
31 """ 32 """
32 Test Controller for automated testing. 33 Test Controller for automated testing.
@@ -72,6 +73,7 @@ def qemuimagetest_main(d):
72 os.environ["TEST_STATUS"] = bb.data.getVar("TEST_STATUS", d, True) 73 os.environ["TEST_STATUS"] = bb.data.getVar("TEST_STATUS", d, True)
73 os.environ["TARGET_IPSAVE"] = bb.data.getVar("TARGET_IPSAVE", d, True) 74 os.environ["TARGET_IPSAVE"] = bb.data.getVar("TARGET_IPSAVE", d, True)
74 os.environ["TEST_SERIALIZE"] = bb.data.getVar("TEST_SERIALIZE", d, True) 75 os.environ["TEST_SERIALIZE"] = bb.data.getVar("TEST_SERIALIZE", d, True)
76 os.environ["SDK_NAME"] = bb.data.getVar("SDK_NAME", d, True)
75 77
76 """run Test Case""" 78 """run Test Case"""
77 bb.note("Run %s test in scenario %s" % (case, scen)) 79 bb.note("Run %s test in scenario %s" % (case, scen))
@@ -120,7 +122,10 @@ def qemuimagetest_main(d):
120 if os.path.isdir(tmppath): 122 if os.path.isdir(tmppath):
121 for f in os.listdir(tmppath): 123 for f in os.listdir(tmppath):
122 tmpfile = os.path.join(tmppath, f) 124 tmpfile = os.path.join(tmppath, f)
123 os.remove(tmpfile) 125 if os.path.isfile(tmpfile):
126 os.remove(tmpfile)
127 elif os.path.isdir(tmpfile):
128 shutil.rmtree(tmpfile, True)
124 129
125 """Before running testing, clean temp folder first""" 130 """Before running testing, clean temp folder first"""
126 clean_tmp() 131 clean_tmp()
@@ -154,7 +159,7 @@ def qemuimagetest_main(d):
154 os.system("touch %s" % resultfile) 159 os.system("touch %s" % resultfile)
155 os.symlink(resultfile, sresultfile) 160 os.symlink(resultfile, sresultfile)
156 f = open(sresultfile, "a") 161 f = open(sresultfile, "a")
157 f.write("\tTest Result for %s\n" % machine) 162 f.write("\tTest Result for %s %s\n" % (machine, pname))
158 f.write("\t%-15s%-15s%-15s%-15s\n" % ("Testcase", "PASS", "FAIL", "NORESULT")) 163 f.write("\t%-15s%-15s%-15s%-15s\n" % ("Testcase", "PASS", "FAIL", "NORESULT"))
159 f.close() 164 f.close()
160 165