summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/_toaster.py94
-rw-r--r--meta/lib/oeqa/selftest/bbtests.py27
-rw-r--r--meta/lib/oeqa/selftest/buildoptions.py29
-rw-r--r--meta/lib/oeqa/selftest/devtool.py241
-rw-r--r--meta/lib/oeqa/selftest/oescripts.py12
-rw-r--r--meta/lib/oeqa/selftest/prservice.py10
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py35
7 files changed, 384 insertions, 64 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")
import toastermain.settings
from django.db.models import Q
from orm.models import *
+from oeqa.utils.decorators import testcase
class ToasterSetup(oeSelfTest):
@@ -31,19 +32,22 @@ class ToasterSetup(oeSelfTest):
class Toaster_DB_Tests(ToasterSetup):
# Check if build name is unique - tc_id=795
- def test_Build_Unique_Name_TC795(self):
+ @testcase(795)
+ def test_Build_Unique_Name(self):
all_builds = Build.objects.all().count()
distinct_builds = Build.objects.values('id').distinct().count()
self.assertEqual(distinct_builds, all_builds, msg = 'Build name is not unique')
# Check if build coocker log path is unique - tc_id=819
- def test_Build_Unique_Cooker_Log_Path_TC819(self):
+ @testcase(819)
+ def test_Build_Unique_Cooker_Log_Path(self):
distinct_path = Build.objects.values('cooker_log_path').distinct().count()
total_builds = Build.objects.values('id').count()
self.assertEqual(distinct_path, total_builds, msg = 'Build coocker log path is not unique')
# Check if the number of errors matches the number of orm_logmessage.level entries with value 2 - tc_id=820
- def test_Build_Errors_No_TC820(self):
+ @testcase(820)
+ def test_Build_Errors_No(self):
builds = Build.objects.values('id', 'errors_no')
cnt_err = []
for build in builds:
@@ -53,7 +57,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
# Check if the number of warnings matches the number of orm_logmessage.level entries with value 1 - tc=821
- def test_Build_Warnings_No_TC821(self):
+ @testcase(821)
+ def test_Build_Warnings_No(self):
builds = Build.objects.values('id', 'warnings_no')
cnt_err = []
for build in builds:
@@ -63,7 +68,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
# Check if the build succeeded then the errors_no is 0 - tc_id=822
- def test_Build_Suceeded_Errors_No_TC822(self):
+ @testcase(822)
+ def test_Build_Suceeded_Errors_No(self):
builds = Build.objects.filter(outcome = 0).values('id', 'errors_no')
cnt_err = []
for build in builds:
@@ -71,8 +77,9 @@ class Toaster_DB_Tests(ToasterSetup):
cnt_err.append(build['id'])
self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
- # Check if task order is unique for one build - tc=824
- def test_Task_Unique_Order_TC824(self):
+ # Check if task order is unique for one build - tc=824
+ @testcase(824)
+ def test_Task_Unique_Order(self):
builds = Build.objects.values('id')
cnt_err = []
for build in builds:
@@ -83,7 +90,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
# Check task order sequence for one build - tc=825
- def test_Task_Order_Sequence_TC825(self):
+ @testcase(825)
+ def test_Task_Order_Sequence(self):
builds = builds = Build.objects.values('id')
cnt_err = []
for build in builds:
@@ -100,7 +108,8 @@ class Toaster_DB_Tests(ToasterSetup):
#def test_Task_Disk_IO_TC828(self):
# Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832
- def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3_TC832(self):
+ @testcase(832)
+ def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self):
tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result')
cnt_err = []
for task in tasks:
@@ -109,7 +118,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must be 0 (SSTATE_NA) - tc=833
- def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0_TC833(self):
+ @testcase(833)
+ def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result')
cnt_err = []
for task in tasks:
@@ -118,7 +128,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834
- def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2_TC834(self):
+ @testcase(834)
+ def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self):
tasks = Task.objects.filter(outcome__in = (0, 4)).values('id', 'sstate_result')
cnt_err = []
for task in tasks:
@@ -127,7 +138,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2 (CODING_PYTHON), 3 (CODING_SHELL) - tc=891
- def test_Task_If_Task_Executed_True_Script_Type_0_2_3_TC891(self):
+ @testcase(891)
+ def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self):
tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type')
cnt_err = []
for task in tasks:
@@ -136,7 +148,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4 (FAILED) - tc=836
- def test_Task_If_Task_Executed_True_Outcome_0_4_TC836(self):
+ @testcase(836)
+ def test_Task_If_Task_Executed_True_Outcome_0_4(self):
tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome')
cnt_err = []
for task in tasks:
@@ -145,7 +158,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Check if task_executed = FALSE (0), script_type must be 0 - tc=890
- def test_Task_If_Task_Executed_False_Script_Type_0_TC890(self):
+ @testcase(890)
+ def test_Task_If_Task_Executed_False_Script_Type_0(self):
tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type')
cnt_err = []
for task in tasks:
@@ -154,7 +168,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# 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
- def test_Task_If_Task_Executed_False_Outcome_1_2_3_5_TC837(self):
+ @testcase(837)
+ def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self):
builds = Build.objects.filter(outcome = 0).values('id')
cnt_err = []
for build in builds:
@@ -165,7 +180,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
# Key verification - tc=888
- def test_Target_Installed_Package_TC888(self):
+ @testcase(888)
+ def test_Target_Installed_Package(self):
rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id')
cnt_err = []
for row in rows:
@@ -176,7 +192,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for target installed package id: %s' % cnt_err)
# Key verification - tc=889
- def test_Task_Dependency_TC889(self):
+ @testcase(889)
+ def test_Task_Dependency(self):
rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id')
cnt_err = []
for row in rows:
@@ -188,6 +205,7 @@ class Toaster_DB_Tests(ToasterSetup):
# 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
### Need to add the tc in the test run
+ @testcase(1037)
def test_Target_File_Name_Populated(self):
builds = Build.objects.filter(outcome = 0).values('id')
for build in builds:
@@ -210,7 +228,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for target image file id: %s' % cnt_err)
# Key verification - tc=884
- def test_Package_Dependency_TC884(self):
+ @testcase(884)
+ def test_Package_Dependency(self):
cnt_err = []
deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id')
for dep in deps:
@@ -219,7 +238,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for package dependency id: %s' % cnt_err)
# Check if recipe name does not start with a number (0-9) - tc=838
- def test_Recipe_Name_TC838(self):
+ @testcase(838)
+ def test_Recipe_Name(self):
recipes = Recipe.objects.values('id', 'name')
cnt_err = []
for recipe in recipes:
@@ -228,7 +248,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
# Check if recipe section matches the content of the SECTION variable (if set) in file_path - tc=839
- def test_Recipe_DB_Section_Match_Recipe_File_Section_TC839(self):
+ @testcase(839)
+ def test_Recipe_DB_Section_Match_Recipe_File_Section(self):
recipes = Recipe.objects.values('id', 'section', 'file_path')
cnt_err = []
for recipe in recipes:
@@ -245,7 +266,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
# Check if recipe license matches the content of the LICENSE variable (if set) in file_path - tc=840
- def test_Recipe_DB_License_Match_Recipe_File_License_TC840(self):
+ @testcase(840)
+ def test_Recipe_DB_License_Match_Recipe_File_License(self):
recipes = Recipe.objects.values('id', 'license', 'file_path')
cnt_err = []
for recipe in recipes:
@@ -262,7 +284,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
# Check if recipe homepage matches the content of the HOMEPAGE variable (if set) in file_path - tc=841
- def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage_TC841(self):
+ @testcase(841)
+ def test_Recipe_DB_Homepage_Match_Recipe_File_Homepage(self):
recipes = Recipe.objects.values('id', 'homepage', 'file_path')
cnt_err = []
for recipe in recipes:
@@ -279,7 +302,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
# Check if recipe bugtracker matches the content of the BUGTRACKER variable (if set) in file_path - tc=842
- def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker_TC842(self):
+ @testcase(842)
+ def test_Recipe_DB_Bugtracker_Match_Recipe_File_Bugtracker(self):
recipes = Recipe.objects.values('id', 'bugtracker', 'file_path')
cnt_err = []
for recipe in recipes:
@@ -296,7 +320,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe id: %s' % cnt_err)
# Recipe key verification, recipe name does not depends on a recipe having the same name - tc=883
- def test_Recipe_Dependency_TC883(self):
+ @testcase(883)
+ def test_Recipe_Dependency(self):
deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id')
cnt_err = []
for dep in deps:
@@ -310,7 +335,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe dependency id: %s' % cnt_err)
# Check if package name does not start with a number (0-9) - tc=846
- def test_Package_Name_For_Number_TC846(self):
+ @testcase(846)
+ def test_Package_Name_For_Number(self):
packages = Package.objects.filter(~Q(size = -1)).values('id', 'name')
cnt_err = []
for package in packages:
@@ -319,7 +345,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
# Check if package version starts with a number (0-9) - tc=847
- def test_Package_Version_Starts_With_Number_TC847(self):
+ @testcase(847)
+ def test_Package_Version_Starts_With_Number(self):
packages = Package.objects.filter(~Q(size = -1)).values('id', 'version')
cnt_err = []
for package in packages:
@@ -328,7 +355,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
# Check if package revision starts with 'r' - tc=848
- def test_Package_Revision_Starts_With_r_TC848(self):
+ @testcase(848)
+ def test_Package_Revision_Starts_With_r(self):
packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision')
cnt_err = []
for package in packages:
@@ -338,6 +366,7 @@ class Toaster_DB_Tests(ToasterSetup):
# Check the validity of the package build_id
### TC must be added in test run
+ @testcase(1038)
def test_Package_Build_Id(self):
packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id')
cnt_err = []
@@ -349,6 +378,7 @@ class Toaster_DB_Tests(ToasterSetup):
# Check the validity of package recipe_id
### TC must be added in test run
+ @testcase(1039)
def test_Package_Recipe_Id(self):
packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id')
cnt_err = []
@@ -360,6 +390,7 @@ class Toaster_DB_Tests(ToasterSetup):
# Check if package installed_size field is not null
### TC must be aded in test run
+ @testcase(1040)
def test_Package_Installed_Size_Not_NULL(self):
packages = Package.objects.filter(installed_size__isnull = True).values('id')
cnt_err = []
@@ -368,7 +399,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
# Check if all layers requests return exit code is 200 - tc=843
- def test_Layers_Requests_Exit_Code_TC843(self):
+ @testcase(843)
+ def test_Layers_Requests_Exit_Code(self):
layers = Layer.objects.values('id', 'layer_index_url')
cnt_err = []
for layer in layers:
@@ -378,7 +410,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
# Check if the output of bitbake-layers show_layers matches the info from database - tc=895
- def test_Layers_Show_Layers_TC895(self):
+ @testcase(895)
+ def test_Layers_Show_Layers(self):
layers = Layer.objects.values('id', 'name', 'local_path')
cmd = commands.getoutput('bitbake-layers show_layers')
cnt_err = []
@@ -388,7 +421,8 @@ class Toaster_DB_Tests(ToasterSetup):
self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
# Check if django server starts regardless of the timezone set on the machine - tc=905
- def test_Start_Django_Timezone_TC905(self):
+ @testcase(905)
+ def test_Start_Django_Timezone(self):
current_path = os.getcwd()
zonefilelist = []
ZONEINFOPATH = '/usr/share/zoneinfo/'
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py
index d730bfd755..5708d3dc9b 100644
--- a/meta/lib/oeqa/selftest/bbtests.py
+++ b/meta/lib/oeqa/selftest/bbtests.py
@@ -7,28 +7,33 @@ import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
class BitbakeTests(oeSelfTest):
+ @testcase(789)
def test_run_bitbake_from_dir_1(self):
os.chdir(os.path.join(self.builddir, 'conf'))
bitbake('-e')
+ @testcase(790)
def test_run_bitbake_from_dir_2(self):
my_env = os.environ.copy()
my_env['BBPATH'] = my_env['BUILDDIR']
os.chdir(os.path.dirname(os.environ['BUILDDIR']))
bitbake('-e', env=my_env)
+ @testcase(806)
def test_event_handler(self):
self.write_config("INHERIT += \"test_events\"")
result = bitbake('m4-native')
- find_build_started = re.search("NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Preparing runqueue", result.output)
+ find_build_started = re.search("NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Preparing RunQueue", result.output)
find_build_completed = re.search("Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output)
self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output)
self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output)
self.assertFalse('Test for bb.event.InvalidEvent' in result.output)
+ @testcase(103)
def test_local_sstate(self):
bitbake('m4-native -ccleansstate')
bitbake('m4-native')
@@ -37,14 +42,17 @@ class BitbakeTests(oeSelfTest):
find_setscene = re.search("m4-native.*do_.*_setscene", result.output)
self.assertTrue(find_setscene)
+ @testcase(105)
def test_bitbake_invalid_recipe(self):
result = bitbake('-b asdf', ignore_status=True)
self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output)
+ @testcase(107)
def test_bitbake_invalid_target(self):
result = bitbake('asdf', ignore_status=True)
self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output)
+ @testcase(106)
def test_warnings_errors(self):
result = bitbake('-b asdf', ignore_status=True)
find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output)
@@ -52,6 +60,7 @@ class BitbakeTests(oeSelfTest):
self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output)
self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output)
+ @testcase(108)
def test_invalid_patch(self):
self.write_recipeinc('man', 'SRC_URI += "file://man-1.5h1-make.patch"')
result = bitbake('man -c patch', ignore_status=True)
@@ -59,14 +68,17 @@ class BitbakeTests(oeSelfTest):
bitbake('-cclean man')
self.assertTrue("ERROR: Function failed: patch_do_patch" in result.output)
+ @testcase(163)
def test_force_task(self):
bitbake('m4-native')
+ self.add_command_to_tearDown('bitbake -c clean m4-native')
result = bitbake('-C compile m4-native')
look_for_tasks = ['do_compile', 'do_install', 'do_populate_sysroot']
for task in look_for_tasks:
find_task = re.search("m4-native.*%s" % task, result.output)
self.assertTrue(find_task)
+ @testcase(167)
def test_bitbake_g(self):
result = bitbake('-g core-image-full-cmdline')
self.assertTrue('NOTE: PN build list saved to \'pn-buildlist\'' in result.output)
@@ -74,6 +86,7 @@ class BitbakeTests(oeSelfTest):
for f in ['pn-buildlist', 'pn-depends.dot', 'package-depends.dot', 'task-depends.dot']:
os.remove(f)
+ @testcase(899)
def test_image_manifest(self):
bitbake('core-image-minimal')
deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
@@ -81,6 +94,7 @@ class BitbakeTests(oeSelfTest):
manifest = os.path.join(deploydir, imagename + ".manifest")
self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image")
+ @testcase(168)
def test_invalid_recipe_src_uri(self):
data = 'SRC_URI = "file://invalid"'
self.write_recipeinc('man', data)
@@ -89,9 +103,10 @@ class BitbakeTests(oeSelfTest):
bitbake('-ccleanall man')
self.delete_recipeinc('man')
self.assertEqual(result.status, 1, msg='Command succeded when it should have failed')
- self.assertTrue('ERROR: Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output)
+ self.assertTrue('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output)
self.assertTrue('ERROR: Function failed: Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.' in result.output)
+ @testcase(171)
def test_rename_downloaded_file(self):
data = 'SRC_URI_append = ";downloadfilename=test-aspell.tar.gz"'
self.write_recipeinc('aspell', data)
@@ -103,25 +118,30 @@ class BitbakeTests(oeSelfTest):
self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz.done')))
bitbake('-ccleanall aspell')
+ @testcase(1028)
def test_environment(self):
self.append_config("TEST_ENV=\"localconf\"")
result = runCmd('bitbake -e | grep TEST_ENV=')
self.assertTrue('localconf' in result.output)
self.remove_config("TEST_ENV=\"localconf\"")
+ @testcase(1029)
def test_dry_run(self):
result = runCmd('bitbake -n m4-native')
self.assertEqual(0, result.status)
+ @testcase(1030)
def test_just_parse(self):
result = runCmd('bitbake -p')
self.assertEqual(0, result.status)
+ @testcase(1031)
def test_version(self):
result = runCmd('bitbake -s | grep wget')
find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output)
self.assertTrue(find)
+ @testcase(1032)
def test_prefile(self):
preconf = os.path.join(self.builddir, 'conf/prefile.conf')
self.track_for_cleanup(preconf)
@@ -133,6 +153,7 @@ class BitbakeTests(oeSelfTest):
self.assertTrue('localconf' in result.output)
self.remove_config("TEST_PREFILE=\"localconf\"")
+ @testcase(1033)
def test_postfile(self):
postconf = os.path.join(self.builddir, 'conf/postfile.conf')
self.track_for_cleanup(postconf)
@@ -142,10 +163,12 @@ class BitbakeTests(oeSelfTest):
self.assertTrue('postfile' in result.output)
self.remove_config("TEST_POSTFILE=\"localconf\"")
+ @testcase(1034)
def test_checkuri(self):
result = runCmd('bitbake -c checkuri m4')
self.assertEqual(0, result.status)
+ @testcase(1035)
def test_continue(self):
self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" )
runCmd('bitbake -c cleanall man xcursor-transparent-theme')
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index 27fc452e72..926ffe9993 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -7,21 +7,30 @@ from oeqa.selftest.base import oeSelfTest
from oeqa.selftest.buildhistory import BuildhistoryBase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
import oeqa.utils.ftools as ftools
+from oeqa.utils.decorators import testcase
class ImageOptionsTests(oeSelfTest):
+ @testcase(761)
def test_incremental_image_generation(self):
+ image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
+ if image_pkgtype != 'rpm':
+ self.skipTest('Not using RPM as main package format')
bitbake("-c cleanall core-image-minimal")
self.write_config('INC_RPM_IMAGE_GEN = "1"')
self.append_config('IMAGE_FEATURES += "ssh-server-openssh"')
bitbake("core-image-minimal")
- res = runCmd("grep 'Installing openssh-sshd' %s" % (os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")), ignore_status=True)
+ log_data_file = os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")
+ log_data_created = ftools.read_file(log_data_file)
+ incremental_created = re.search("NOTE: load old install solution for incremental install\nNOTE: old install solution not exist\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: Installing the following packages:.*packagegroup-core-ssh-openssh", log_data_created)
self.remove_config('IMAGE_FEATURES += "ssh-server-openssh"')
- self.assertEqual(0, res.status, msg="No match for openssh-sshd in log.do_rootfs")
+ self.assertTrue(incremental_created, msg = "Match failed in:\n%s" % log_data_created)
bitbake("core-image-minimal")
- res = runCmd("grep 'Removing openssh-sshd' %s" %(os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")),ignore_status=True)
- self.assertEqual(0, res.status, msg="openssh-sshd was not removed from image")
+ log_data_removed = ftools.read_file(log_data_file)
+ incremental_removed = re.search("NOTE: load old install solution for incremental install\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: incremental removed:.*openssh-sshd-.*", log_data_removed)
+ self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
+ @testcase(925)
def test_rm_old_image(self):
bitbake("core-image-minimal")
deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
@@ -37,6 +46,7 @@ class ImageOptionsTests(oeSelfTest):
remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files]
self.assertFalse(remaining_not_expected, msg="\nThe following image files ware not removed: %s" % ', '.join(map(str, remaining_not_expected)))
+ @testcase(286)
def test_ccache_tool(self):
bitbake("ccache-native")
self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")))
@@ -50,6 +60,7 @@ class ImageOptionsTests(oeSelfTest):
class DiskMonTest(oeSelfTest):
+ @testcase(277)
def test_stoptask_behavior(self):
self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"')
res = bitbake("m4", ignore_status = True)
@@ -65,6 +76,7 @@ class DiskMonTest(oeSelfTest):
class SanityOptionsTest(oeSelfTest):
+ @testcase(927)
def test_options_warnqa_errorqa_switch(self):
bitbake("xcursor-transparent-theme -ccleansstate")
@@ -74,16 +86,17 @@ class SanityOptionsTest(oeSelfTest):
self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
res = bitbake("xcursor-transparent-theme", ignore_status=True)
self.delete_recipeinc('xcursor-transparent-theme')
- self.assertTrue("ERROR: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output)
+ self.assertTrue("ERROR: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output)
self.assertEqual(res.status, 1)
self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
self.append_config('ERROR_QA_remove = "packages-list"')
self.append_config('WARN_QA_append = " packages-list"')
- res = bitbake("xcursor-transparent-theme")
bitbake("xcursor-transparent-theme -ccleansstate")
+ res = bitbake("xcursor-transparent-theme")
self.delete_recipeinc('xcursor-transparent-theme')
- self.assertTrue("WARNING: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output)
+ self.assertTrue("WARNING: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output)
+ @testcase(278)
def test_sanity_userspace_dependency(self):
self.append_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"')
bitbake("-ccleansstate gzip nfs-utils")
@@ -93,10 +106,12 @@ class SanityOptionsTest(oeSelfTest):
class BuildhistoryTests(BuildhistoryBase):
+ @testcase(293)
def test_buildhistory_basic(self):
self.run_buildhistory_operation('xcursor-transparent-theme')
self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')))
+ @testcase(294)
def test_buildhistory_buildtime_pr_backwards(self):
self.add_command_to_tearDown('cleanup-workdir')
target = 'xcursor-transparent-theme'
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
new file mode 100644
index 0000000000..74fb325803
--- /dev/null
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -0,0 +1,241 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+import tempfile
+import glob
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class DevtoolTests(oeSelfTest):
+
+ def test_create_workspace(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertTrue('/workspace' not in result.output, 'This test cannot be run with a workspace layer in bblayers.conf')
+ # Try creating a workspace layer with a specific path
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ result = runCmd('devtool create-workspace %s' % tempdir)
+ self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')))
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn(tempdir, result.output)
+ # Try creating a workspace layer with the default path
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool create-workspace')
+ self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf')))
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn(tempdir, result.output)
+ self.assertIn(workspacedir, result.output)
+
+ def test_recipetool_create(self):
+ # Try adding a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ tempsrc = os.path.join(tempdir, 'srctree')
+ os.makedirs(tempsrc)
+ recipefile = os.path.join(tempdir, 'logrotate_3.8.7.bb')
+ srcuri = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz'
+ result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = 'GPLv2'
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=18810669f13b87348459e611d31ab760'
+ checkvars['SRC_URI'] = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz'
+ checkvars['SRC_URI[md5sum]'] = '99e08503ef24c3e2e3ff74cc5f3be213'
+ checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64'
+ with open(recipefile, 'r') as f:
+ for line in f:
+ if '=' in line:
+ splitline = line.split('=', 1)
+ var = splitline[0].rstrip()
+ value = splitline[1].strip().strip('"')
+ if var in checkvars:
+ needvalue = checkvars.pop(var)
+ self.assertEqual(value, needvalue)
+ if line.startswith('inherit '):
+ inherits = line.split()[1:]
+
+ self.assertEqual(checkvars, {}, 'Some variables not found')
+
+ def test_recipetool_create_git(self):
+ # Ensure we have the right data in shlibs/pkgdata
+ bitbake('libpng pango libx11 libxext')
+ # Try adding a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ tempsrc = os.path.join(tempdir, 'srctree')
+ os.makedirs(tempsrc)
+ recipefile = os.path.join(tempdir, 'libmatchbox.bb')
+ srcuri = 'git://git.yoctoproject.org/libmatchbox'
+ result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
+ self.assertTrue(os.path.isfile(recipefile), 'recipetool did not create recipe file; output:\n%s' % result.output)
+ checkvars = {}
+ checkvars['LICENSE'] = 'LGPLv2.1'
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34'
+ checkvars['S'] = '${WORKDIR}/git'
+ checkvars['PV'] = '1.0+git${SRCPV}'
+ checkvars['SRC_URI'] = srcuri
+ checkvars['DEPENDS'] = 'libpng pango libx11 libxext'
+ inherits = []
+ with open(recipefile, 'r') as f:
+ for line in f:
+ if '=' in line:
+ splitline = line.split('=', 1)
+ var = splitline[0].rstrip()
+ value = splitline[1].strip().strip('"')
+ if var in checkvars:
+ needvalue = checkvars.pop(var)
+ self.assertEqual(value, needvalue)
+ if line.startswith('inherit '):
+ inherits = line.split()[1:]
+
+ self.assertEqual(checkvars, {}, 'Some variables not found')
+
+ self.assertIn('autotools', inherits, 'Missing inherit of autotools')
+ self.assertIn('pkgconfig', inherits, 'Missing inherit of pkgconfig')
+
+ def test_devtool_add(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ url = 'http://www.ivarch.com/programs/sources/pv-1.5.3.tar.bz2'
+ result = runCmd('wget %s' % url, cwd=tempdir)
+ result = runCmd('tar xfv pv-1.5.3.tar.bz2', cwd=tempdir)
+ srcdir = os.path.join(tempdir, 'pv-1.5.3')
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory')
+ # Test devtool add
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake -c cleansstate pv')
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add pv %s' % srcdir)
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn('pv', result.output)
+ self.assertIn(srcdir, result.output)
+ # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
+ bitbake('pv -c cleansstate')
+ # Test devtool build
+ result = runCmd('devtool build pv')
+ installdir = get_bb_var('D', 'pv')
+ self.assertTrue(installdir, 'Could not query installdir variable')
+ bindir = get_bb_var('bindir', 'pv')
+ self.assertTrue(bindir, 'Could not query bindir variable')
+ if bindir[0] == '/':
+ bindir = bindir[1:]
+ self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D')
+
+ def test_devtool_modify(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('mdadm -c cleansstate')
+ # Try modifying a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean mdadm')
+ result = runCmd('devtool modify mdadm -x %s' % tempdir)
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
+ self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ matches = glob.glob(os.path.join(workspacedir, 'appends', 'mdadm_*.bbappend'))
+ self.assertTrue(matches, 'bbappend not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn('mdadm', result.output)
+ self.assertIn(tempdir, result.output)
+ # Check git repo
+ result = runCmd('git status --porcelain', cwd=tempdir)
+ self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+ result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+ self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+ # Try building
+ bitbake('mdadm')
+ # Try making (minor) modifications to the source
+ result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
+ bitbake('mdadm -c package')
+ pkgd = get_bb_var('PKGD', 'mdadm')
+ self.assertTrue(pkgd, 'Could not query PKGD variable')
+ mandir = get_bb_var('mandir', 'mdadm')
+ self.assertTrue(mandir, 'Could not query mandir variable')
+ if mandir[0] == '/':
+ mandir = mandir[1:]
+ with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
+ for line in f:
+ if line.startswith('.TH'):
+ self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified')
+ # Test devtool reset
+ result = runCmd('devtool reset mdadm')
+ result = runCmd('devtool status')
+ self.assertNotIn('mdadm', result.output)
+
+ def test_devtool_update_recipe(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ testrecipe = 'minicom'
+ recipefile = get_bb_var('FILE', testrecipe)
+ result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+ self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+ # First, modify a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # Check git repo
+ self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+ result = runCmd('git status --porcelain', cwd=tempdir)
+ self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+ result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+ self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+ # Add a couple of commits
+ # FIXME: this only tests adding, need to also test update and remove
+ result = runCmd('echo "Additional line" >> README', cwd=tempdir)
+ result = runCmd('git commit -a -m "Change the README"', cwd=tempdir)
+ result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
+ result = runCmd('git add devtool-new-file', cwd=tempdir)
+ result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
+ self.add_command_to_tearDown('cd %s; rm %s/*.patch; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+ self.assertNotEqual(result.output.strip(), "", '%s recipe should be modified' % testrecipe)
+ status = result.output.splitlines()
+ self.assertEqual(len(status), 3, 'Less/more files modified than expected. Entire status:\n%s' % result.output)
+ for line in status:
+ if line.endswith('0001-Change-the-README.patch'):
+ self.assertEqual(line[:3], '?? ', 'Unexpected status in line: %s' % line)
+ elif line.endswith('0002-Add-a-new-file.patch'):
+ self.assertEqual(line[:3], '?? ', 'Unexpected status in line: %s' % line)
+ elif re.search('minicom_[^_]*.bb$', line):
+ self.assertEqual(line[:3], ' M ', 'Unexpected status in line: %s' % line)
+ else:
+ raise AssertionError('Unexpected modified file in status: %s' % line)
+
+ def test_devtool_extract(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ # Try devtool extract
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool extract remake %s' % tempdir)
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
+ self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
diff --git a/meta/lib/oeqa/selftest/oescripts.py b/meta/lib/oeqa/selftest/oescripts.py
index 4aab2ed095..31cd50809c 100644
--- a/meta/lib/oeqa/selftest/oescripts.py
+++ b/meta/lib/oeqa/selftest/oescripts.py
@@ -8,9 +8,11 @@ import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.selftest.buildhistory import BuildhistoryBase
from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.decorators import testcase
class TestScripts(oeSelfTest):
+ @testcase(300)
def test_cleanup_workdir(self):
path = os.path.dirname(get_bb_var('WORKDIR', 'gzip'))
old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta/recipes-extended/gzip/gzip_1.3.12.bb')
@@ -41,6 +43,7 @@ class TestScripts(oeSelfTest):
class BuildhistoryDiffTests(BuildhistoryBase):
+ @testcase(295)
def test_buildhistory_diff(self):
self.add_command_to_tearDown('cleanup-workdir')
target = 'xcursor-transparent-theme'
@@ -49,12 +52,3 @@ class BuildhistoryDiffTests(BuildhistoryBase):
result = runCmd("buildhistory-diff -p %s" % get_bb_var('BUILDHISTORY_DIR'))
expected_output = 'PR changed from "r1" to "r0"'
self.assertTrue(expected_output in result.output, msg="Did not find expected output: %s" % result.output)
-
-
-
-
-
-
-
-
-
diff --git a/meta/lib/oeqa/selftest/prservice.py b/meta/lib/oeqa/selftest/prservice.py
index 789c05f1e5..fb6d68d3bf 100644
--- a/meta/lib/oeqa/selftest/prservice.py
+++ b/meta/lib/oeqa/selftest/prservice.py
@@ -8,6 +8,7 @@ import datetime
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
class BitbakePrTests(oeSelfTest):
@@ -87,27 +88,34 @@ class BitbakePrTests(oeSelfTest):
bitbake("-ccleansstate %s" % package_name)
self.assertTrue(pr_2 - pr_1 == 1)
-
+ @testcase(930)
def test_import_export_replace_db(self):
self.run_test_pr_export_import('m4')
+ @testcase(931)
def test_import_export_override_db(self):
self.run_test_pr_export_import('m4', replace_current_db=False)
+ @testcase(932)
def test_pr_service_rpm_arch_dep(self):
self.run_test_pr_service('m4', 'rpm', 'do_package')
+ @testcase(934)
def test_pr_service_deb_arch_dep(self):
self.run_test_pr_service('m4', 'deb', 'do_package')
+ @testcase(933)
def test_pr_service_ipk_arch_dep(self):
self.run_test_pr_service('m4', 'ipk', 'do_package')
+ @testcase(935)
def test_pr_service_rpm_arch_indep(self):
self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package')
+ @testcase(937)
def test_pr_service_deb_arch_indep(self):
self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package')
+ @testcase(936)
def test_pr_service_ipk_arch_indep(self):
self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package')
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 44dcea847f..d578ddd489 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -8,7 +8,7 @@ import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.selftest.sstate import SStateBase
-
+from oeqa.utils.decorators import testcase
class SStateTests(SStateBase):
@@ -28,19 +28,23 @@ class SStateTests(SStateBase):
else:
self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s" % ', '.join(map(str, targets)))
+ @testcase(975)
def test_sstate_creation_distro_specific_pass(self):
targetarch = get_bb_var('TUNE_ARCH')
self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+ @testcase(975)
def test_sstate_creation_distro_specific_fail(self):
targetarch = get_bb_var('TUNE_ARCH')
self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
+ @testcase(976)
def test_sstate_creation_distro_nonspecific_pass(self):
- self.run_test_sstate_creation(['eglibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+ self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+ @testcase(976)
def test_sstate_creation_distro_nonspecific_fail(self):
- self.run_test_sstate_creation(['eglibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
+ self.run_test_sstate_creation(['glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
# Test the sstate files deletion part of the do_cleansstate task
@@ -60,16 +64,19 @@ class SStateTests(SStateBase):
tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s" % ', '.join(map(str, targets)))
+ @testcase(977)
def test_cleansstate_task_distro_specific_nonspecific(self):
targetarch = get_bb_var('TUNE_ARCH')
- self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'eglibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+ self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+ @testcase(977)
def test_cleansstate_task_distro_nonspecific(self):
- self.run_test_cleansstate_task(['eglibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+ self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+ @testcase(977)
def test_cleansstate_task_distro_specific(self):
targetarch = get_bb_var('TUNE_ARCH')
- self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'eglibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+ self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
# Test rebuilding of distro-specific sstate files
@@ -98,14 +105,17 @@ class SStateTests(SStateBase):
created_once = [x for x in file_tracker_2 if x not in file_tracker_1]
self.assertTrue(created_once == [], msg="The following sstate files ware created only in the second run: %s" % ', '.join(map(str, created_once)))
+ @testcase(175)
def test_rebuild_distro_specific_sstate_cross_native_targets(self):
targetarch = get_bb_var('TUNE_ARCH')
self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True)
+ @testcase(175)
def test_rebuild_distro_specific_sstate_cross_target(self):
targetarch = get_bb_var('TUNE_ARCH')
self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True)
+ @testcase(175)
def test_rebuild_distro_specific_sstate_native_target(self):
self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True)
@@ -153,7 +163,7 @@ class SStateTests(SStateBase):
expected_not_actual = [x for x in expected_remaining_sstate if x not in actual_remaining_sstate]
self.assertFalse(expected_not_actual, msg="Extra files ware removed: %s" ', '.join(map(str, expected_not_actual)))
-
+ @testcase(973)
def test_sstate_cache_management_script_using_pr_1(self):
global_config = []
target_config = []
@@ -161,6 +171,7 @@ class SStateTests(SStateBase):
target_config.append('PR = "0"')
self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+ @testcase(978)
def test_sstate_cache_management_script_using_pr_2(self):
global_config = []
target_config = []
@@ -170,6 +181,7 @@ class SStateTests(SStateBase):
target_config.append('PR = "1"')
self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+ @testcase(979)
def test_sstate_cache_management_script_using_pr_3(self):
global_config = []
target_config = []
@@ -181,6 +193,7 @@ class SStateTests(SStateBase):
target_config.append('PR = "1"')
self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+ @testcase(974)
def test_sstate_cache_management_script_using_machine(self):
global_config = []
target_config = []
@@ -189,11 +202,3 @@ class SStateTests(SStateBase):
global_config.append('MACHINE = "qemux86"')
target_config.append('')
self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
-
-
-
-
-
-
-
-