diff options
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/selftest/_toaster.py | 556 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/bbtests.py | 72 |
2 files changed, 314 insertions, 314 deletions
diff --git a/meta/lib/oeqa/selftest/_toaster.py b/meta/lib/oeqa/selftest/_toaster.py index 1cf28a0144..2ed08d24e6 100644 --- a/meta/lib/oeqa/selftest/_toaster.py +++ b/meta/lib/oeqa/selftest/_toaster.py | |||
| @@ -19,89 +19,89 @@ from oeqa.utils.decorators import testcase | |||
| 19 | class ToasterSetup(oeSelfTest): | 19 | class ToasterSetup(oeSelfTest): |
| 20 | 20 | ||
| 21 | def recipe_parse(self, file_path, var): | 21 | def recipe_parse(self, file_path, var): |
| 22 | for line in open(file_path,'r'): | 22 | for line in open(file_path,'r'): |
| 23 | if line.find(var) > -1: | 23 | if line.find(var) > -1: |
| 24 | val = line.split(" = ")[1].replace("\"", "").strip() | 24 | val = line.split(" = ")[1].replace("\"", "").strip() |
| 25 | return val | 25 | return val |
| 26 | 26 | ||
| 27 | def fix_file_path(self, file_path): | 27 | def fix_file_path(self, file_path): |
| 28 | if ":" in file_path: | 28 | if ":" in file_path: |
| 29 | file_path=file_path.split(":")[2] | 29 | file_path=file_path.split(":")[2] |
| 30 | return file_path | 30 | return file_path |
| 31 | 31 | ||
| 32 | class Toaster_DB_Tests(ToasterSetup): | 32 | class Toaster_DB_Tests(ToasterSetup): |
| 33 | 33 | ||
| 34 | # Check if build name is unique - tc_id=795 | 34 | # Check if build name is unique - tc_id=795 |
| 35 | @testcase(795) | 35 | @testcase(795) |
| 36 | def test_Build_Unique_Name(self): | 36 | def test_Build_Unique_Name(self): |
| 37 | all_builds = Build.objects.all().count() | 37 | all_builds = Build.objects.all().count() |
| 38 | distinct_builds = Build.objects.values('id').distinct().count() | 38 | distinct_builds = Build.objects.values('id').distinct().count() |
| 39 | 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') |
| 40 | 40 | ||
| 41 | # Check if build coocker log path is unique - tc_id=819 | 41 | # Check if build coocker log path is unique - tc_id=819 |
| 42 | @testcase(819) | 42 | @testcase(819) |
| 43 | def test_Build_Unique_Cooker_Log_Path(self): | 43 | def test_Build_Unique_Cooker_Log_Path(self): |
| 44 | distinct_path = Build.objects.values('cooker_log_path').distinct().count() | 44 | distinct_path = Build.objects.values('cooker_log_path').distinct().count() |
| 45 | total_builds = Build.objects.values('id').count() | 45 | total_builds = Build.objects.values('id').count() |
| 46 | 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') |
| 47 | 47 | ||
| 48 | # 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 |
| 49 | @testcase(820) | 49 | @testcase(820) |
| 50 | def test_Build_Errors_No(self): | 50 | def test_Build_Errors_No(self): |
| 51 | builds = Build.objects.values('id', 'errors_no') | 51 | builds = Build.objects.values('id', 'errors_no') |
| 52 | cnt_err = [] | 52 | cnt_err = [] |
| 53 | for build in builds: | 53 | for build in builds: |
| 54 | log_mess_err_no = LogMessage.objects.filter(build = build['id'], level = 2).count() | 54 | log_mess_err_no = LogMessage.objects.filter(build = build['id'], level = 2).count() |
| 55 | if (build['errors_no'] != log_mess_err_no): | 55 | if (build['errors_no'] != log_mess_err_no): |
| 56 | cnt_err.append(build['id']) | 56 | cnt_err.append(build['id']) |
| 57 | 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) |
| 58 | 58 | ||
| 59 | # 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 |
| 60 | @testcase(821) | 60 | @testcase(821) |
| 61 | def test_Build_Warnings_No(self): | 61 | def test_Build_Warnings_No(self): |
| 62 | builds = Build.objects.values('id', 'warnings_no') | 62 | builds = Build.objects.values('id', 'warnings_no') |
| 63 | cnt_err = [] | 63 | cnt_err = [] |
| 64 | for build in builds: | 64 | for build in builds: |
| 65 | log_mess_warn_no = LogMessage.objects.filter(build = build['id'], level = 1).count() | 65 | log_mess_warn_no = LogMessage.objects.filter(build = build['id'], level = 1).count() |
| 66 | if (build['warnings_no'] != log_mess_warn_no): | 66 | if (build['warnings_no'] != log_mess_warn_no): |
| 67 | cnt_err.append(build['id']) | 67 | cnt_err.append(build['id']) |
| 68 | 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) |
| 69 | 69 | ||
| 70 | # 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 |
| 71 | @testcase(822) | 71 | @testcase(822) |
| 72 | def test_Build_Suceeded_Errors_No(self): | 72 | def test_Build_Suceeded_Errors_No(self): |
| 73 | builds = Build.objects.filter(outcome = 0).values('id', 'errors_no') | 73 | builds = Build.objects.filter(outcome = 0).values('id', 'errors_no') |
| 74 | cnt_err = [] | 74 | cnt_err = [] |
| 75 | for build in builds: | 75 | for build in builds: |
| 76 | if (build['errors_no'] != 0): | 76 | if (build['errors_no'] != 0): |
| 77 | cnt_err.append(build['id']) | 77 | cnt_err.append(build['id']) |
| 78 | 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) |
| 79 | 79 | ||
| 80 | # Check if task order is unique for one build - tc=824 | 80 | # Check if task order is unique for one build - tc=824 |
| 81 | @testcase(824) | 81 | @testcase(824) |
| 82 | def test_Task_Unique_Order(self): | 82 | def test_Task_Unique_Order(self): |
| 83 | builds = Build.objects.values('id') | 83 | builds = Build.objects.values('id') |
| 84 | cnt_err = [] | 84 | cnt_err = [] |
| 85 | for build in builds: | 85 | for build in builds: |
| 86 | total_task_order = Task.objects.filter(build = build['id']).values('order').count() | 86 | total_task_order = Task.objects.filter(build = build['id']).values('order').count() |
| 87 | distinct_task_order = Task.objects.filter(build = build['id']).values('order').distinct().count() | 87 | distinct_task_order = Task.objects.filter(build = build['id']).values('order').distinct().count() |
| 88 | if (total_task_order != distinct_task_order): | 88 | if (total_task_order != distinct_task_order): |
| 89 | cnt_err.append(build['id']) | 89 | cnt_err.append(build['id']) |
| 90 | 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) |
| 91 | 91 | ||
| 92 | # Check task order sequence for one build - tc=825 | 92 | # Check task order sequence for one build - tc=825 |
| 93 | @testcase(825) | 93 | @testcase(825) |
| 94 | def test_Task_Order_Sequence(self): | 94 | def test_Task_Order_Sequence(self): |
| 95 | builds = builds = Build.objects.values('id') | 95 | builds = builds = Build.objects.values('id') |
| 96 | cnt_err = [] | 96 | cnt_err = [] |
| 97 | for build in builds: | 97 | for build in builds: |
| 98 | tasks = Task.objects.filter(Q(build = build['id']), ~Q(order = None), ~Q(task_name__contains = '_setscene')).values('id', 'order').order_by("order") | 98 | tasks = Task.objects.filter(Q(build = build['id']), ~Q(order = None), ~Q(task_name__contains = '_setscene')).values('id', 'order').order_by("order") |
| 99 | cnt_tasks = 0 | 99 | cnt_tasks = 0 |
| 100 | for task in tasks: | 100 | for task in tasks: |
| 101 | cnt_tasks += 1 | 101 | cnt_tasks += 1 |
| 102 | if (task['order'] != cnt_tasks): | 102 | if (task['order'] != cnt_tasks): |
| 103 | cnt_err.append(task['id']) | 103 | cnt_err.append(task['id']) |
| 104 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) | 104 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err) |
| 105 | 105 | ||
| 106 | # Check if disk_io matches the difference between EndTimeIO and StartTimeIO in build stats - tc=828 | 106 | # Check if disk_io matches the difference between EndTimeIO and StartTimeIO in build stats - tc=828 |
| 107 | ### this needs to be updated ### | 107 | ### this needs to be updated ### |
| @@ -110,336 +110,336 @@ class Toaster_DB_Tests(ToasterSetup): | |||
| 110 | # 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 |
| 111 | @testcase(832) | 111 | @testcase(832) |
| 112 | def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self): | 112 | def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self): |
| 113 | tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result') | 113 | tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result') |
| 114 | cnt_err = [] | 114 | cnt_err = [] |
| 115 | for task in tasks: | 115 | for task in tasks: |
| 116 | if (row['sstate_result'] != 3): | 116 | if (row['sstate_result'] != 3): |
| 117 | cnt_err.append(task['id']) | 117 | cnt_err.append(task['id']) |
| 118 | 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) |
| 119 | 119 | ||
| 120 | # 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 |
| 121 | @testcase(833) | 121 | @testcase(833) |
| 122 | def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self): | 122 | def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self): |
| 123 | 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') |
| 124 | cnt_err = [] | 124 | cnt_err = [] |
| 125 | for task in tasks: | 125 | for task in tasks: |
| 126 | if (task['sstate_result'] != 0): | 126 | if (task['sstate_result'] != 0): |
| 127 | cnt_err.append(task['id']) | 127 | cnt_err.append(task['id']) |
| 128 | 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) |
| 129 | 129 | ||
| 130 | # 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 |
| 131 | @testcase(834) | 131 | @testcase(834) |
| 132 | def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self): | 132 | def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self): |
| 133 | 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') |
| 134 | cnt_err = [] | 134 | cnt_err = [] |
| 135 | for task in tasks: | 135 | for task in tasks: |
| 136 | if (task['sstate_result'] not in [0, 1, 2]): | 136 | if (task['sstate_result'] not in [0, 1, 2]): |
| 137 | cnt_err.append(task['id']) | 137 | cnt_err.append(task['id']) |
| 138 | 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) |
| 139 | 139 | ||
| 140 | # 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 |
| 141 | @testcase(891) | 141 | @testcase(891) |
| 142 | def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self): | 142 | def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self): |
| 143 | tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type') | 143 | tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type') |
| 144 | cnt_err = [] | 144 | cnt_err = [] |
| 145 | for task in tasks: | 145 | for task in tasks: |
| 146 | if (task['script_type'] not in [0, 2, 3]): | 146 | if (task['script_type'] not in [0, 2, 3]): |
| 147 | cnt_err.append(task['id']) | 147 | cnt_err.append(task['id']) |
| 148 | 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) |
| 149 | 149 | ||
| 150 | # 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 |
| 151 | @testcase(836) | 151 | @testcase(836) |
| 152 | def test_Task_If_Task_Executed_True_Outcome_0_4(self): | 152 | def test_Task_If_Task_Executed_True_Outcome_0_4(self): |
| 153 | tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome') | 153 | tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome') |
| 154 | cnt_err = [] | 154 | cnt_err = [] |
| 155 | for task in tasks: | 155 | for task in tasks: |
| 156 | if (task['outcome'] not in [0, 4]): | 156 | if (task['outcome'] not in [0, 4]): |
| 157 | cnt_err.append(task['id']) | 157 | cnt_err.append(task['id']) |
| 158 | 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) |
| 159 | 159 | ||
| 160 | # 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 |
| 161 | @testcase(890) | 161 | @testcase(890) |
| 162 | def test_Task_If_Task_Executed_False_Script_Type_0(self): | 162 | def test_Task_If_Task_Executed_False_Script_Type_0(self): |
| 163 | tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type') | 163 | tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type') |
| 164 | cnt_err = [] | 164 | cnt_err = [] |
| 165 | for task in tasks: | 165 | for task in tasks: |
| 166 | if (task['script_type'] != 0): | 166 | if (task['script_type'] != 0): |
| 167 | cnt_err.append(task['id']) | 167 | cnt_err.append(task['id']) |
| 168 | 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) |
| 169 | 169 | ||
| 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 | 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 |
| 171 | @testcase(837) | 171 | @testcase(837) |
| 172 | def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self): | 172 | def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self): |
| 173 | builds = Build.objects.filter(outcome = 0).values('id') | 173 | builds = Build.objects.filter(outcome = 0).values('id') |
| 174 | cnt_err = [] | 174 | cnt_err = [] |
| 175 | for build in builds: | 175 | for build in builds: |
| 176 | tasks = Task.objects.filter(build = build['id'], task_executed = 0).values('id', 'outcome') | 176 | tasks = Task.objects.filter(build = build['id'], task_executed = 0).values('id', 'outcome') |
| 177 | for task in tasks: | 177 | for task in tasks: |
| 178 | if (task['outcome'] not in [1, 2, 3, 5]): | 178 | if (task['outcome'] not in [1, 2, 3, 5]): |
| 179 | cnt_err.append(task['id']) | 179 | cnt_err.append(task['id']) |
| 180 | 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) |
| 181 | 181 | ||
| 182 | # Key verification - tc=888 | 182 | # Key verification - tc=888 |
| 183 | @testcase(888) | 183 | @testcase(888) |
| 184 | def test_Target_Installed_Package(self): | 184 | def test_Target_Installed_Package(self): |
| 185 | rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id') | 185 | rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id') |
| 186 | cnt_err = [] | 186 | cnt_err = [] |
| 187 | for row in rows: | 187 | for row in rows: |
| 188 | target = Target.objects.filter(id = row['target_id']).values('id') | 188 | target = Target.objects.filter(id = row['target_id']).values('id') |
| 189 | package = Package.objects.filter(id = row['package_id']).values('id') | 189 | package = Package.objects.filter(id = row['package_id']).values('id') |
| 190 | if (not target or not package): | 190 | if (not target or not package): |
| 191 | cnt_err.append(row['id']) | 191 | cnt_err.append(row['id']) |
| 192 | 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) |
| 193 | 193 | ||
| 194 | # Key verification - tc=889 | 194 | # Key verification - tc=889 |
| 195 | @testcase(889) | 195 | @testcase(889) |
| 196 | def test_Task_Dependency(self): | 196 | def test_Task_Dependency(self): |
| 197 | rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id') | 197 | rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id') |
| 198 | cnt_err = [] | 198 | cnt_err = [] |
| 199 | for row in rows: | 199 | for row in rows: |
| 200 | task_id = Task.objects.filter(id = row['task_id']).values('id') | 200 | task_id = Task.objects.filter(id = row['task_id']).values('id') |
| 201 | depends_on_id = Task.objects.filter(id = row['depends_on_id']).values('id') | 201 | depends_on_id = Task.objects.filter(id = row['depends_on_id']).values('id') |
| 202 | if (not task_id or not depends_on_id): | 202 | if (not task_id or not depends_on_id): |
| 203 | cnt_err.append(row['id']) | 203 | cnt_err.append(row['id']) |
| 204 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for task dependency id: %s' % cnt_err) | 204 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for task dependency id: %s' % cnt_err) |
| 205 | 205 | ||
| 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 | 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 |
| 207 | ### Need to add the tc in the test run | 207 | ### Need to add the tc in the test run |
| 208 | @testcase(1037) | 208 | @testcase(1037) |
| 209 | def test_Target_File_Name_Populated(self): | 209 | def test_Target_File_Name_Populated(self): |
| 210 | builds = Build.objects.filter(outcome = 0).values('id') | 210 | builds = Build.objects.filter(outcome = 0).values('id') |
| 211 | for build in builds: | 211 | for build in builds: |
| 212 | targets = Target.objects.filter(build_id = build['id'], is_image = 1).values('id') | 212 | targets = Target.objects.filter(build_id = build['id'], is_image = 1).values('id') |
| 213 | for target in targets: | 213 | for target in targets: |
| 214 | target_files = Target_Image_File.objects.filter(target_id = target['id']).values('id', 'file_name', 'file_size') | 214 | target_files = Target_Image_File.objects.filter(target_id = target['id']).values('id', 'file_name', 'file_size') |
| 215 | cnt_err = [] | 215 | cnt_err = [] |
| 216 | for file_info in target_files: | 216 | for file_info in target_files: |
| 217 | target_id = file_info['id'] | 217 | target_id = file_info['id'] |
| 218 | target_file_name = file_info['file_name'] | 218 | target_file_name = file_info['file_name'] |
| 219 | target_file_size = file_info['file_size'] | 219 | target_file_size = file_info['file_size'] |
| 220 | if (not target_file_name or not target_file_size): | 220 | if (not target_file_name or not target_file_size): |
| 221 | cnt_err.append(target_id) | 221 | cnt_err.append(target_id) |
| 222 | else: | 222 | else: |
| 223 | if (not os.path.exists(target_file_name)): | 223 | if (not os.path.exists(target_file_name)): |
| 224 | cnt_err.append(target_id) | 224 | cnt_err.append(target_id) |
| 225 | else: | 225 | else: |
| 226 | if (os.path.getsize(target_file_name) != target_file_size): | 226 | if (os.path.getsize(target_file_name) != target_file_size): |
| 227 | cnt_err.append(target_id) | 227 | cnt_err.append(target_id) |
| 228 | 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) |
| 229 | 229 | ||
| 230 | # Key verification - tc=884 | 230 | # Key verification - tc=884 |
| 231 | @testcase(884) | 231 | @testcase(884) |
| 232 | def test_Package_Dependency(self): | 232 | def test_Package_Dependency(self): |
| 233 | cnt_err = [] | 233 | cnt_err = [] |
| 234 | deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id') | 234 | deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id') |
| 235 | for dep in deps: | 235 | for dep in deps: |
| 236 | if (dep['package_id'] == dep['depends_on_id']): | 236 | if (dep['package_id'] == dep['depends_on_id']): |
| 237 | cnt_err.append(dep['id']) | 237 | cnt_err.append(dep['id']) |
| 238 | 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) |
| 239 | 239 | ||
| 240 | # 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 |
| 241 | @testcase(838) | 241 | @testcase(838) |
| 242 | def test_Recipe_Name(self): | 242 | def test_Recipe_Name(self): |
| 243 | recipes = Recipe.objects.values('id', 'name') | 243 | recipes = Recipe.objects.values('id', 'name') |
| 244 | cnt_err = [] | 244 | cnt_err = [] |
| 245 | for recipe in recipes: | 245 | for recipe in recipes: |
| 246 | if (recipe['name'][0].isdigit() is True): | 246 | if (recipe['name'][0].isdigit() is True): |
| 247 | cnt_err.append(recipe['id']) | 247 | cnt_err.append(recipe['id']) |
| 248 | 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) |
| 249 | 249 | ||
| 250 | # 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 |
| 251 | @testcase(839) | 251 | @testcase(839) |
| 252 | def test_Recipe_DB_Section_Match_Recipe_File_Section(self): | 252 | def test_Recipe_DB_Section_Match_Recipe_File_Section(self): |
| 253 | recipes = Recipe.objects.values('id', 'section', 'file_path') | 253 | recipes = Recipe.objects.values('id', 'section', 'file_path') |
| 254 | cnt_err = [] | 254 | cnt_err = [] |
| 255 | for recipe in recipes: | 255 | for recipe in recipes: |
| 256 | file_path = self.fix_file_path(recipe['file_path']) | 256 | file_path = self.fix_file_path(recipe['file_path']) |
| 257 | file_exists = os.path.isfile(file_path) | 257 | file_exists = os.path.isfile(file_path) |
| 258 | if (not file_path or (file_exists is False)): | 258 | if (not file_path or (file_exists is False)): |
| 259 | cnt_err.append(recipe['id']) | 259 | cnt_err.append(recipe['id']) |
| 260 | else: | 260 | else: |
| 261 | file_section = self.recipe_parse(file_path, "SECTION = ") | 261 | file_section = self.recipe_parse(file_path, "SECTION = ") |
| 262 | db_section = recipe['section'] | 262 | db_section = recipe['section'] |
| 263 | if file_section: | 263 | if file_section: |
| 264 | if (db_section != file_section): | 264 | if (db_section != file_section): |
| 265 | cnt_err.append(recipe['id']) | 265 | cnt_err.append(recipe['id']) |
| 266 | 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) |
| 267 | 267 | ||
| 268 | # 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 |
| 269 | @testcase(840) | 269 | @testcase(840) |
| 270 | def test_Recipe_DB_License_Match_Recipe_File_License(self): | 270 | def test_Recipe_DB_License_Match_Recipe_File_License(self): |
| 271 | recipes = Recipe.objects.values('id', 'license', 'file_path') | 271 | recipes = Recipe.objects.values('id', 'license', 'file_path') |
| 272 | cnt_err = [] | 272 | cnt_err = [] |
| 273 | for recipe in recipes: | 273 | for recipe in recipes: |
| 274 | file_path = self.fix_file_path(recipe['file_path']) | 274 | file_path = self.fix_file_path(recipe['file_path']) |
| 275 | file_exists = os.path.isfile(file_path) | 275 | file_exists = os.path.isfile(file_path) |
| 276 | if (not file_path or (file_exists is False)): | 276 | if (not file_path or (file_exists is False)): |
| 277 | cnt_err.append(recipe['id']) | 277 | cnt_err.append(recipe['id']) |
| 278 | else: | 278 | else: |
| 279 | file_license = self.recipe_parse(file_path, "LICENSE = ") | 279 | file_license = self.recipe_parse(file_path, "LICENSE = ") |
| 280 | db_license = recipe['license'] | 280 | db_license = recipe['license'] |
| 281 | if file_license: | 281 | if file_license: |
| 282 | if (db_license != file_license): | 282 | if (db_license != file_license): |
| 283 | cnt_err.append(recipe['id']) | 283 | cnt_err.append(recipe['id']) |
| 284 | 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) |
| 285 | 285 | ||
| 286 | # 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 |
| 287 | @testcase(841) | 287 | @testcase(841) |
| 288 | def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage(self): | 288 | def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage(self): |
| 289 | recipes = Recipe.objects.values('id', 'homepage', 'file_path') | 289 | recipes = Recipe.objects.values('id', 'homepage', 'file_path') |
| 290 | cnt_err = [] | 290 | cnt_err = [] |
| 291 | for recipe in recipes: | 291 | for recipe in recipes: |
| 292 | file_path = self.fix_file_path(recipe['file_path']) | 292 | file_path = self.fix_file_path(recipe['file_path']) |
| 293 | file_exists = os.path.isfile(file_path) | 293 | file_exists = os.path.isfile(file_path) |
| 294 | if (not file_path or (file_exists is False)): | 294 | if (not file_path or (file_exists is False)): |
| 295 | cnt_err.append(recipe['id']) | 295 | cnt_err.append(recipe['id']) |
| 296 | else: | 296 | else: |
| 297 | file_homepage = self.recipe_parse(file_path, "HOMEPAGE = ") | 297 | file_homepage = self.recipe_parse(file_path, "HOMEPAGE = ") |
| 298 | db_homepage = recipe['homepage'] | 298 | db_homepage = recipe['homepage'] |
| 299 | if file_homepage: | 299 | if file_homepage: |
| 300 | if (db_homepage != file_homepage): | 300 | if (db_homepage != file_homepage): |
| 301 | cnt_err.append(recipe['id']) | 301 | cnt_err.append(recipe['id']) |
| 302 | 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) |
| 303 | 303 | ||
| 304 | # 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 |
| 305 | @testcase(842) | 305 | @testcase(842) |
| 306 | def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker(self): | 306 | def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker(self): |
| 307 | recipes = Recipe.objects.values('id', 'bugtracker', 'file_path') | 307 | recipes = Recipe.objects.values('id', 'bugtracker', 'file_path') |
| 308 | cnt_err = [] | 308 | cnt_err = [] |
| 309 | for recipe in recipes: | 309 | for recipe in recipes: |
| 310 | file_path = self.fix_file_path(recipe['file_path']) | 310 | file_path = self.fix_file_path(recipe['file_path']) |
| 311 | file_exists = os.path.isfile(file_path) | 311 | file_exists = os.path.isfile(file_path) |
| 312 | if (not file_path or (file_exists is False)): | 312 | if (not file_path or (file_exists is False)): |
| 313 | cnt_err.append(recipe['id']) | 313 | cnt_err.append(recipe['id']) |
| 314 | else: | 314 | else: |
| 315 | file_bugtracker = self.recipe_parse(file_path, "BUGTRACKER = ") | 315 | file_bugtracker = self.recipe_parse(file_path, "BUGTRACKER = ") |
| 316 | db_bugtracker = recipe['bugtracker'] | 316 | db_bugtracker = recipe['bugtracker'] |
| 317 | if file_bugtracker: | 317 | if file_bugtracker: |
| 318 | if (db_bugtracker != file_bugtracker): | 318 | if (db_bugtracker != file_bugtracker): |
| 319 | cnt_err.append(recipe['id']) | 319 | cnt_err.append(recipe['id']) |
| 320 | 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) |
| 321 | 321 | ||
| 322 | # 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 |
| 323 | @testcase(883) | 323 | @testcase(883) |
| 324 | def test_Recipe_Dependency(self): | 324 | def test_Recipe_Dependency(self): |
| 325 | deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id') | 325 | deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id') |
| 326 | cnt_err = [] | 326 | cnt_err = [] |
| 327 | for dep in deps: | 327 | for dep in deps: |
| 328 | if (not dep['recipe_id'] or not dep['depends_on_id']): | 328 | if (not dep['recipe_id'] or not dep['depends_on_id']): |
| 329 | cnt_err.append(dep['id']) | 329 | cnt_err.append(dep['id']) |
| 330 | else: | 330 | else: |
| 331 | name = Recipe.objects.filter(id = dep['recipe_id']).values('name') | 331 | name = Recipe.objects.filter(id = dep['recipe_id']).values('name') |
| 332 | dep_name = Recipe.objects.filter(id = dep['depends_on_id']).values('name') | 332 | dep_name = Recipe.objects.filter(id = dep['depends_on_id']).values('name') |
| 333 | if (name == dep_name): | 333 | if (name == dep_name): |
| 334 | cnt_err.append(dep['id']) | 334 | cnt_err.append(dep['id']) |
| 335 | 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) |
| 336 | 336 | ||
| 337 | # 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 |
| 338 | @testcase(846) | 338 | @testcase(846) |
| 339 | def test_Package_Name_For_Number(self): | 339 | def test_Package_Name_For_Number(self): |
| 340 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'name') | 340 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'name') |
| 341 | cnt_err = [] | 341 | cnt_err = [] |
| 342 | for package in packages: | 342 | for package in packages: |
| 343 | if (package['name'][0].isdigit() is True): | 343 | if (package['name'][0].isdigit() is True): |
| 344 | cnt_err.append(package['id']) | 344 | cnt_err.append(package['id']) |
| 345 | 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) |
| 346 | 346 | ||
| 347 | # 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 |
| 348 | @testcase(847) | 348 | @testcase(847) |
| 349 | def test_Package_Version_Starts_With_Number(self): | 349 | def test_Package_Version_Starts_With_Number(self): |
| 350 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'version') | 350 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'version') |
| 351 | cnt_err = [] | 351 | cnt_err = [] |
| 352 | for package in packages: | 352 | for package in packages: |
| 353 | if (package['version'][0].isdigit() is False): | 353 | if (package['version'][0].isdigit() is False): |
| 354 | cnt_err.append(package['id']) | 354 | cnt_err.append(package['id']) |
| 355 | 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) |
| 356 | 356 | ||
| 357 | # Check if package revision starts with 'r' - tc=848 | 357 | # Check if package revision starts with 'r' - tc=848 |
| 358 | @testcase(848) | 358 | @testcase(848) |
| 359 | def test_Package_Revision_Starts_With_r(self): | 359 | def test_Package_Revision_Starts_With_r(self): |
| 360 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision') | 360 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision') |
| 361 | cnt_err = [] | 361 | cnt_err = [] |
| 362 | for package in packages: | 362 | for package in packages: |
| 363 | if (package['revision'][0].startswith("r") is False): | 363 | if (package['revision'][0].startswith("r") is False): |
| 364 | cnt_err.append(package['id']) | 364 | cnt_err.append(package['id']) |
| 365 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) | 365 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) |
| 366 | 366 | ||
| 367 | # Check the validity of the package build_id | 367 | # Check the validity of the package build_id |
| 368 | ### TC must be added in test run | 368 | ### TC must be added in test run |
| 369 | @testcase(1038) | 369 | @testcase(1038) |
| 370 | def test_Package_Build_Id(self): | 370 | def test_Package_Build_Id(self): |
| 371 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id') | 371 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id') |
| 372 | cnt_err = [] | 372 | cnt_err = [] |
| 373 | for package in packages: | 373 | for package in packages: |
| 374 | build_id = Build.objects.filter(id = package['build_id']).values('id') | 374 | build_id = Build.objects.filter(id = package['build_id']).values('id') |
| 375 | if (not build_id): | 375 | if (not build_id): |
| 376 | cnt_err.append(package['id']) | 376 | cnt_err.append(package['id']) |
| 377 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) | 377 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) |
| 378 | 378 | ||
| 379 | # Check the validity of package recipe_id | 379 | # Check the validity of package recipe_id |
| 380 | ### TC must be added in test run | 380 | ### TC must be added in test run |
| 381 | @testcase(1039) | 381 | @testcase(1039) |
| 382 | def test_Package_Recipe_Id(self): | 382 | def test_Package_Recipe_Id(self): |
| 383 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id') | 383 | packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id') |
| 384 | cnt_err = [] | 384 | cnt_err = [] |
| 385 | for package in packages: | 385 | for package in packages: |
| 386 | recipe_id = Recipe.objects.filter(id = package['recipe_id']).values('id') | 386 | recipe_id = Recipe.objects.filter(id = package['recipe_id']).values('id') |
| 387 | if (not recipe_id): | 387 | if (not recipe_id): |
| 388 | cnt_err.append(package['id']) | 388 | cnt_err.append(package['id']) |
| 389 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) | 389 | self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err) |
| 390 | 390 | ||
| 391 | # Check if package installed_size field is not null | 391 | # Check if package installed_size field is not null |
| 392 | ### TC must be aded in test run | 392 | ### TC must be aded in test run |
| 393 | @testcase(1040) | 393 | @testcase(1040) |
| 394 | def test_Package_Installed_Size_Not_NULL(self): | 394 | def test_Package_Installed_Size_Not_NULL(self): |
| 395 | packages = Package.objects.filter(installed_size__isnull = True).values('id') | 395 | packages = Package.objects.filter(installed_size__isnull = True).values('id') |
| 396 | cnt_err = [] | 396 | cnt_err = [] |
| 397 | for package in packages: | 397 | for package in packages: |
| 398 | cnt_err.append(package['id']) | 398 | cnt_err.append(package['id']) |
| 399 | 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) |
| 400 | 400 | ||
| 401 | # 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 |
| 402 | @testcase(843) | 402 | @testcase(843) |
| 403 | def test_Layers_Requests_Exit_Code(self): | 403 | def test_Layers_Requests_Exit_Code(self): |
| 404 | layers = Layer.objects.values('id', 'layer_index_url') | 404 | layers = Layer.objects.values('id', 'layer_index_url') |
| 405 | cnt_err = [] | 405 | cnt_err = [] |
| 406 | for layer in layers: | 406 | for layer in layers: |
| 407 | resp = urllib.urlopen(layer['layer_index_url']) | 407 | resp = urllib.urlopen(layer['layer_index_url']) |
| 408 | if (resp.getcode() != 200): | 408 | if (resp.getcode() != 200): |
| 409 | cnt_err.append(layer['id']) | 409 | cnt_err.append(layer['id']) |
| 410 | 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) |
| 411 | 411 | ||
| 412 | # 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 |
| 413 | @testcase(895) | 413 | @testcase(895) |
| 414 | def test_Layers_Show_Layers(self): | 414 | def test_Layers_Show_Layers(self): |
| 415 | layers = Layer.objects.values('id', 'name', 'local_path') | 415 | layers = Layer.objects.values('id', 'name', 'local_path') |
| 416 | cmd = commands.getoutput('bitbake-layers show_layers') | 416 | cmd = commands.getoutput('bitbake-layers show_layers') |
| 417 | cnt_err = [] | 417 | cnt_err = [] |
| 418 | for layer in layers: | 418 | for layer in layers: |
| 419 | if (layer['name'] or layer['local_path']) not in cmd: | 419 | if (layer['name'] or layer['local_path']) not in cmd: |
| 420 | cnt_err.append(layer['id']) | 420 | cnt_err.append(layer['id']) |
| 421 | 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) |
| 422 | 422 | ||
| 423 | # 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 |
| 424 | @testcase(905) | 424 | @testcase(905) |
| 425 | def test_Start_Django_Timezone(self): | 425 | def test_Start_Django_Timezone(self): |
| 426 | current_path = os.getcwd() | 426 | current_path = os.getcwd() |
| 427 | zonefilelist = [] | 427 | zonefilelist = [] |
| 428 | ZONEINFOPATH = '/usr/share/zoneinfo/' | 428 | ZONEINFOPATH = '/usr/share/zoneinfo/' |
| 429 | os.chdir("../bitbake/lib/toaster/") | 429 | os.chdir("../bitbake/lib/toaster/") |
| 430 | cnt_err = 0 | 430 | cnt_err = 0 |
| 431 | for filename in os.listdir(ZONEINFOPATH): | 431 | for filename in os.listdir(ZONEINFOPATH): |
| 432 | if os.path.isfile(os.path.join(ZONEINFOPATH, filename)): | 432 | if os.path.isfile(os.path.join(ZONEINFOPATH, filename)): |
| 433 | zonefilelist.append(filename) | 433 | zonefilelist.append(filename) |
| 434 | for k in range(len(zonefilelist)): | 434 | for k in range(len(zonefilelist)): |
| 435 | if k <= 5: | 435 | if k <= 5: |
| 436 | files = zonefilelist[k] | 436 | files = zonefilelist[k] |
| 437 | os.system("export TZ="+str(files)+"; python manage.py runserver > /dev/null 2>&1 &") | 437 | os.system("export TZ="+str(files)+"; python manage.py runserver > /dev/null 2>&1 &") |
| 438 | time.sleep(3) | 438 | time.sleep(3) |
| 439 | pid = subprocess.check_output("ps aux | grep '[/u]sr/bin/python manage.py runserver' | awk '{print $2}'", shell = True) | 439 | pid = subprocess.check_output("ps aux | grep '[/u]sr/bin/python manage.py runserver' | awk '{print $2}'", shell = True) |
| 440 | if pid: | 440 | if pid: |
| 441 | os.system("kill -9 "+str(pid)) | 441 | os.system("kill -9 "+str(pid)) |
| 442 | else: | 442 | else: |
| 443 | cnt_err.append(zonefilelist[k]) | 443 | cnt_err.append(zonefilelist[k]) |
| 444 | self.assertEqual(cnt_err, 0, msg = 'Errors django server does not start with timezone: %s' % cnt_err) | 444 | self.assertEqual(cnt_err, 0, msg = 'Errors django server does not start with timezone: %s' % cnt_err) |
| 445 | os.chdir(current_path) | 445 | os.chdir(current_path) |
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py index aeccbf55a6..b301d8f819 100644 --- a/meta/lib/oeqa/selftest/bbtests.py +++ b/meta/lib/oeqa/selftest/bbtests.py | |||
| @@ -120,63 +120,63 @@ class BitbakeTests(oeSelfTest): | |||
| 120 | 120 | ||
| 121 | @testcase(1028) | 121 | @testcase(1028) |
| 122 | def test_environment(self): | 122 | def test_environment(self): |
| 123 | self.append_config("TEST_ENV=\"localconf\"") | 123 | self.append_config("TEST_ENV=\"localconf\"") |
| 124 | result = runCmd('bitbake -e | grep TEST_ENV=') | 124 | result = runCmd('bitbake -e | grep TEST_ENV=') |
| 125 | self.assertTrue('localconf' in result.output) | 125 | self.assertTrue('localconf' in result.output) |
| 126 | self.remove_config("TEST_ENV=\"localconf\"") | 126 | self.remove_config("TEST_ENV=\"localconf\"") |
| 127 | 127 | ||
| 128 | @testcase(1029) | 128 | @testcase(1029) |
| 129 | def test_dry_run(self): | 129 | def test_dry_run(self): |
| 130 | result = runCmd('bitbake -n m4-native') | 130 | result = runCmd('bitbake -n m4-native') |
| 131 | self.assertEqual(0, result.status) | 131 | self.assertEqual(0, result.status) |
| 132 | 132 | ||
| 133 | @testcase(1030) | 133 | @testcase(1030) |
| 134 | def test_just_parse(self): | 134 | def test_just_parse(self): |
| 135 | result = runCmd('bitbake -p') | 135 | result = runCmd('bitbake -p') |
| 136 | self.assertEqual(0, result.status) | 136 | self.assertEqual(0, result.status) |
| 137 | 137 | ||
| 138 | @testcase(1031) | 138 | @testcase(1031) |
| 139 | def test_version(self): | 139 | def test_version(self): |
| 140 | result = runCmd('bitbake -s | grep wget') | 140 | result = runCmd('bitbake -s | grep wget') |
| 141 | find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output) | 141 | find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output) |
| 142 | self.assertTrue(find) | 142 | self.assertTrue(find) |
| 143 | 143 | ||
| 144 | @testcase(1032) | 144 | @testcase(1032) |
| 145 | def test_prefile(self): | 145 | def test_prefile(self): |
| 146 | preconf = os.path.join(self.builddir, 'conf/prefile.conf') | 146 | preconf = os.path.join(self.builddir, 'conf/prefile.conf') |
| 147 | self.track_for_cleanup(preconf) | 147 | self.track_for_cleanup(preconf) |
| 148 | ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") | 148 | ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") |
| 149 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') | 149 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') |
| 150 | self.assertTrue('prefile' in result.output) | 150 | self.assertTrue('prefile' in result.output) |
| 151 | self.append_config("TEST_PREFILE=\"localconf\"") | 151 | self.append_config("TEST_PREFILE=\"localconf\"") |
| 152 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') | 152 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') |
| 153 | self.assertTrue('localconf' in result.output) | 153 | self.assertTrue('localconf' in result.output) |
| 154 | self.remove_config("TEST_PREFILE=\"localconf\"") | 154 | self.remove_config("TEST_PREFILE=\"localconf\"") |
| 155 | 155 | ||
| 156 | @testcase(1033) | 156 | @testcase(1033) |
| 157 | def test_postfile(self): | 157 | def test_postfile(self): |
| 158 | postconf = os.path.join(self.builddir, 'conf/postfile.conf') | 158 | postconf = os.path.join(self.builddir, 'conf/postfile.conf') |
| 159 | self.track_for_cleanup(postconf) | 159 | self.track_for_cleanup(postconf) |
| 160 | ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") | 160 | ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") |
| 161 | self.append_config("TEST_POSTFILE=\"localconf\"") | 161 | self.append_config("TEST_POSTFILE=\"localconf\"") |
| 162 | result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') | 162 | result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') |
| 163 | self.assertTrue('postfile' in result.output) | 163 | self.assertTrue('postfile' in result.output) |
| 164 | self.remove_config("TEST_POSTFILE=\"localconf\"") | 164 | self.remove_config("TEST_POSTFILE=\"localconf\"") |
| 165 | 165 | ||
| 166 | @testcase(1034) | 166 | @testcase(1034) |
| 167 | def test_checkuri(self): | 167 | def test_checkuri(self): |
| 168 | result = runCmd('bitbake -c checkuri m4') | 168 | result = runCmd('bitbake -c checkuri m4') |
| 169 | self.assertEqual(0, result.status) | 169 | self.assertEqual(0, result.status) |
| 170 | 170 | ||
| 171 | @testcase(1035) | 171 | @testcase(1035) |
| 172 | def test_continue(self): | 172 | def test_continue(self): |
| 173 | self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" ) | 173 | self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" ) |
| 174 | runCmd('bitbake -c cleanall man xcursor-transparent-theme') | 174 | runCmd('bitbake -c cleanall man xcursor-transparent-theme') |
| 175 | result = runCmd('bitbake man xcursor-transparent-theme -k', ignore_status=True) | 175 | result = runCmd('bitbake man xcursor-transparent-theme -k', ignore_status=True) |
| 176 | errorpos = result.output.find('ERROR: Function failed: do_fail_task') | 176 | errorpos = result.output.find('ERROR: Function failed: do_fail_task') |
| 177 | manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output) | 177 | manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output) |
| 178 | continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) | 178 | continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) |
| 179 | self.assertLess(errorpos,continuepos) | 179 | self.assertLess(errorpos,continuepos) |
| 180 | 180 | ||
| 181 | @testcase(1119) | 181 | @testcase(1119) |
| 182 | def test_non_gplv3(self): | 182 | def test_non_gplv3(self): |
