aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJiajun Xu <jiajun.xu@intel.com>2011-11-17 14:05:50 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-18 10:46:27 +0000
commit43adb8dcf4461b68a7ce0ba9d8acdb2012a70416 (patch)
tree70e56414f7352fd01aebb83497b15e972ca3a478 /meta/classes
parentdd856f5609c13fc740b53016de033a8a9cbe6b51 (diff)
downloadopenembedded-core-contrib-43adb8dcf4461b68a7ce0ba9d8acdb2012a70416.tar.gz
sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm
If PACKAGE_CLASSES does not set package_rpm as the first item, the root filesystem will not be generated based on rpm. We need remove rpm/zypper tests against non-rpm filesystem. [YOCTO #1757] 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.bbclass25
1 files changed, 24 insertions, 1 deletions
diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
index de142bc0fb..d01d1f4979 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -80,9 +80,31 @@ def qemuimagetest_main(d):
bb.note("Run %s test in scenario %s" % (case, scen))
os.system("%s" % fulltestpath)
+ """function to check testcase list and remove inappropriate cases"""
+ def check_list(list):
+ final_list = []
+ for test in list:
+ (scen, case, fullpath) = test
+
+ """Skip rpm/zypper if package_rpm not set for PACKAGE_CLASSES"""
+ if case.find("zypper") != -1 or case.find("rpm") != -1:
+ if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1:
+ bb.note("skip rpm/zypper cases since package_rpm not set in PACKAGE_CLASSES")
+ continue
+ else:
+ final_list.append((scen, case, fullpath))
+ else:
+ final_list.append((scen, case, fullpath))
+
+ if not final_list:
+ raise bb.build.FuncFailed("There is no suitable testcase for this target")
+
+ return final_list
+
"""Generate testcase list in runtime"""
def generate_list(testlist):
list = []
+ final_list = []
if len(testlist) == 0:
raise bb.build.FuncFailed("No testcase defined in TEST_SCEN")
@@ -114,7 +136,8 @@ def qemuimagetest_main(d):
if not os.path.isfile(fulltestcase):
raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase)
list.append((item, casefile, fulltestcase))
- return list
+ final_list = check_list(list)
+ return final_list
"""Clean tmp folder for testing"""
def clean_tmp():