summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJiajun Xu <jiajun.xu@intel.com>2011-05-03 10:07:30 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-04 00:56:33 +0100
commitea4857a98b500e0b73d875b28c43e2d1d0f740b6 (patch)
tree23cbe4dab67160a869b2689949720b10de1a3c99 /meta/classes
parent49e2fcc60458853d7ff7f2908e695b11a95f3061 (diff)
downloadpoky-ea4857a98b500e0b73d875b28c43e2d1d0f740b6.tar.gz
qemuimagetest: Enable toolchain automation tests in qemuimagetest
Enable toolchain automation tests in qemuimagetest framework. 3 C/C++ test projects are added to test toolchain - cvs, iptables and sudoku-savant. User needs to set TEST_SCEN to "toolchain" in local.conf to enable tests. Test case will check if toolchain tarball exists under "${DEPLOY_DIR}/sdk". And it will extract toolchain tarball into /opt. It requires user to chown /opt to non-root user, who will run qemuimagetest. Signed-off-by Jiajun Xu <jiajun.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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