aboutsummaryrefslogtreecommitdiffstats
path: root/meta
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:54:12 +0100
commitd4ec2a2ce255cb58cbd142f38aad4a56898b61a6 (patch)
treef34353acfee3b98e8b777be17317e1d4dbf3f007 /meta
parent041a10722b7311c57a03d5a032621d8c32e4fc7e (diff)
downloadopenembedded-core-contrib-d4ec2a2ce255cb58cbd142f38aad4a56898b61a6.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>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/imagetest-qemu.bbclass9
-rw-r--r--meta/conf/local.conf.sample2
-rw-r--r--meta/recipes-core/meta/meta-toolchain.bb3
3 files changed, 10 insertions, 4 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):
import sys
import re
import os
+ import shutil
"""
Test Controller for automated testing.
@@ -72,6 +73,7 @@ def qemuimagetest_main(d):
os.environ["TEST_STATUS"] = bb.data.getVar("TEST_STATUS", d, True)
os.environ["TARGET_IPSAVE"] = bb.data.getVar("TARGET_IPSAVE", d, True)
os.environ["TEST_SERIALIZE"] = bb.data.getVar("TEST_SERIALIZE", d, True)
+ os.environ["SDK_NAME"] = bb.data.getVar("SDK_NAME", d, True)
"""run Test Case"""
bb.note("Run %s test in scenario %s" % (case, scen))
@@ -120,7 +122,10 @@ def qemuimagetest_main(d):
if os.path.isdir(tmppath):
for f in os.listdir(tmppath):
tmpfile = os.path.join(tmppath, f)
- os.remove(tmpfile)
+ if os.path.isfile(tmpfile):
+ os.remove(tmpfile)
+ elif os.path.isdir(tmpfile):
+ shutil.rmtree(tmpfile, True)
"""Before running testing, clean temp folder first"""
clean_tmp()
@@ -154,7 +159,7 @@ def qemuimagetest_main(d):
os.system("touch %s" % resultfile)
os.symlink(resultfile, sresultfile)
f = open(sresultfile, "a")
- f.write("\tTest Result for %s\n" % machine)
+ f.write("\tTest Result for %s %s\n" % (machine, pname))
f.write("\t%-15s%-15s%-15s%-15s\n" % ("Testcase", "PASS", "FAIL", "NORESULT"))
f.close()
diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
index ba92df8d32..cf7f33f542 100644
--- a/meta/conf/local.conf.sample
+++ b/meta/conf/local.conf.sample
@@ -145,7 +145,7 @@ ENABLE_BINARY_LOCALE_GENERATION = "1"
# By default test cases in sanity suite will be ran. If you want to run other
# test suite or specific test case(e.g. bat or boot test case under sanity suite),
# list them like following.
-#TEST_SCEN = "sanity bat sanity:boot"
+#TEST_SCEN = "sanity bat sanity:boot toolchain"
#Because of the QEMU booting slowness issue(see bug #646 and #618), autobuilder
#may suffer a timeout issue when running sanity test. We introduce variable
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
index 94c8a91a72..ab98bf99b2 100644
--- a/meta/recipes-core/meta/meta-toolchain.bb
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -6,6 +6,7 @@ PR = "r4"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-inherit populate_sdk
+IMAGETEST ?= "dummy"
+inherit populate_sdk imagetest-${IMAGETEST}
CONFIG_SITE := "${@siteinfo_get_files(d)}"