summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLucian Musat <georgex.l.musat@intel.com>2014-07-17 13:57:00 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-17 12:37:00 +0100
commit929e48e0af0aae503fa883d7765400c3f38cf2d9 (patch)
treefd293cfe9689de55ab262b729f257930216bc524 /meta/lib
parent1bec8d6317588a2ee344a4830ceeab13dfd457a9 (diff)
downloadpoky-929e48e0af0aae503fa883d7765400c3f38cf2d9.tar.gz
oeqs/selftest: Added test case decorators for toaster
(From OE-Core rev: 87ded649257e963e45d629679d44376d9a993ecd) Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/_toaster.py94
1 files changed, 64 insertions, 30 deletions
diff --git a/meta/lib/oeqa/selftest/_toaster.py b/meta/lib/oeqa/selftest/_toaster.py
index 5a42e937bc..1cf28a0144 100644
--- a/meta/lib/oeqa/selftest/_toaster.py
+++ b/meta/lib/oeqa/selftest/_toaster.py
@@ -14,6 +14,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
14import toastermain.settings 14import toastermain.settings
15from django.db.models import Q 15from django.db.models import Q
16from orm.models import * 16from orm.models import *
17from oeqa.utils.decorators import testcase
17 18
18class ToasterSetup(oeSelfTest): 19class ToasterSetup(oeSelfTest):
19 20
@@ -31,19 +32,22 @@ class ToasterSetup(oeSelfTest):
31class Toaster_DB_Tests(ToasterSetup): 32class Toaster_DB_Tests(ToasterSetup):
32 33
33 # Check if build name is unique - tc_id=795 34 # Check if build name is unique - tc_id=795
34 def test_Build_Unique_Name_TC795(self): 35 @testcase(795)
36 def test_Build_Unique_Name(self):
35 all_builds = Build.objects.all().count() 37 all_builds = Build.objects.all().count()
36 distinct_builds = Build.objects.values('id').distinct().count() 38 distinct_builds = Build.objects.values('id').distinct().count()
37 self.assertEqual(distinct_builds, all_builds, msg = 'Build name is not unique') 39 self.assertEqual(distinct_builds, all_builds, msg = 'Build name is not unique')
38 40
39 # Check if build coocker log path is unique - tc_id=819 41 # Check if build coocker log path is unique - tc_id=819
40 def test_Build_Unique_Cooker_Log_Path_TC819(self): 42 @testcase(819)
43 def test_Build_Unique_Cooker_Log_Path(self):
41 distinct_path = Build.objects.values('cooker_log_path').distinct().count() 44 distinct_path = Build.objects.values('cooker_log_path').distinct().count()
42 total_builds = Build.objects.values('id').count() 45 total_builds = Build.objects.values('id').count()
43 self.assertEqual(distinct_path, total_builds, msg = 'Build coocker log path is not unique') 46 self.assertEqual(distinct_path, total_builds, msg = 'Build coocker log path is not unique')
44 47
45 # Check if the number of errors matches the number of orm_logmessage.level entries with value 2 - tc_id=820 48 # Check if the number of errors matches the number of orm_logmessage.level entries with value 2 - tc_id=820
46 def test_Build_Errors_No_TC820(self): 49 @testcase(820)
50 def test_Build_Errors_No(self):
47 builds = Build.objects.values('id', 'errors_no') 51 builds = Build.objects.values('id', 'errors_no')
48 cnt_err = [] 52 cnt_err = []
49 for build in builds: 53 for build in builds:
@@ -53,7 +57,8 @@ class Toaster_DB_Tests(ToasterSetup):
53 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err) 57 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
54 58
55 # Check if the number of warnings matches the number of orm_logmessage.level entries with value 1 - tc=821 59 # Check if the number of warnings matches the number of orm_logmessage.level entries with value 1 - tc=821
56 def test_Build_Warnings_No_TC821(self): 60 @testcase(821)
61 def test_Build_Warnings_No(self):
57 builds = Build.objects.values('id', 'warnings_no') 62 builds = Build.objects.values('id', 'warnings_no')
58 cnt_err = [] 63 cnt_err = []
59 for build in builds: 64 for build in builds:
@@ -63,7 +68,8 @@ class Toaster_DB_Tests(ToasterSetup):
63 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err) 68 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
64 69
65 # Check if the build succeeded then the errors_no is 0 - tc_id=822 70 # Check if the build succeeded then the errors_no is 0 - tc_id=822
66 def test_Build_Suceeded_Errors_No_TC822(self): 71 @testcase(822)
72 def test_Build_Suceeded_Errors_No(self):
67 builds = Build.objects.filter(outcome = 0).values('id', 'errors_no') 73 builds = Build.objects.filter(outcome = 0).values('id', 'errors_no')
68 cnt_err = [] 74 cnt_err = []
69 for build in builds: 75 for build in builds:
@@ -71,8 +77,9 @@ class Toaster_DB_Tests(ToasterSetup):
71 cnt_err.append(build['id']) 77 cnt_err.append(build['id'])
72 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err) 78 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
73 79
74 # Check if task order is unique for one build - tc=824 80 # Check if task order is unique for one build - tc=824
75 def test_Task_Unique_Order_TC824(self): 81 @testcase(824)
82 def test_Task_Unique_Order(self):
76 builds = Build.objects.values('id') 83 builds = Build.objects.values('id')
77 cnt_err = [] 84 cnt_err = []
78 for build in builds: 85 for build in builds:
@@ -83,7 +90,8 @@ class Toaster_DB_Tests(ToasterSetup):
83 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err) 90 self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
84 91
85 # Check task order sequence for one build - tc=825 92 # Check task order sequence for one build - tc=825
86 def test_Task_Order_Sequence_TC825(self): 93 @testcase(825)
94 def test_Task_Order_Sequence(self):
87 builds = builds = Build.objects.values('id') 95 builds = builds = Build.objects.values('id')
88 cnt_err = [] 96 cnt_err = []
89 for build in builds: 97 for build in builds:
@@ -100,7 +108,8 @@ class Toaster_DB_Tests(ToasterSetup):
100 #def test_Task_Disk_IO_TC828(self): 108 #def test_Task_Disk_IO_TC828(self):
101 109
102 # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832 110 # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832
103 def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3_TC832(self): 111 @testcase(832)
112 def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self):
104 tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result') 113 tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result')
105 cnt_err = [] 114 cnt_err = []
106 for task in tasks: 115 for task in tasks:
@@ -109,7 +118,8 @@ class Toaster_DB_Tests(ToasterSetup):
109 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 118 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
110 119
111 # Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must be 0 (SSTATE_NA) - tc=833 120 # Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must be 0 (SSTATE_NA) - tc=833
112 def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0_TC833(self): 121 @testcase(833)
122 def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
113 tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result') 123 tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result')
114 cnt_err = [] 124 cnt_err = []
115 for task in tasks: 125 for task in tasks:
@@ -118,7 +128,8 @@ class Toaster_DB_Tests(ToasterSetup):
118 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 128 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
119 129
120 # Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834 130 # Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834
121 def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2_TC834(self): 131 @testcase(834)
132 def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self):
122 tasks = Task.objects.filter(outcome__in = (0, 4)).values('id', 'sstate_result') 133 tasks = Task.objects.filter(outcome__in = (0, 4)).values('id', 'sstate_result')
123 cnt_err = [] 134 cnt_err = []
124 for task in tasks: 135 for task in tasks:
@@ -127,7 +138,8 @@ class Toaster_DB_Tests(ToasterSetup):
127 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 138 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
128 139
129 # Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2 (CODING_PYTHON), 3 (CODING_SHELL) - tc=891 140 # Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2 (CODING_PYTHON), 3 (CODING_SHELL) - tc=891
130 def test_Task_If_Task_Executed_True_Script_Type_0_2_3_TC891(self): 141 @testcase(891)
142 def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self):
131 tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type') 143 tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type')
132 cnt_err = [] 144 cnt_err = []
133 for task in tasks: 145 for task in tasks:
@@ -136,7 +148,8 @@ class Toaster_DB_Tests(ToasterSetup):
136 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 148 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
137 149
138 # Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4 (FAILED) - tc=836 150 # Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4 (FAILED) - tc=836
139 def test_Task_If_Task_Executed_True_Outcome_0_4_TC836(self): 151 @testcase(836)
152 def test_Task_If_Task_Executed_True_Outcome_0_4(self):
140 tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome') 153 tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome')
141 cnt_err = [] 154 cnt_err = []
142 for task in tasks: 155 for task in tasks:
@@ -145,7 +158,8 @@ class Toaster_DB_Tests(ToasterSetup):
145 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 158 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
146 159
147 # Check if task_executed = FALSE (0), script_type must be 0 - tc=890 160 # Check if task_executed = FALSE (0), script_type must be 0 - tc=890
148 def test_Task_If_Task_Executed_False_Script_Type_0_TC890(self): 161 @testcase(890)
162 def test_Task_If_Task_Executed_False_Script_Type_0(self):
149 tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type') 163 tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type')
150 cnt_err = [] 164 cnt_err = []
151 for task in tasks: 165 for task in tasks:
@@ -154,7 +168,8 @@ class Toaster_DB_Tests(ToasterSetup):
154 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 168 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
155 169
156 # Check if task_executed = FALSE (0) and build outcome = SUCCEEDED (0), task outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT), 5 (EMPTY) - tc=837 170 # Check if task_executed = FALSE (0) and build outcome = SUCCEEDED (0), task outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT), 5 (EMPTY) - tc=837
157 def test_Task_If_Task_Executed_False_Outcome_1_2_3_5_TC837(self): 171 @testcase(837)
172 def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self):
158 builds = Build.objects.filter(outcome = 0).values('id') 173 builds = Build.objects.filter(outcome = 0).values('id')
159 cnt_err = [] 174 cnt_err = []
160 for build in builds: 175 for build in builds:
@@ -165,7 +180,8 @@ class Toaster_DB_Tests(ToasterSetup):
165 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) 180 self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
166 181
167 # Key verification - tc=888 182 # Key verification - tc=888
168 def test_Target_Installed_Package_TC888(self): 183 @testcase(888)
184 def test_Target_Installed_Package(self):
169 rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id') 185 rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id')
170 cnt_err = [] 186 cnt_err = []
171 for row in rows: 187 for row in rows:
@@ -176,7 +192,8 @@ class Toaster_DB_Tests(ToasterSetup):
176 self.assertEqual(len(cnt_err), 0, msg = 'Errors for target installed package id: %s' % cnt_err) 192 self.assertEqual(len(cnt_err), 0, msg = 'Errors for target installed package id: %s' % cnt_err)
177 193
178 # Key verification - tc=889 194 # Key verification - tc=889
179 def test_Task_Dependency_TC889(self): 195 @testcase(889)
196 def test_Task_Dependency(self):
180 rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id') 197 rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id')
181 cnt_err = [] 198 cnt_err = []
182 for row in rows: 199 for row in rows:
@@ -188,6 +205,7 @@ class Toaster_DB_Tests(ToasterSetup):
188 205
189 # Check if build target file_name is populated only if is_image=true AND orm_build.outcome=0 then if the file exists and its size matches the file_size value 206 # Check if build target file_name is populated only if is_image=true AND orm_build.outcome=0 then if the file exists and its size matches the file_size value
190 ### Need to add the tc in the test run 207 ### Need to add the tc in the test run
208 @testcase(1037)
191 def test_Target_File_Name_Populated(self): 209 def test_Target_File_Name_Populated(self):
192 builds = Build.objects.filter(outcome = 0).values('id') 210 builds = Build.objects.filter(outcome = 0).values('id')
193 for build in builds: 211 for build in builds:
@@ -210,7 +228,8 @@ class Toaster_DB_Tests(ToasterSetup):
210 self.assertEqual(len(cnt_err), 0, msg = 'Errors for target image file id: %s' % cnt_err) 228 self.assertEqual(len(cnt_err), 0, msg = 'Errors for target image file id: %s' % cnt_err)
211 229
212 # Key verification - tc=884 230 # Key verification - tc=884
213 def test_Package_Dependency_TC884(self): 231 @testcase(884)
232 def test_Package_Dependency(self):
214 cnt_err = [] 233 cnt_err = []
215 deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id') 234 deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id')
216 for dep in deps: 235 for dep in deps:
@@ -219,7 +238,8 @@ class Toaster_DB_Tests(ToasterSetup):
219 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package dependency id: %s' % cnt_err) 238 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package dependency id: %s' % cnt_err)
220 239
221 # Check if recipe name does not start with a number (0-9) - tc=838 240 # Check if recipe name does not start with a number (0-9) - tc=838
222 def test_Recipe_Name_TC838(self): 241 @testcase(838)
242 def test_Recipe_Name(self):
223 recipes = Recipe.objects.values('id', 'name') 243 recipes = Recipe.objects.values('id', 'name')
224 cnt_err = [] 244 cnt_err = []
225 for recipe in recipes: 245 for recipe in recipes:
@@ -228,7 +248,8 @@ class Toaster_DB_Tests(ToasterSetup):
228 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err) 248 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
229 249
230 # Check if recipe section matches the content of the SECTION variable (if set) in file_path - tc=839 250 # Check if recipe section matches the content of the SECTION variable (if set) in file_path - tc=839
231 def test_Recipe_DB_Section_Match_Recipe_File_Section_TC839(self): 251 @testcase(839)
252 def test_Recipe_DB_Section_Match_Recipe_File_Section(self):
232 recipes = Recipe.objects.values('id', 'section', 'file_path') 253 recipes = Recipe.objects.values('id', 'section', 'file_path')
233 cnt_err = [] 254 cnt_err = []
234 for recipe in recipes: 255 for recipe in recipes:
@@ -245,7 +266,8 @@ class Toaster_DB_Tests(ToasterSetup):
245 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err) 266 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
246 267
247 # Check if recipe license matches the content of the LICENSE variable (if set) in file_path - tc=840 268 # Check if recipe license matches the content of the LICENSE variable (if set) in file_path - tc=840
248 def test_Recipe_DB_License_Match_Recipe_File_License_TC840(self): 269 @testcase(840)
270 def test_Recipe_DB_License_Match_Recipe_File_License(self):
249 recipes = Recipe.objects.values('id', 'license', 'file_path') 271 recipes = Recipe.objects.values('id', 'license', 'file_path')
250 cnt_err = [] 272 cnt_err = []
251 for recipe in recipes: 273 for recipe in recipes:
@@ -262,7 +284,8 @@ class Toaster_DB_Tests(ToasterSetup):
262 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err) 284 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
263 285
264 # Check if recipe homepage matches the content of the HOMEPAGE variable (if set) in file_path - tc=841 286 # Check if recipe homepage matches the content of the HOMEPAGE variable (if set) in file_path - tc=841
265 def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage_TC841(self): 287 @testcase(841)
288 def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage(self):
266 recipes = Recipe.objects.values('id', 'homepage', 'file_path') 289 recipes = Recipe.objects.values('id', 'homepage', 'file_path')
267 cnt_err = [] 290 cnt_err = []
268 for recipe in recipes: 291 for recipe in recipes:
@@ -279,7 +302,8 @@ class Toaster_DB_Tests(ToasterSetup):
279 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err) 302 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
280 303
281 # Check if recipe bugtracker matches the content of the BUGTRACKER variable (if set) in file_path - tc=842 304 # Check if recipe bugtracker matches the content of the BUGTRACKER variable (if set) in file_path - tc=842
282 def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker_TC842(self): 305 @testcase(842)
306 def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker(self):
283 recipes = Recipe.objects.values('id', 'bugtracker', 'file_path') 307 recipes = Recipe.objects.values('id', 'bugtracker', 'file_path')
284 cnt_err = [] 308 cnt_err = []
285 for recipe in recipes: 309 for recipe in recipes:
@@ -296,7 +320,8 @@ class Toaster_DB_Tests(ToasterSetup):
296 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err) 320 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
297 321
298 # Recipe key verification, recipe name does not depends on a recipe having the same name - tc=883 322 # Recipe key verification, recipe name does not depends on a recipe having the same name - tc=883
299 def test_Recipe_Dependency_TC883(self): 323 @testcase(883)
324 def test_Recipe_Dependency(self):
300 deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id') 325 deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id')
301 cnt_err = [] 326 cnt_err = []
302 for dep in deps: 327 for dep in deps:
@@ -310,7 +335,8 @@ class Toaster_DB_Tests(ToasterSetup):
310 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe dependency id: %s' % cnt_err) 335 self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe dependency id: %s' % cnt_err)
311 336
312 # Check if package name does not start with a number (0-9) - tc=846 337 # Check if package name does not start with a number (0-9) - tc=846
313 def test_Package_Name_For_Number_TC846(self): 338 @testcase(846)
339 def test_Package_Name_For_Number(self):
314 packages = Package.objects.filter(~Q(size = -1)).values('id', 'name') 340 packages = Package.objects.filter(~Q(size = -1)).values('id', 'name')
315 cnt_err = [] 341 cnt_err = []
316 for package in packages: 342 for package in packages:
@@ -319,7 +345,8 @@ class Toaster_DB_Tests(ToasterSetup):
319 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) 345 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
320 346
321 # Check if package version starts with a number (0-9) - tc=847 347 # Check if package version starts with a number (0-9) - tc=847
322 def test_Package_Version_Starts_With_Number_TC847(self): 348 @testcase(847)
349 def test_Package_Version_Starts_With_Number(self):
323 packages = Package.objects.filter(~Q(size = -1)).values('id', 'version') 350 packages = Package.objects.filter(~Q(size = -1)).values('id', 'version')
324 cnt_err = [] 351 cnt_err = []
325 for package in packages: 352 for package in packages:
@@ -328,7 +355,8 @@ class Toaster_DB_Tests(ToasterSetup):
328 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) 355 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
329 356
330 # Check if package revision starts with 'r' - tc=848 357 # Check if package revision starts with 'r' - tc=848
331 def test_Package_Revision_Starts_With_r_TC848(self): 358 @testcase(848)
359 def test_Package_Revision_Starts_With_r(self):
332 packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision') 360 packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision')
333 cnt_err = [] 361 cnt_err = []
334 for package in packages: 362 for package in packages:
@@ -338,6 +366,7 @@ class Toaster_DB_Tests(ToasterSetup):
338 366
339 # Check the validity of the package build_id 367 # Check the validity of the package build_id
340 ### TC must be added in test run 368 ### TC must be added in test run
369 @testcase(1038)
341 def test_Package_Build_Id(self): 370 def test_Package_Build_Id(self):
342 packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id') 371 packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id')
343 cnt_err = [] 372 cnt_err = []
@@ -349,6 +378,7 @@ class Toaster_DB_Tests(ToasterSetup):
349 378
350 # Check the validity of package recipe_id 379 # Check the validity of package recipe_id
351 ### TC must be added in test run 380 ### TC must be added in test run
381 @testcase(1039)
352 def test_Package_Recipe_Id(self): 382 def test_Package_Recipe_Id(self):
353 packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id') 383 packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id')
354 cnt_err = [] 384 cnt_err = []
@@ -360,6 +390,7 @@ class Toaster_DB_Tests(ToasterSetup):
360 390
361 # Check if package installed_size field is not null 391 # Check if package installed_size field is not null
362 ### TC must be aded in test run 392 ### TC must be aded in test run
393 @testcase(1040)
363 def test_Package_Installed_Size_Not_NULL(self): 394 def test_Package_Installed_Size_Not_NULL(self):
364 packages = Package.objects.filter(installed_size__isnull = True).values('id') 395 packages = Package.objects.filter(installed_size__isnull = True).values('id')
365 cnt_err = [] 396 cnt_err = []
@@ -368,7 +399,8 @@ class Toaster_DB_Tests(ToasterSetup):
368 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) 399 self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
369 400
370 # Check if all layers requests return exit code is 200 - tc=843 401 # Check if all layers requests return exit code is 200 - tc=843
371 def test_Layers_Requests_Exit_Code_TC843(self): 402 @testcase(843)
403 def test_Layers_Requests_Exit_Code(self):
372 layers = Layer.objects.values('id', 'layer_index_url') 404 layers = Layer.objects.values('id', 'layer_index_url')
373 cnt_err = [] 405 cnt_err = []
374 for layer in layers: 406 for layer in layers:
@@ -378,7 +410,8 @@ class Toaster_DB_Tests(ToasterSetup):
378 self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err) 410 self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
379 411
380 # Check if the output of bitbake-layers show_layers matches the info from database - tc=895 412 # Check if the output of bitbake-layers show_layers matches the info from database - tc=895
381 def test_Layers_Show_Layers_TC895(self): 413 @testcase(895)
414 def test_Layers_Show_Layers(self):
382 layers = Layer.objects.values('id', 'name', 'local_path') 415 layers = Layer.objects.values('id', 'name', 'local_path')
383 cmd = commands.getoutput('bitbake-layers show_layers') 416 cmd = commands.getoutput('bitbake-layers show_layers')
384 cnt_err = [] 417 cnt_err = []
@@ -388,7 +421,8 @@ class Toaster_DB_Tests(ToasterSetup):
388 self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err) 421 self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
389 422
390 # Check if django server starts regardless of the timezone set on the machine - tc=905 423 # Check if django server starts regardless of the timezone set on the machine - tc=905
391 def test_Start_Django_Timezone_TC905(self): 424 @testcase(905)
425 def test_Start_Django_Timezone(self):
392 current_path = os.getcwd() 426 current_path = os.getcwd()
393 zonefilelist = [] 427 zonefilelist = []
394 ZONEINFOPATH = '/usr/share/zoneinfo/' 428 ZONEINFOPATH = '/usr/share/zoneinfo/'