summaryrefslogtreecommitdiffstats
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>2012-01-30 16:43:47 +0000
commit7705d9a8cca613eb7d168ba78619456bc89866f2 (patch)
tree2319db7700dcbacd1cbaec4f8669754e1681211a /meta/classes
parentbcec98bf1c0d3ff62852331ada5041b24eac6524 (diff)
downloadpoky-7705d9a8cca613eb7d168ba78619456bc89866f2.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] (From OE-Core rev: 43adb8dcf4461b68a7ce0ba9d8acdb2012a70416) (From OE-Core rev: f541517be97e27951157e1dd10256e132c31ab1f) 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 4ea86c04fe..e3a65f0419 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -80,9 +80,31 @@ def qemuimagetest_main(d):
80 bb.note("Run %s test in scenario %s" % (case, scen)) 80 bb.note("Run %s test in scenario %s" % (case, scen))
81 os.system("%s" % fulltestpath) 81 os.system("%s" % fulltestpath)
82 82
83 """function to check testcase list and remove inappropriate cases"""
84 def check_list(list):
85 final_list = []
86 for test in list:
87 (scen, case, fullpath) = test
88
89 """Skip rpm/zypper if package_rpm not set for PACKAGE_CLASSES"""
90 if case.find("zypper") != -1 or case.find("rpm") != -1:
91 if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1:
92 bb.note("skip rpm/zypper cases since package_rpm not set in PACKAGE_CLASSES")
93 continue
94 else:
95 final_list.append((scen, case, fullpath))
96 else:
97 final_list.append((scen, case, fullpath))
98
99 if not final_list:
100 raise bb.build.FuncFailed("There is no suitable testcase for this target")
101
102 return final_list
103
83 """Generate testcase list in runtime""" 104 """Generate testcase list in runtime"""
84 def generate_list(testlist): 105 def generate_list(testlist):
85 list = [] 106 list = []
107 final_list = []
86 if len(testlist) == 0: 108 if len(testlist) == 0:
87 raise bb.build.FuncFailed("No testcase defined in TEST_SCEN") 109 raise bb.build.FuncFailed("No testcase defined in TEST_SCEN")
88 110
@@ -114,7 +136,8 @@ def qemuimagetest_main(d):
114 if not os.path.isfile(fulltestcase): 136 if not os.path.isfile(fulltestcase):
115 raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase) 137 raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase)
116 list.append((item, casefile, fulltestcase)) 138 list.append((item, casefile, fulltestcase))
117 return list 139 final_list = check_list(list)
140 return final_list
118 141
119 """Clean tmp folder for testing""" 142 """Clean tmp folder for testing"""
120 def clean_tmp(): 143 def clean_tmp():