diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/builds/test_core_image_min.py')
-rw-r--r-- | bitbake/lib/toaster/tests/builds/test_core_image_min.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/bitbake/lib/toaster/tests/builds/test_core_image_min.py b/bitbake/lib/toaster/tests/builds/test_core_image_min.py index 44b6cbec7b..c5bfdbfbb5 100644 --- a/bitbake/lib/toaster/tests/builds/test_core_image_min.py +++ b/bitbake/lib/toaster/tests/builds/test_core_image_min.py | |||
@@ -10,6 +10,7 @@ | |||
10 | # Ionut Chisanovici, Paul Eggleton and Cristian Iorga | 10 | # Ionut Chisanovici, Paul Eggleton and Cristian Iorga |
11 | 11 | ||
12 | import os | 12 | import os |
13 | import pytest | ||
13 | 14 | ||
14 | from django.db.models import Q | 15 | from django.db.models import Q |
15 | 16 | ||
@@ -20,12 +21,13 @@ from orm.models import CustomImagePackage | |||
20 | 21 | ||
21 | from tests.builds.buildtest import BuildTest | 22 | from tests.builds.buildtest import BuildTest |
22 | 23 | ||
23 | 24 | @pytest.mark.order(4) | |
25 | @pytest.mark.django_db(True) | ||
24 | class BuildCoreImageMinimal(BuildTest): | 26 | class BuildCoreImageMinimal(BuildTest): |
25 | """Build core-image-minimal and test the results""" | 27 | """Build core-image-minimal and test the results""" |
26 | 28 | ||
27 | def setUp(self): | 29 | def setUp(self): |
28 | self.completed_build = self.build("core-image-minimal") | 30 | self.completed_build = self.target_already_built("core-image-minimal") |
29 | 31 | ||
30 | # Check if build name is unique - tc_id=795 | 32 | # Check if build name is unique - tc_id=795 |
31 | def test_Build_Unique_Name(self): | 33 | def test_Build_Unique_Name(self): |
@@ -44,17 +46,6 @@ class BuildCoreImageMinimal(BuildTest): | |||
44 | total_builds, | 46 | total_builds, |
45 | msg='Build cooker log path is not unique') | 47 | msg='Build cooker log path is not unique') |
46 | 48 | ||
47 | # Check if task order is unique for one build - tc=824 | ||
48 | def test_Task_Unique_Order(self): | ||
49 | total_task_order = Task.objects.filter( | ||
50 | build=self.built).values('order').count() | ||
51 | distinct_task_order = Task.objects.filter( | ||
52 | build=self.completed_build).values('order').distinct().count() | ||
53 | |||
54 | self.assertEqual(total_task_order, | ||
55 | distinct_task_order, | ||
56 | msg='Errors task order is not unique') | ||
57 | |||
58 | # Check task order sequence for one build - tc=825 | 49 | # Check task order sequence for one build - tc=825 |
59 | def test_Task_Order_Sequence(self): | 50 | def test_Task_Order_Sequence(self): |
60 | cnt_err = [] | 51 | cnt_err = [] |
@@ -98,7 +89,6 @@ class BuildCoreImageMinimal(BuildTest): | |||
98 | 'task_name', | 89 | 'task_name', |
99 | 'sstate_result') | 90 | 'sstate_result') |
100 | cnt_err = [] | 91 | cnt_err = [] |
101 | |||
102 | for task in tasks: | 92 | for task in tasks: |
103 | if (task['sstate_result'] != Task.SSTATE_NA and | 93 | if (task['sstate_result'] != Task.SSTATE_NA and |
104 | task['sstate_result'] != Task.SSTATE_MISS): | 94 | task['sstate_result'] != Task.SSTATE_MISS): |
@@ -221,6 +211,7 @@ class BuildCoreImageMinimal(BuildTest): | |||
221 | # orm_build.outcome=0 then if the file exists and its size matches | 211 | # orm_build.outcome=0 then if the file exists and its size matches |
222 | # the file_size value. Need to add the tc in the test run | 212 | # the file_size value. Need to add the tc in the test run |
223 | def test_Target_File_Name_Populated(self): | 213 | def test_Target_File_Name_Populated(self): |
214 | cnt_err = [] | ||
224 | builds = Build.objects.filter(outcome=0).values('id') | 215 | builds = Build.objects.filter(outcome=0).values('id') |
225 | for build in builds: | 216 | for build in builds: |
226 | targets = Target.objects.filter( | 217 | targets = Target.objects.filter( |
@@ -230,7 +221,6 @@ class BuildCoreImageMinimal(BuildTest): | |||
230 | target_id=target['id']).values('id', | 221 | target_id=target['id']).values('id', |
231 | 'file_name', | 222 | 'file_name', |
232 | 'file_size') | 223 | 'file_size') |
233 | cnt_err = [] | ||
234 | for file_info in target_files: | 224 | for file_info in target_files: |
235 | target_id = file_info['id'] | 225 | target_id = file_info['id'] |
236 | target_file_name = file_info['file_name'] | 226 | target_file_name = file_info['file_name'] |