Files
poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
Marlon Rodriguez Garcia ad2f5a359e bitbake: toaster/tests: Update build test
Updated build tests in toaster, added SSTATE_MIRROR to package build, changed build directory and update test order
This builds include the core-minimal-image, on the test enviroment a smaller package was use to run the test for time purposes

(Bitbake rev: af31116f0017912fc5a58a5976c814b6b326985f)

Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:17:42 +00:00

50 lines
1.6 KiB
Python

#! /usr/bin/env python3
#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
import pytest
from django.test import TestCase
from django.core import management
from orm.models import Layer_Version, Layer, Release, ToasterSetting
@pytest.mark.order(2)
class TestLoadDataFixtures(TestCase):
""" Test loading our 3 provided fixtures """
def test_run_loaddata_poky_command(self):
management.call_command('loaddata', 'poky')
num_releases = Release.objects.count()
self.assertTrue(
Layer_Version.objects.filter(
layer__name="meta-poky").count() == num_releases,
"Loaded poky fixture but don't have a meta-poky for all releases"
" defined")
def test_run_loaddata_oecore_command(self):
management.call_command('loaddata', 'oe-core')
# We only have the one layer for oe-core setup
self.assertTrue(
Layer.objects.filter(name="openembedded-core").count() > 0,
"Loaded oe-core fixture but still have no openemebedded-core"
" layer")
def test_run_loaddata_settings_command(self):
management.call_command('loaddata', 'settings')
self.assertTrue(
ToasterSetting.objects.filter(name="DEFAULT_RELEASE").count() > 0,
"Loaded settings but have no DEFAULT_RELEASE")
self.assertTrue(
ToasterSetting.objects.filter(
name__startswith="DEFCONF").count() > 0,
"Loaded settings but have no DEFCONF (default project "
"configuration values)")