summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
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():