diff options
Diffstat (limited to 'lib/toaster/tests/builds/test_core_image_min.py')
-rw-r--r-- | lib/toaster/tests/builds/test_core_image_min.py | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/lib/toaster/tests/builds/test_core_image_min.py b/lib/toaster/tests/builds/test_core_image_min.py index 586f4a8f7..c5bfdbfbb 100644 --- a/lib/toaster/tests/builds/test_core_image_min.py +++ b/lib/toaster/tests/builds/test_core_image_min.py @@ -1,28 +1,16 @@ -#! /usr/bin/env python -# ex:ts=4:sw=4:sts=4:et -# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +#! /usr/bin/env python3 # # BitBake Toaster Implementation # # Copyright (C) 2016 Intel Corporation # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - # Tests were part of openembedded-core oe selftest Authored by: Lucian Musat # Ionut Chisanovici, Paul Eggleton and Cristian Iorga import os +import pytest from django.db.models import Q @@ -33,12 +21,13 @@ from orm.models import CustomImagePackage from tests.builds.buildtest import BuildTest - +@pytest.mark.order(4) +@pytest.mark.django_db(True) class BuildCoreImageMinimal(BuildTest): """Build core-image-minimal and test the results""" def setUp(self): - self.completed_build = self.build("core-image-minimal") + self.completed_build = self.target_already_built("core-image-minimal") # Check if build name is unique - tc_id=795 def test_Build_Unique_Name(self): @@ -57,17 +46,6 @@ class BuildCoreImageMinimal(BuildTest): total_builds, msg='Build cooker log path is not unique') - # Check if task order is unique for one build - tc=824 - def test_Task_Unique_Order(self): - total_task_order = Task.objects.filter( - build=self.built).values('order').count() - distinct_task_order = Task.objects.filter( - build=self.completed_build).values('order').distinct().count() - - self.assertEqual(total_task_order, - distinct_task_order, - msg='Errors task order is not unique') - # Check task order sequence for one build - tc=825 def test_Task_Order_Sequence(self): cnt_err = [] @@ -111,7 +89,6 @@ class BuildCoreImageMinimal(BuildTest): 'task_name', 'sstate_result') cnt_err = [] - for task in tasks: if (task['sstate_result'] != Task.SSTATE_NA and task['sstate_result'] != Task.SSTATE_MISS): @@ -234,6 +211,7 @@ class BuildCoreImageMinimal(BuildTest): # orm_build.outcome=0 then if the file exists and its size matches # the file_size value. Need to add the tc in the test run def test_Target_File_Name_Populated(self): + cnt_err = [] builds = Build.objects.filter(outcome=0).values('id') for build in builds: targets = Target.objects.filter( @@ -243,7 +221,6 @@ class BuildCoreImageMinimal(BuildTest): target_id=target['id']).values('id', 'file_name', 'file_size') - cnt_err = [] for file_info in target_files: target_id = file_info['id'] target_file_name = file_info['file_name'] |