diff options
author | Jiajun Xu <jiajun.xu@intel.com> | 2011-11-17 14:05:50 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-18 10:47:15 +0000 |
commit | 693ddddd8675ffe1e1c2484482f758af2688b3b7 (patch) | |
tree | 345f863be97775ebb94dc5dc273a6a46e63ba6e7 /meta/classes | |
parent | c87a539aec000bdf13180f91a1c970ae9bd789c4 (diff) | |
download | poky-693ddddd8675ffe1e1c2484482f758af2688b3b7.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)
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.bbclass | 25 |
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): | |||
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(): |