summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-05-12 14:40:21 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-06 19:02:43 +0100
commit157c3be2ca93f076033f725ec1ee912df91f7488 (patch)
tree8ef896ff7adf78d63b34059cd5b017a4f0a3419a
parent10c512b60d1167122b5fe778b93838dca3def717 (diff)
downloadpoky-157c3be2ca93f076033f725ec1ee912df91f7488.tar.gz
oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
New framework has different classes/decorators so adapt current test cases to support these. Changes include changes on base classes and decorators. Also include paths in selftest/__init__.py isn't needed because the loader is the standard unittest one. (From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/__init__.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py (renamed from meta/lib/oeqa/selftest/_sstatetests_noauto.py)7
-rw-r--r--meta/lib/oeqa/selftest/cases/archiver.py (renamed from meta/lib/oeqa/selftest/archiver.py)14
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py (renamed from meta/lib/oeqa/selftest/bblayers.py)24
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py (renamed from meta/lib/oeqa/selftest/bbtests.py)57
-rw-r--r--meta/lib/oeqa/selftest/cases/buildhistory.py (renamed from meta/lib/oeqa/selftest/buildhistory.py)5
-rw-r--r--meta/lib/oeqa/selftest/cases/buildoptions.py (renamed from meta/lib/oeqa/selftest/buildoptions.py)34
-rw-r--r--meta/lib/oeqa/selftest/cases/containerimage.py (renamed from meta/lib/oeqa/selftest/containerimage.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py (renamed from meta/lib/oeqa/selftest/devtool.py)68
-rw-r--r--meta/lib/oeqa/selftest/cases/eSDK.py (renamed from meta/lib/oeqa/selftest/eSDK.py)18
-rw-r--r--meta/lib/oeqa/selftest/cases/image_typedep.py (renamed from meta/lib/oeqa/selftest/image_typedep.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py (renamed from meta/lib/oeqa/selftest/imagefeatures.py)16
-rw-r--r--meta/lib/oeqa/selftest/cases/layerappend.py (renamed from meta/lib/oeqa/selftest/layerappend.py)15
-rw-r--r--meta/lib/oeqa/selftest/cases/liboe.py (renamed from meta/lib/oeqa/selftest/liboe.py)7
-rw-r--r--meta/lib/oeqa/selftest/cases/lic_checksum.py (renamed from meta/lib/oeqa/selftest/lic-checksum.py)8
-rw-r--r--meta/lib/oeqa/selftest/cases/manifest.py (renamed from meta/lib/oeqa/selftest/manifest.py)52
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/__init__.py (renamed from meta/lib/oeqa/selftest/oelib/__init__.py)0
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/buildhistory.py (renamed from meta/lib/oeqa/selftest/oelib/buildhistory.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/elf.py (renamed from meta/lib/oeqa/selftest/oelib/elf.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/license.py (renamed from meta/lib/oeqa/selftest/oelib/license.py)6
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/path.py (renamed from meta/lib/oeqa/selftest/oelib/path.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/types.py (renamed from meta/lib/oeqa/selftest/oelib/types.py)6
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/utils.py (renamed from meta/lib/oeqa/selftest/oelib/utils.py)6
-rw-r--r--meta/lib/oeqa/selftest/cases/oescripts.py (renamed from meta/lib/oeqa/selftest/oescripts.py)15
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py (renamed from meta/lib/oeqa/selftest/package.py)4
-rw-r--r--meta/lib/oeqa/selftest/cases/pkgdata.py (renamed from meta/lib/oeqa/selftest/pkgdata.py)29
-rw-r--r--meta/lib/oeqa/selftest/cases/prservice.py (renamed from meta/lib/oeqa/selftest/prservice.py)27
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py (renamed from meta/lib/oeqa/selftest/recipetool.py)81
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py (renamed from meta/lib/oeqa/selftest/runqemu.py)31
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py (renamed from meta/lib/oeqa/selftest/runtime-test.py)15
-rw-r--r--meta/lib/oeqa/selftest/cases/signing.py (renamed from meta/lib/oeqa/selftest/signing.py)15
-rw-r--r--meta/lib/oeqa/selftest/cases/sstate.py (renamed from meta/lib/oeqa/selftest/sstate.py)5
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py (renamed from meta/lib/oeqa/selftest/sstatetests.py)46
-rw-r--r--meta/lib/oeqa/selftest/cases/tinfoil.py (renamed from meta/lib/oeqa/selftest/tinfoil.py)25
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py (renamed from meta/lib/oeqa/selftest/wic.py)84
35 files changed, 355 insertions, 387 deletions
diff --git a/meta/lib/oeqa/selftest/__init__.py b/meta/lib/oeqa/selftest/__init__.py
deleted file mode 100644
index 3ad9513f40..0000000000
--- a/meta/lib/oeqa/selftest/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
1from pkgutil import extend_path
2__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oeqa/selftest/_sstatetests_noauto.py b/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
index fc9ae7efb9..0e5896234c 100644
--- a/meta/lib/oeqa/selftest/_sstatetests_noauto.py
+++ b/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
@@ -1,19 +1,16 @@
1import datetime
2import unittest
3import os 1import os
4import re
5import shutil 2import shutil
6 3
7import oeqa.utils.ftools as ftools 4import oeqa.utils.ftools as ftools
8from oeqa.selftest.base import oeSelfTest
9from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer 5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
10from oeqa.selftest.sstate import SStateBase 6from oeqa.selftest.cases.sstate import SStateBase
11 7
12 8
13class RebuildFromSState(SStateBase): 9class RebuildFromSState(SStateBase):
14 10
15 @classmethod 11 @classmethod
16 def setUpClass(self): 12 def setUpClass(self):
13 super(RebuildFromSState, self).setUpClass()
17 self.builddir = os.path.join(os.environ.get('BUILDDIR')) 14 self.builddir = os.path.join(os.environ.get('BUILDDIR'))
18 15
19 def get_dep_targets(self, primary_targets): 16 def get_dep_targets(self, primary_targets):
diff --git a/meta/lib/oeqa/selftest/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index d7f215cbf6..70c7282f22 100644
--- a/meta/lib/oeqa/selftest/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -1,14 +1,12 @@
1from oeqa.selftest.base import oeSelfTest
2from oeqa.utils.commands import bitbake, get_bb_vars
3from oeqa.utils.decorators import testcase
4import glob
5import os 1import os
6import shutil 2import glob
7 3from oeqa.utils.commands import bitbake, get_bb_vars
4from oeqa.selftest.case import OESelftestTestCase
5from oeqa.core.decorator.oeid import OETestID
8 6
9class Archiver(oeSelfTest): 7class Archiver(OESelftestTestCase):
10 8
11 @testcase(1345) 9 @OETestID(1345)
12 def test_archiver_allows_to_filter_on_recipe_name(self): 10 def test_archiver_allows_to_filter_on_recipe_name(self):
13 """ 11 """
14 Summary: The archiver should offer the possibility to filter on the recipe. (#6929) 12 Summary: The archiver should offer the possibility to filter on the recipe. (#6929)
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index cd658c5d4e..90a2249b08 100644
--- a/meta/lib/oeqa/selftest/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -1,39 +1,37 @@
1import unittest
2import os 1import os
3import logging
4import re 2import re
5import shutil
6 3
7import oeqa.utils.ftools as ftools 4import oeqa.utils.ftools as ftools
8from oeqa.selftest.base import oeSelfTest
9from oeqa.utils.commands import runCmd, get_bb_var 5from oeqa.utils.commands import runCmd, get_bb_var
10from oeqa.utils.decorators import testcase
11 6
12class BitbakeLayers(oeSelfTest): 7from oeqa.selftest.case import OESelftestTestCase
8from oeqa.core.decorator.oeid import OETestID
13 9
14 @testcase(756) 10class BitbakeLayers(OESelftestTestCase):
11
12 @OETestID(756)
15 def test_bitbakelayers_showcrossdepends(self): 13 def test_bitbakelayers_showcrossdepends(self):
16 result = runCmd('bitbake-layers show-cross-depends') 14 result = runCmd('bitbake-layers show-cross-depends')
17 self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output) 15 self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output)
18 16
19 @testcase(83) 17 @OETestID(83)
20 def test_bitbakelayers_showlayers(self): 18 def test_bitbakelayers_showlayers(self):
21 result = runCmd('bitbake-layers show-layers') 19 result = runCmd('bitbake-layers show-layers')
22 self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output) 20 self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output)
23 21
24 @testcase(93) 22 @OETestID(93)
25 def test_bitbakelayers_showappends(self): 23 def test_bitbakelayers_showappends(self):
26 recipe = "xcursor-transparent-theme" 24 recipe = "xcursor-transparent-theme"
27 bb_file = self.get_recipe_basename(recipe) 25 bb_file = self.get_recipe_basename(recipe)
28 result = runCmd('bitbake-layers show-appends') 26 result = runCmd('bitbake-layers show-appends')
29 self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output)) 27 self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output))
30 28
31 @testcase(90) 29 @OETestID(90)
32 def test_bitbakelayers_showoverlayed(self): 30 def test_bitbakelayers_showoverlayed(self):
33 result = runCmd('bitbake-layers show-overlayed') 31 result = runCmd('bitbake-layers show-overlayed')
34 self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output) 32 self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output)
35 33
36 @testcase(95) 34 @OETestID(95)
37 def test_bitbakelayers_flatten(self): 35 def test_bitbakelayers_flatten(self):
38 recipe = "xcursor-transparent-theme" 36 recipe = "xcursor-transparent-theme"
39 recipe_path = "recipes-graphics/xcursor-transparent-theme" 37 recipe_path = "recipes-graphics/xcursor-transparent-theme"
@@ -48,7 +46,7 @@ class BitbakeLayers(oeSelfTest):
48 find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) 46 find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
49 self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) 47 self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
50 48
51 @testcase(1195) 49 @OETestID(1195)
52 def test_bitbakelayers_add_remove(self): 50 def test_bitbakelayers_add_remove(self):
53 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton') 51 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
54 result = runCmd('bitbake-layers show-layers') 52 result = runCmd('bitbake-layers show-layers')
@@ -66,7 +64,7 @@ class BitbakeLayers(oeSelfTest):
66 result = runCmd('bitbake-layers show-layers') 64 result = runCmd('bitbake-layers show-layers')
67 self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output) 65 self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output)
68 66
69 @testcase(1384) 67 @OETestID(1384)
70 def test_bitbakelayers_showrecipes(self): 68 def test_bitbakelayers_showrecipes(self):
71 result = runCmd('bitbake-layers show-recipes') 69 result = runCmd('bitbake-layers show-recipes')
72 self.assertIn('aspell:', result.output) 70 self.assertIn('aspell:', result.output)
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 46e09f509f..4c82049032 100644
--- a/meta/lib/oeqa/selftest/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -2,30 +2,31 @@ import os
2import re 2import re
3 3
4import oeqa.utils.ftools as ftools 4import oeqa.utils.ftools as ftools
5from oeqa.selftest.base import oeSelfTest
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
7from oeqa.utils.decorators import testcase
8 6
9class BitbakeTests(oeSelfTest): 7from oeqa.selftest.case import OESelftestTestCase
8from oeqa.core.decorator.oeid import OETestID
9
10class BitbakeTests(OESelftestTestCase):
10 11
11 def getline(self, res, line): 12 def getline(self, res, line):
12 for l in res.output.split('\n'): 13 for l in res.output.split('\n'):
13 if line in l: 14 if line in l:
14 return l 15 return l
15 16
16 @testcase(789) 17 @OETestID(789)
17 def test_run_bitbake_from_dir_1(self): 18 def test_run_bitbake_from_dir_1(self):
18 os.chdir(os.path.join(self.builddir, 'conf')) 19 os.chdir(os.path.join(self.builddir, 'conf'))
19 self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir") 20 self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir")
20 21
21 @testcase(790) 22 @OETestID(790)
22 def test_run_bitbake_from_dir_2(self): 23 def test_run_bitbake_from_dir_2(self):
23 my_env = os.environ.copy() 24 my_env = os.environ.copy()
24 my_env['BBPATH'] = my_env['BUILDDIR'] 25 my_env['BBPATH'] = my_env['BUILDDIR']
25 os.chdir(os.path.dirname(os.environ['BUILDDIR'])) 26 os.chdir(os.path.dirname(os.environ['BUILDDIR']))
26 self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir") 27 self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir")
27 28
28 @testcase(806) 29 @OETestID(806)
29 def test_event_handler(self): 30 def test_event_handler(self):
30 self.write_config("INHERIT += \"test_events\"") 31 self.write_config("INHERIT += \"test_events\"")
31 result = bitbake('m4-native') 32 result = bitbake('m4-native')
@@ -35,7 +36,7 @@ class BitbakeTests(oeSelfTest):
35 self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) 36 self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output)
36 self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output) 37 self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output)
37 38
38 @testcase(103) 39 @OETestID(103)
39 def test_local_sstate(self): 40 def test_local_sstate(self):
40 bitbake('m4-native') 41 bitbake('m4-native')
41 bitbake('m4-native -cclean') 42 bitbake('m4-native -cclean')
@@ -43,17 +44,17 @@ class BitbakeTests(oeSelfTest):
43 find_setscene = re.search("m4-native.*do_.*_setscene", result.output) 44 find_setscene = re.search("m4-native.*do_.*_setscene", result.output)
44 self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) 45 self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output )
45 46
46 @testcase(105) 47 @OETestID(105)
47 def test_bitbake_invalid_recipe(self): 48 def test_bitbake_invalid_recipe(self):
48 result = bitbake('-b asdf', ignore_status=True) 49 result = bitbake('-b asdf', ignore_status=True)
49 self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output) 50 self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output)
50 51
51 @testcase(107) 52 @OETestID(107)
52 def test_bitbake_invalid_target(self): 53 def test_bitbake_invalid_target(self):
53 result = bitbake('asdf', ignore_status=True) 54 result = bitbake('asdf', ignore_status=True)
54 self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) 55 self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output)
55 56
56 @testcase(106) 57 @OETestID(106)
57 def test_warnings_errors(self): 58 def test_warnings_errors(self):
58 result = bitbake('-b asdf', ignore_status=True) 59 result = bitbake('-b asdf', ignore_status=True)
59 find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output) 60 find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output)
@@ -61,7 +62,7 @@ class BitbakeTests(oeSelfTest):
61 self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output) 62 self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output)
62 self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output) 63 self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output)
63 64
64 @testcase(108) 65 @OETestID(108)
65 def test_invalid_patch(self): 66 def test_invalid_patch(self):
66 # This patch already exists in SRC_URI so adding it again will cause the 67 # This patch already exists in SRC_URI so adding it again will cause the
67 # patch to fail. 68 # patch to fail.
@@ -73,7 +74,7 @@ class BitbakeTests(oeSelfTest):
73 line = self.getline(result, "Function failed: patch_do_patch") 74 line = self.getline(result, "Function failed: patch_do_patch")
74 self.assertTrue(line and line.startswith("ERROR:"), msg = "Repeated patch application didn't fail. bitbake output: %s" % result.output) 75 self.assertTrue(line and line.startswith("ERROR:"), msg = "Repeated patch application didn't fail. bitbake output: %s" % result.output)
75 76
76 @testcase(1354) 77 @OETestID(1354)
77 def test_force_task_1(self): 78 def test_force_task_1(self):
78 # test 1 from bug 5875 79 # test 1 from bug 5875
79 test_recipe = 'zlib' 80 test_recipe = 'zlib'
@@ -98,7 +99,7 @@ class BitbakeTests(oeSelfTest):
98 ret = bitbake(test_recipe) 99 ret = bitbake(test_recipe)
99 self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.') 100 self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.')
100 101
101 @testcase(163) 102 @OETestID(163)
102 def test_force_task_2(self): 103 def test_force_task_2(self):
103 # test 2 from bug 5875 104 # test 2 from bug 5875
104 test_recipe = 'zlib' 105 test_recipe = 'zlib'
@@ -111,7 +112,7 @@ class BitbakeTests(oeSelfTest):
111 for task in look_for_tasks: 112 for task in look_for_tasks:
112 self.assertIn(task, result.output, msg="Couldn't find %s task.") 113 self.assertIn(task, result.output, msg="Couldn't find %s task.")
113 114
114 @testcase(167) 115 @OETestID(167)
115 def test_bitbake_g(self): 116 def test_bitbake_g(self):
116 result = bitbake('-g core-image-minimal') 117 result = bitbake('-g core-image-minimal')
117 for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']: 118 for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']:
@@ -119,7 +120,7 @@ class BitbakeTests(oeSelfTest):
119 self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) 120 self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output)
120 self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.") 121 self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.")
121 122
122 @testcase(899) 123 @OETestID(899)
123 def test_image_manifest(self): 124 def test_image_manifest(self):
124 bitbake('core-image-minimal') 125 bitbake('core-image-minimal')
125 bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal") 126 bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal")
@@ -128,7 +129,7 @@ class BitbakeTests(oeSelfTest):
128 manifest = os.path.join(deploydir, imagename + ".manifest") 129 manifest = os.path.join(deploydir, imagename + ".manifest")
129 self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest) 130 self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest)
130 131
131 @testcase(168) 132 @OETestID(168)
132 def test_invalid_recipe_src_uri(self): 133 def test_invalid_recipe_src_uri(self):
133 data = 'SRC_URI = "file://invalid"' 134 data = 'SRC_URI = "file://invalid"'
134 self.write_recipeinc('man', data) 135 self.write_recipeinc('man', data)
@@ -149,7 +150,7 @@ doesn't exist, yet no error message encountered. bitbake output: %s" % result.ou
149 self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ 150 self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \
150doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) 151doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output)
151 152
152 @testcase(171) 153 @OETestID(171)
153 def test_rename_downloaded_file(self): 154 def test_rename_downloaded_file(self):
154 # TODO unique dldir instead of using cleanall 155 # TODO unique dldir instead of using cleanall
155 # TODO: need to set sstatedir? 156 # TODO: need to set sstatedir?
@@ -167,29 +168,29 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
167 self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir) 168 self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir)
168 self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir) 169 self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir)
169 170
170 @testcase(1028) 171 @OETestID(1028)
171 def test_environment(self): 172 def test_environment(self):
172 self.write_config("TEST_ENV=\"localconf\"") 173 self.write_config("TEST_ENV=\"localconf\"")
173 result = runCmd('bitbake -e | grep TEST_ENV=') 174 result = runCmd('bitbake -e | grep TEST_ENV=')
174 self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='") 175 self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='")
175 176
176 @testcase(1029) 177 @OETestID(1029)
177 def test_dry_run(self): 178 def test_dry_run(self):
178 result = runCmd('bitbake -n m4-native') 179 result = runCmd('bitbake -n m4-native')
179 self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output) 180 self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output)
180 181
181 @testcase(1030) 182 @OETestID(1030)
182 def test_just_parse(self): 183 def test_just_parse(self):
183 result = runCmd('bitbake -p') 184 result = runCmd('bitbake -p')
184 self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output) 185 self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output)
185 186
186 @testcase(1031) 187 @OETestID(1031)
187 def test_version(self): 188 def test_version(self):
188 result = runCmd('bitbake -s | grep wget') 189 result = runCmd('bitbake -s | grep wget')
189 find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output) 190 find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output)
190 self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output) 191 self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output)
191 192
192 @testcase(1032) 193 @OETestID(1032)
193 def test_prefile(self): 194 def test_prefile(self):
194 preconf = os.path.join(self.builddir, 'conf/prefile.conf') 195 preconf = os.path.join(self.builddir, 'conf/prefile.conf')
195 self.track_for_cleanup(preconf) 196 self.track_for_cleanup(preconf)
@@ -200,7 +201,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
200 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') 201 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
201 self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.") 202 self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.")
202 203
203 @testcase(1033) 204 @OETestID(1033)
204 def test_postfile(self): 205 def test_postfile(self):
205 postconf = os.path.join(self.builddir, 'conf/postfile.conf') 206 postconf = os.path.join(self.builddir, 'conf/postfile.conf')
206 self.track_for_cleanup(postconf) 207 self.track_for_cleanup(postconf)
@@ -209,12 +210,12 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
209 result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') 210 result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=')
210 self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.") 211 self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.")
211 212
212 @testcase(1034) 213 @OETestID(1034)
213 def test_checkuri(self): 214 def test_checkuri(self):
214 result = runCmd('bitbake -c checkuri m4') 215 result = runCmd('bitbake -c checkuri m4')
215 self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output) 216 self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output)
216 217
217 @testcase(1035) 218 @OETestID(1035)
218 def test_continue(self): 219 def test_continue(self):
219 self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\" 220 self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
220SSTATE_DIR = \"${TOPDIR}/download-selftest\" 221SSTATE_DIR = \"${TOPDIR}/download-selftest\"
@@ -229,7 +230,7 @@ INHERIT_remove = \"report-error\"
229 continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) 230 continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1))
230 self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) 231 self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output)
231 232
232 @testcase(1119) 233 @OETestID(1119)
233 def test_non_gplv3(self): 234 def test_non_gplv3(self):
234 self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"') 235 self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"')
235 result = bitbake('selftest-ed', ignore_status=True) 236 result = bitbake('selftest-ed', ignore_status=True)
@@ -238,7 +239,7 @@ INHERIT_remove = \"report-error\"
238 self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3'))) 239 self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3')))
239 self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2'))) 240 self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2')))
240 241
241 @testcase(1422) 242 @OETestID(1422)
242 def test_setscene_only(self): 243 def test_setscene_only(self):
243 """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)""" 244 """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)"""
244 test_recipe = 'ed' 245 test_recipe = 'ed'
@@ -253,7 +254,7 @@ INHERIT_remove = \"report-error\"
253 self.assertIn('_setscene', task, 'A task different from _setscene ran: %s.\n' 254 self.assertIn('_setscene', task, 'A task different from _setscene ran: %s.\n'
254 'Executed tasks were: %s' % (task, str(tasks))) 255 'Executed tasks were: %s' % (task, str(tasks)))
255 256
256 @testcase(1425) 257 @OETestID(1425)
257 def test_bbappend_order(self): 258 def test_bbappend_order(self):
258 """ Bitbake should bbappend to recipe in a predictable order """ 259 """ Bitbake should bbappend to recipe in a predictable order """
259 test_recipe = 'ed' 260 test_recipe = 'ed'
diff --git a/meta/lib/oeqa/selftest/buildhistory.py b/meta/lib/oeqa/selftest/cases/buildhistory.py
index 008c39c956..06792d9146 100644
--- a/meta/lib/oeqa/selftest/buildhistory.py
+++ b/meta/lib/oeqa/selftest/cases/buildhistory.py
@@ -2,12 +2,11 @@ import os
2import re 2import re
3import datetime 3import datetime
4 4
5from oeqa.selftest.base import oeSelfTest 5from oeqa.selftest.case import OESelftestTestCase
6from oeqa.utils.commands import bitbake, get_bb_vars 6from oeqa.utils.commands import bitbake, get_bb_vars
7from oeqa.utils.decorators import testcase
8 7
9 8
10class BuildhistoryBase(oeSelfTest): 9class BuildhistoryBase(OESelftestTestCase):
11 10
12 def config_buildhistory(self, tmp_bh_location=False): 11 def config_buildhistory(self, tmp_bh_location=False):
13 bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT']) 12 bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT'])
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py
index ce37ea457c..1f1bb7ae63 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -3,15 +3,15 @@ import re
3import glob as g 3import glob as g
4import shutil 4import shutil
5import tempfile 5import tempfile
6from oeqa.selftest.base import oeSelfTest 6from oeqa.selftest.case import OESelftestTestCase
7from oeqa.selftest.buildhistory import BuildhistoryBase 7from oeqa.selftest.cases.buildhistory import BuildhistoryBase
8from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 8from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
9import oeqa.utils.ftools as ftools 9import oeqa.utils.ftools as ftools
10from oeqa.utils.decorators import testcase 10from oeqa.core.decorator.oeid import OETestID
11 11
12class ImageOptionsTests(oeSelfTest): 12class ImageOptionsTests(OESelftestTestCase):
13 13
14 @testcase(761) 14 @OETestID(761)
15 def test_incremental_image_generation(self): 15 def test_incremental_image_generation(self):
16 image_pkgtype = get_bb_var("IMAGE_PKGTYPE") 16 image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
17 if image_pkgtype != 'rpm': 17 if image_pkgtype != 'rpm':
@@ -30,7 +30,7 @@ class ImageOptionsTests(oeSelfTest):
30 incremental_removed = re.search(r"Erasing\s*:\s*packagegroup-core-ssh-openssh", log_data_removed) 30 incremental_removed = re.search(r"Erasing\s*:\s*packagegroup-core-ssh-openssh", log_data_removed)
31 self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed) 31 self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
32 32
33 @testcase(286) 33 @OETestID(286)
34 def test_ccache_tool(self): 34 def test_ccache_tool(self):
35 bitbake("ccache-native") 35 bitbake("ccache-native")
36 bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native') 36 bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
@@ -43,7 +43,7 @@ class ImageOptionsTests(oeSelfTest):
43 res = runCmd("grep ccache %s" % log_compile, ignore_status=True) 43 res = runCmd("grep ccache %s" % log_compile, ignore_status=True)
44 self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % log_compile) 44 self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % log_compile)
45 45
46 @testcase(1435) 46 @OETestID(1435)
47 def test_read_only_image(self): 47 def test_read_only_image(self):
48 distro_features = get_bb_var('DISTRO_FEATURES') 48 distro_features = get_bb_var('DISTRO_FEATURES')
49 if not ('x11' in distro_features and 'opengl' in distro_features): 49 if not ('x11' in distro_features and 'opengl' in distro_features):
@@ -52,9 +52,9 @@ class ImageOptionsTests(oeSelfTest):
52 bitbake("core-image-sato") 52 bitbake("core-image-sato")
53 # do_image will fail if there are any pending postinsts 53 # do_image will fail if there are any pending postinsts
54 54
55class DiskMonTest(oeSelfTest): 55class DiskMonTest(OESelftestTestCase):
56 56
57 @testcase(277) 57 @OETestID(277)
58 def test_stoptask_behavior(self): 58 def test_stoptask_behavior(self):
59 self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"') 59 self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"')
60 res = bitbake("m4", ignore_status = True) 60 res = bitbake("m4", ignore_status = True)
@@ -68,13 +68,13 @@ class DiskMonTest(oeSelfTest):
68 res = bitbake("m4") 68 res = bitbake("m4")
69 self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output) 69 self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output)
70 70
71class SanityOptionsTest(oeSelfTest): 71class SanityOptionsTest(OESelftestTestCase):
72 def getline(self, res, line): 72 def getline(self, res, line):
73 for l in res.output.split('\n'): 73 for l in res.output.split('\n'):
74 if line in l: 74 if line in l:
75 return l 75 return l
76 76
77 @testcase(927) 77 @OETestID(927)
78 def test_options_warnqa_errorqa_switch(self): 78 def test_options_warnqa_errorqa_switch(self):
79 79
80 self.write_config("INHERIT_remove = \"report-error\"") 80 self.write_config("INHERIT_remove = \"report-error\"")
@@ -96,7 +96,7 @@ class SanityOptionsTest(oeSelfTest):
96 line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") 96 line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.")
97 self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) 97 self.assertTrue(line and line.startswith("WARNING:"), msg=res.output)
98 98
99 @testcase(278) 99 @OETestID(278)
100 def test_sanity_unsafe_script_references(self): 100 def test_sanity_unsafe_script_references(self):
101 self.write_config('WARN_QA_append = " unsafe-references-in-scripts"') 101 self.write_config('WARN_QA_append = " unsafe-references-in-scripts"')
102 102
@@ -114,7 +114,7 @@ do_install_append_pn-gzip () {
114 line = self.getline(res, "QA Issue: gzip") 114 line = self.getline(res, "QA Issue: gzip")
115 self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) 115 self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output)
116 116
117 @testcase(1421) 117 @OETestID(1421)
118 def test_layer_without_git_dir(self): 118 def test_layer_without_git_dir(self):
119 """ 119 """
120 Summary: Test that layer git revisions are displayed and do not fail without git repository 120 Summary: Test that layer git revisions are displayed and do not fail without git repository
@@ -156,20 +156,20 @@ do_install_append_pn-gzip () {
156 156
157class BuildhistoryTests(BuildhistoryBase): 157class BuildhistoryTests(BuildhistoryBase):
158 158
159 @testcase(293) 159 @OETestID(293)
160 def test_buildhistory_basic(self): 160 def test_buildhistory_basic(self):
161 self.run_buildhistory_operation('xcursor-transparent-theme') 161 self.run_buildhistory_operation('xcursor-transparent-theme')
162 self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.") 162 self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.")
163 163
164 @testcase(294) 164 @OETestID(294)
165 def test_buildhistory_buildtime_pr_backwards(self): 165 def test_buildhistory_buildtime_pr_backwards(self):
166 target = 'xcursor-transparent-theme' 166 target = 'xcursor-transparent-theme'
167 error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1.* to .*-r0.*)" % target 167 error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1.* to .*-r0.*)" % target
168 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) 168 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
169 self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error) 169 self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)
170 170
171class ArchiverTest(oeSelfTest): 171class ArchiverTest(OESelftestTestCase):
172 @testcase(926) 172 @OETestID(926)
173 def test_arch_work_dir_and_export_source(self): 173 def test_arch_work_dir_and_export_source(self):
174 """ 174 """
175 Test for archiving the work directory and exporting the source files. 175 Test for archiving the work directory and exporting the source files.
diff --git a/meta/lib/oeqa/selftest/containerimage.py b/meta/lib/oeqa/selftest/cases/containerimage.py
index def481f144..73162fa600 100644
--- a/meta/lib/oeqa/selftest/containerimage.py
+++ b/meta/lib/oeqa/selftest/cases/containerimage.py
@@ -1,6 +1,6 @@
1import os 1import os
2 2
3from oeqa.selftest.base import oeSelfTest 3from oeqa.selftest.case import OESelftestTestCase
4from oeqa.utils.commands import bitbake, get_bb_vars, runCmd 4from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
5 5
6# This test builds an image with using the "container" IMAGE_FSTYPE, and 6# This test builds an image with using the "container" IMAGE_FSTYPE, and
@@ -16,7 +16,7 @@ from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
16# of them, but this test is more to catch if other packages get added by 16# of them, but this test is more to catch if other packages get added by
17# default other than what is in ROOTFS_BOOTSTRAP_INSTALL. 17# default other than what is in ROOTFS_BOOTSTRAP_INSTALL.
18# 18#
19class ContainerImageTests(oeSelfTest): 19class ContainerImageTests(OESelftestTestCase):
20 20
21 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that 21 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
22 # the conversion type bar gets added as a dep as well 22 # the conversion type bar gets added as a dep as well
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 39f3543417..75340d6d7b 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1,6 +1,4 @@
1import unittest
2import os 1import os
3import logging
4import re 2import re
5import shutil 3import shutil
6import tempfile 4import tempfile
@@ -8,12 +6,12 @@ import glob
8import fnmatch 6import fnmatch
9 7
10import oeqa.utils.ftools as ftools 8import oeqa.utils.ftools as ftools
11from oeqa.selftest.base import oeSelfTest 9from oeqa.selftest.case import OESelftestTestCase
12from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer 10from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
13from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer 11from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
14from oeqa.utils.decorators import testcase 12from oeqa.core.decorator.oeid import OETestID
15 13
16class DevtoolBase(oeSelfTest): 14class DevtoolBase(OESelftestTestCase):
17 15
18 def _test_recipe_contents(self, recipefile, checkvars, checkinherits): 16 def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
19 with open(recipefile, 'r') as f: 17 with open(recipefile, 'r') as f:
@@ -120,6 +118,7 @@ class DevtoolTests(DevtoolBase):
120 118
121 @classmethod 119 @classmethod
122 def setUpClass(cls): 120 def setUpClass(cls):
121 super(DevtoolTests, cls).setUpClass()
123 bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR']) 122 bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR'])
124 cls.original_sstate = bb_vars['SSTATE_DIR'] 123 cls.original_sstate = bb_vars['SSTATE_DIR']
125 cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool') 124 cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool')
@@ -129,8 +128,9 @@ class DevtoolTests(DevtoolBase):
129 128
130 @classmethod 129 @classmethod
131 def tearDownClass(cls): 130 def tearDownClass(cls):
132 cls.log.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate) 131 cls.logger.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate)
133 runCmd('rm -rf %s' % cls.devtool_sstate) 132 runCmd('rm -rf %s' % cls.devtool_sstate)
133 super(DevtoolTests, cls).tearDownClass()
134 134
135 def setUp(self): 135 def setUp(self):
136 """Test case setup function""" 136 """Test case setup function"""
@@ -168,7 +168,7 @@ class DevtoolTests(DevtoolBase):
168 if expected_status: 168 if expected_status:
169 self.fail('Missing file changes: %s' % expected_status) 169 self.fail('Missing file changes: %s' % expected_status)
170 170
171 @testcase(1158) 171 @OETestID(1158)
172 def test_create_workspace(self): 172 def test_create_workspace(self):
173 # Check preconditions 173 # Check preconditions
174 result = runCmd('bitbake-layers show-layers') 174 result = runCmd('bitbake-layers show-layers')
@@ -189,7 +189,7 @@ class DevtoolTests(DevtoolBase):
189 self.assertNotIn(tempdir, result.output) 189 self.assertNotIn(tempdir, result.output)
190 self.assertIn(self.workspacedir, result.output) 190 self.assertIn(self.workspacedir, result.output)
191 191
192 @testcase(1159) 192 @OETestID(1159)
193 def test_devtool_add(self): 193 def test_devtool_add(self):
194 # Fetch source 194 # Fetch source
195 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 195 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -222,7 +222,7 @@ class DevtoolTests(DevtoolBase):
222 bindir = bindir[1:] 222 bindir = bindir[1:]
223 self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D') 223 self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D')
224 224
225 @testcase(1423) 225 @OETestID(1423)
226 def test_devtool_add_git_local(self): 226 def test_devtool_add_git_local(self):
227 # Fetch source from a remote URL, but do it outside of devtool 227 # Fetch source from a remote URL, but do it outside of devtool
228 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 228 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -262,7 +262,7 @@ class DevtoolTests(DevtoolBase):
262 checkvars['DEPENDS'] = set(['dbus']) 262 checkvars['DEPENDS'] = set(['dbus'])
263 self._test_recipe_contents(recipefile, checkvars, []) 263 self._test_recipe_contents(recipefile, checkvars, [])
264 264
265 @testcase(1162) 265 @OETestID(1162)
266 def test_devtool_add_library(self): 266 def test_devtool_add_library(self):
267 # Fetch source 267 # Fetch source
268 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 268 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -311,7 +311,7 @@ class DevtoolTests(DevtoolBase):
311 self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned') 311 self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned')
312 self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning') 312 self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning')
313 313
314 @testcase(1160) 314 @OETestID(1160)
315 def test_devtool_add_fetch(self): 315 def test_devtool_add_fetch(self):
316 # Fetch source 316 # Fetch source
317 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 317 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -357,7 +357,7 @@ class DevtoolTests(DevtoolBase):
357 checkvars['SRC_URI'] = url 357 checkvars['SRC_URI'] = url
358 self._test_recipe_contents(recipefile, checkvars, []) 358 self._test_recipe_contents(recipefile, checkvars, [])
359 359
360 @testcase(1161) 360 @OETestID(1161)
361 def test_devtool_add_fetch_git(self): 361 def test_devtool_add_fetch_git(self):
362 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 362 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
363 self.track_for_cleanup(tempdir) 363 self.track_for_cleanup(tempdir)
@@ -405,7 +405,7 @@ class DevtoolTests(DevtoolBase):
405 checkvars['SRCREV'] = checkrev 405 checkvars['SRCREV'] = checkrev
406 self._test_recipe_contents(recipefile, checkvars, []) 406 self._test_recipe_contents(recipefile, checkvars, [])
407 407
408 @testcase(1391) 408 @OETestID(1391)
409 def test_devtool_add_fetch_simple(self): 409 def test_devtool_add_fetch_simple(self):
410 # Fetch source from a remote URL, auto-detecting name 410 # Fetch source from a remote URL, auto-detecting name
411 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 411 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -433,7 +433,7 @@ class DevtoolTests(DevtoolBase):
433 checkvars['SRC_URI'] = url.replace(testver, '${PV}') 433 checkvars['SRC_URI'] = url.replace(testver, '${PV}')
434 self._test_recipe_contents(recipefile, checkvars, []) 434 self._test_recipe_contents(recipefile, checkvars, [])
435 435
436 @testcase(1164) 436 @OETestID(1164)
437 def test_devtool_modify(self): 437 def test_devtool_modify(self):
438 import oe.path 438 import oe.path
439 439
@@ -537,7 +537,7 @@ class DevtoolTests(DevtoolBase):
537 finally: 537 finally:
538 self.delete_recipeinc('m4') 538 self.delete_recipeinc('m4')
539 539
540 @testcase(1166) 540 @OETestID(1166)
541 def test_devtool_modify_invalid(self): 541 def test_devtool_modify_invalid(self):
542 # Try modifying some recipes 542 # Try modifying some recipes
543 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 543 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -566,7 +566,7 @@ class DevtoolTests(DevtoolBase):
566 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output)) 566 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output))
567 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) 567 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
568 568
569 @testcase(1365) 569 @OETestID(1365)
570 def test_devtool_modify_native(self): 570 def test_devtool_modify_native(self):
571 # Check preconditions 571 # Check preconditions
572 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') 572 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -596,7 +596,7 @@ class DevtoolTests(DevtoolBase):
596 self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) 596 self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
597 597
598 598
599 @testcase(1165) 599 @OETestID(1165)
600 def test_devtool_modify_git(self): 600 def test_devtool_modify_git(self):
601 # Check preconditions 601 # Check preconditions
602 testrecipe = 'mkelfimage' 602 testrecipe = 'mkelfimage'
@@ -624,7 +624,7 @@ class DevtoolTests(DevtoolBase):
624 # Try building 624 # Try building
625 bitbake(testrecipe) 625 bitbake(testrecipe)
626 626
627 @testcase(1167) 627 @OETestID(1167)
628 def test_devtool_modify_localfiles(self): 628 def test_devtool_modify_localfiles(self):
629 # Check preconditions 629 # Check preconditions
630 testrecipe = 'lighttpd' 630 testrecipe = 'lighttpd'
@@ -655,7 +655,7 @@ class DevtoolTests(DevtoolBase):
655 # Try building 655 # Try building
656 bitbake(testrecipe) 656 bitbake(testrecipe)
657 657
658 @testcase(1378) 658 @OETestID(1378)
659 def test_devtool_modify_virtual(self): 659 def test_devtool_modify_virtual(self):
660 # Try modifying a virtual recipe 660 # Try modifying a virtual recipe
661 virtrecipe = 'virtual/make' 661 virtrecipe = 'virtual/make'
@@ -678,7 +678,7 @@ class DevtoolTests(DevtoolBase):
678 # This is probably sufficient 678 # This is probably sufficient
679 679
680 680
681 @testcase(1169) 681 @OETestID(1169)
682 def test_devtool_update_recipe(self): 682 def test_devtool_update_recipe(self):
683 # Check preconditions 683 # Check preconditions
684 testrecipe = 'minicom' 684 testrecipe = 'minicom'
@@ -711,7 +711,7 @@ class DevtoolTests(DevtoolBase):
711 ('??', '.*/0002-Add-a-new-file.patch$')] 711 ('??', '.*/0002-Add-a-new-file.patch$')]
712 self._check_repo_status(os.path.dirname(recipefile), expected_status) 712 self._check_repo_status(os.path.dirname(recipefile), expected_status)
713 713
714 @testcase(1172) 714 @OETestID(1172)
715 def test_devtool_update_recipe_git(self): 715 def test_devtool_update_recipe_git(self):
716 # Check preconditions 716 # Check preconditions
717 testrecipe = 'mtd-utils' 717 testrecipe = 'mtd-utils'
@@ -781,7 +781,7 @@ class DevtoolTests(DevtoolBase):
781 ('??', '%s/0002-Add-a-new-file.patch' % relpatchpath)] 781 ('??', '%s/0002-Add-a-new-file.patch' % relpatchpath)]
782 self._check_repo_status(os.path.dirname(recipefile), expected_status) 782 self._check_repo_status(os.path.dirname(recipefile), expected_status)
783 783
784 @testcase(1170) 784 @OETestID(1170)
785 def test_devtool_update_recipe_append(self): 785 def test_devtool_update_recipe_append(self):
786 # Check preconditions 786 # Check preconditions
787 testrecipe = 'mdadm' 787 testrecipe = 'mdadm'
@@ -850,7 +850,7 @@ class DevtoolTests(DevtoolBase):
850 self.assertEqual(expectedlines, f.readlines()) 850 self.assertEqual(expectedlines, f.readlines())
851 # Deleting isn't expected to work under these circumstances 851 # Deleting isn't expected to work under these circumstances
852 852
853 @testcase(1171) 853 @OETestID(1171)
854 def test_devtool_update_recipe_append_git(self): 854 def test_devtool_update_recipe_append_git(self):
855 # Check preconditions 855 # Check preconditions
856 testrecipe = 'mtd-utils' 856 testrecipe = 'mtd-utils'
@@ -940,7 +940,7 @@ class DevtoolTests(DevtoolBase):
940 self.assertEqual(expectedlines, set(f.readlines())) 940 self.assertEqual(expectedlines, set(f.readlines()))
941 # Deleting isn't expected to work under these circumstances 941 # Deleting isn't expected to work under these circumstances
942 942
943 @testcase(1370) 943 @OETestID(1370)
944 def test_devtool_update_recipe_local_files(self): 944 def test_devtool_update_recipe_local_files(self):
945 """Check that local source files are copied over instead of patched""" 945 """Check that local source files are copied over instead of patched"""
946 testrecipe = 'makedevs' 946 testrecipe = 'makedevs'
@@ -972,7 +972,7 @@ class DevtoolTests(DevtoolBase):
972 ('??', '.*/makedevs/0001-Add-new-file.patch$')] 972 ('??', '.*/makedevs/0001-Add-new-file.patch$')]
973 self._check_repo_status(os.path.dirname(recipefile), expected_status) 973 self._check_repo_status(os.path.dirname(recipefile), expected_status)
974 974
975 @testcase(1371) 975 @OETestID(1371)
976 def test_devtool_update_recipe_local_files_2(self): 976 def test_devtool_update_recipe_local_files_2(self):
977 """Check local source files support when oe-local-files is in Git""" 977 """Check local source files support when oe-local-files is in Git"""
978 testrecipe = 'lzo' 978 testrecipe = 'lzo'
@@ -1085,7 +1085,7 @@ class DevtoolTests(DevtoolBase):
1085 expected_status = [] 1085 expected_status = []
1086 self._check_repo_status(os.path.dirname(recipefile), expected_status) 1086 self._check_repo_status(os.path.dirname(recipefile), expected_status)
1087 1087
1088 @testcase(1163) 1088 @OETestID(1163)
1089 def test_devtool_extract(self): 1089 def test_devtool_extract(self):
1090 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1090 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1091 # Try devtool extract 1091 # Try devtool extract
@@ -1097,7 +1097,7 @@ class DevtoolTests(DevtoolBase):
1097 self.assertFalse(os.path.exists(self.workspacedir)) 1097 self.assertFalse(os.path.exists(self.workspacedir))
1098 self._check_src_repo(tempdir) 1098 self._check_src_repo(tempdir)
1099 1099
1100 @testcase(1379) 1100 @OETestID(1379)
1101 def test_devtool_extract_virtual(self): 1101 def test_devtool_extract_virtual(self):
1102 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1102 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1103 # Try devtool extract 1103 # Try devtool extract
@@ -1108,7 +1108,7 @@ class DevtoolTests(DevtoolBase):
1108 self.assertFalse(os.path.exists(self.workspacedir)) 1108 self.assertFalse(os.path.exists(self.workspacedir))
1109 self._check_src_repo(tempdir) 1109 self._check_src_repo(tempdir)
1110 1110
1111 @testcase(1168) 1111 @OETestID(1168)
1112 def test_devtool_reset_all(self): 1112 def test_devtool_reset_all(self):
1113 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1113 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1114 self.track_for_cleanup(tempdir) 1114 self.track_for_cleanup(tempdir)
@@ -1135,7 +1135,7 @@ class DevtoolTests(DevtoolBase):
1135 matches2 = glob.glob(stampprefix2 + '*') 1135 matches2 = glob.glob(stampprefix2 + '*')
1136 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2) 1136 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
1137 1137
1138 @testcase(1272) 1138 @OETestID(1272)
1139 def test_devtool_deploy_target(self): 1139 def test_devtool_deploy_target(self):
1140 # NOTE: Whilst this test would seemingly be better placed as a runtime test, 1140 # NOTE: Whilst this test would seemingly be better placed as a runtime test,
1141 # unfortunately the runtime tests run under bitbake and you can't run 1141 # unfortunately the runtime tests run under bitbake and you can't run
@@ -1221,7 +1221,7 @@ class DevtoolTests(DevtoolBase):
1221 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True) 1221 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
1222 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have') 1222 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
1223 1223
1224 @testcase(1366) 1224 @OETestID(1366)
1225 def test_devtool_build_image(self): 1225 def test_devtool_build_image(self):
1226 """Test devtool build-image plugin""" 1226 """Test devtool build-image plugin"""
1227 # Check preconditions 1227 # Check preconditions
@@ -1255,7 +1255,7 @@ class DevtoolTests(DevtoolBase):
1255 if reqpkgs: 1255 if reqpkgs:
1256 self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs)) 1256 self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs))
1257 1257
1258 @testcase(1367) 1258 @OETestID(1367)
1259 def test_devtool_upgrade(self): 1259 def test_devtool_upgrade(self):
1260 # Check preconditions 1260 # Check preconditions
1261 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') 1261 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -1300,7 +1300,7 @@ class DevtoolTests(DevtoolBase):
1300 self.assertNotIn(recipe, result.output) 1300 self.assertNotIn(recipe, result.output)
1301 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting') 1301 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
1302 1302
1303 @testcase(1433) 1303 @OETestID(1433)
1304 def test_devtool_upgrade_git(self): 1304 def test_devtool_upgrade_git(self):
1305 # Check preconditions 1305 # Check preconditions
1306 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') 1306 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -1337,7 +1337,7 @@ class DevtoolTests(DevtoolBase):
1337 self.assertNotIn(recipe, result.output) 1337 self.assertNotIn(recipe, result.output)
1338 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting') 1338 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
1339 1339
1340 @testcase(1352) 1340 @OETestID(1352)
1341 def test_devtool_layer_plugins(self): 1341 def test_devtool_layer_plugins(self):
1342 """Test that devtool can use plugins from other layers. 1342 """Test that devtool can use plugins from other layers.
1343 1343
@@ -1609,7 +1609,7 @@ class DevtoolTests(DevtoolBase):
1609 checkvars['SRC_URI'] = url 1609 checkvars['SRC_URI'] = url
1610 self._test_recipe_contents(newrecipefile, checkvars, []) 1610 self._test_recipe_contents(newrecipefile, checkvars, [])
1611 1611
1612 @testcase(1577) 1612 @OETestID(1577)
1613 def test_devtool_virtual_kernel_modify(self): 1613 def test_devtool_virtual_kernel_modify(self):
1614 """ 1614 """
1615 Summary: The purpose of this test case is to verify that 1615 Summary: The purpose of this test case is to verify that
diff --git a/meta/lib/oeqa/selftest/eSDK.py b/meta/lib/oeqa/selftest/cases/eSDK.py
index 1596c6e9d6..f36c3ccd3b 100644
--- a/meta/lib/oeqa/selftest/eSDK.py
+++ b/meta/lib/oeqa/selftest/cases/eSDK.py
@@ -1,16 +1,12 @@
1import unittest
2import tempfile 1import tempfile
3import shutil 2import shutil
4import os 3import os
5import glob 4import glob
6import logging 5from oeqa.core.decorator.oeid import OETestID
7import subprocess 6from oeqa.selftest.case import OESelftestTestCase
8import oeqa.utils.ftools as ftools
9from oeqa.utils.decorators import testcase
10from oeqa.selftest.base import oeSelfTest
11from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 7from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
12 8
13class oeSDKExtSelfTest(oeSelfTest): 9class oeSDKExtSelfTest(OESelftestTestCase):
14 """ 10 """
15 # Bugzilla Test Plan: 6033 11 # Bugzilla Test Plan: 6033
16 # This code is planned to be part of the automation for eSDK containig 12 # This code is planned to be part of the automation for eSDK containig
@@ -73,6 +69,7 @@ CORE_IMAGE_EXTRA_INSTALL = "perl"
73 69
74 @classmethod 70 @classmethod
75 def setUpClass(cls): 71 def setUpClass(cls):
72 super(oeSDKExtSelfTest, cls).setUpClass()
76 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA') 73 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
77 74
78 sstate_dir = get_bb_var('SSTATE_DIR') 75 sstate_dir = get_bb_var('SSTATE_DIR')
@@ -97,19 +94,18 @@ SSTATE_MIRRORS = "file://.* file://%s/PATH"
97 @classmethod 94 @classmethod
98 def tearDownClass(cls): 95 def tearDownClass(cls):
99 shutil.rmtree(cls.tmpdir_eSDKQA) 96 shutil.rmtree(cls.tmpdir_eSDKQA)
97 super(oeSDKExtSelfTest, cls).tearDownClass()
100 98
101 @testcase (1602) 99 @OETestID(1602)
102 def test_install_libraries_headers(self): 100 def test_install_libraries_headers(self):
103 pn_sstate = 'bc' 101 pn_sstate = 'bc'
104 bitbake(pn_sstate) 102 bitbake(pn_sstate)
105 cmd = "devtool sdk-install %s " % pn_sstate 103 cmd = "devtool sdk-install %s " % pn_sstate
106 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) 104 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
107 105
108 @testcase(1603) 106 @OETestID(1603)
109 def test_image_generation_binary_feeds(self): 107 def test_image_generation_binary_feeds(self):
110 image = 'core-image-minimal' 108 image = 'core-image-minimal'
111 cmd = "devtool build-image %s" % image 109 cmd = "devtool build-image %s" % image
112 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) 110 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
113 111
114if __name__ == '__main__':
115 unittest.main()
diff --git a/meta/lib/oeqa/selftest/image_typedep.py b/meta/lib/oeqa/selftest/cases/image_typedep.py
index 256142d255..0614c765b4 100644
--- a/meta/lib/oeqa/selftest/image_typedep.py
+++ b/meta/lib/oeqa/selftest/cases/image_typedep.py
@@ -1,9 +1,9 @@
1import os 1import os
2 2
3from oeqa.selftest.base import oeSelfTest 3from oeqa.selftest.case import OESelftestTestCase
4from oeqa.utils.commands import bitbake 4from oeqa.utils.commands import bitbake
5 5
6class ImageTypeDepTests(oeSelfTest): 6class ImageTypeDepTests(OESelftestTestCase):
7 7
8 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that 8 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
9 # the conversion type bar gets added as a dep as well 9 # the conversion type bar gets added as a dep as well
diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 76896c7981..45a06feaf3 100644
--- a/meta/lib/oeqa/selftest/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -1,17 +1,15 @@
1from oeqa.selftest.base import oeSelfTest 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu 2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
3from oeqa.utils.decorators import testcase 3from oeqa.core.decorator.oeid import OETestID
4from oeqa.utils.sshcontrol import SSHControl 4from oeqa.utils.sshcontrol import SSHControl
5import os 5import os
6import sys
7import logging
8 6
9class ImageFeatures(oeSelfTest): 7class ImageFeatures(OESelftestTestCase):
10 8
11 test_user = 'tester' 9 test_user = 'tester'
12 root_user = 'root' 10 root_user = 'root'
13 11
14 @testcase(1107) 12 @OETestID(1107)
15 def test_non_root_user_can_connect_via_ssh_without_password(self): 13 def test_non_root_user_can_connect_via_ssh_without_password(self):
16 """ 14 """
17 Summary: Check if non root user can connect via ssh without password 15 Summary: Check if non root user can connect via ssh without password
@@ -37,7 +35,7 @@ class ImageFeatures(oeSelfTest):
37 status, output = ssh.run("true") 35 status, output = ssh.run("true")
38 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output)) 36 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
39 37
40 @testcase(1115) 38 @OETestID(1115)
41 def test_all_users_can_connect_via_ssh_without_password(self): 39 def test_all_users_can_connect_via_ssh_without_password(self):
42 """ 40 """
43 Summary: Check if all users can connect via ssh without password 41 Summary: Check if all users can connect via ssh without password
@@ -67,7 +65,7 @@ class ImageFeatures(oeSelfTest):
67 self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output) 65 self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output)
68 66
69 67
70 @testcase(1116) 68 @OETestID(1116)
71 def test_clutter_image_can_be_built(self): 69 def test_clutter_image_can_be_built(self):
72 """ 70 """
73 Summary: Check if clutter image can be built 71 Summary: Check if clutter image can be built
@@ -80,7 +78,7 @@ class ImageFeatures(oeSelfTest):
80 # Build a core-image-clutter 78 # Build a core-image-clutter
81 bitbake('core-image-clutter') 79 bitbake('core-image-clutter')
82 80
83 @testcase(1117) 81 @OETestID(1117)
84 def test_wayland_support_in_image(self): 82 def test_wayland_support_in_image(self):
85 """ 83 """
86 Summary: Check Wayland support in image 84 Summary: Check Wayland support in image
diff --git a/meta/lib/oeqa/selftest/layerappend.py b/meta/lib/oeqa/selftest/cases/layerappend.py
index 37bb32cd1d..9562116309 100644
--- a/meta/lib/oeqa/selftest/layerappend.py
+++ b/meta/lib/oeqa/selftest/cases/layerappend.py
@@ -1,15 +1,11 @@
1import unittest
2import os 1import os
3import logging
4import re
5 2
6from oeqa.selftest.base import oeSelfTest 3from oeqa.selftest.case import OESelftestTestCase
7from oeqa.selftest.buildhistory import BuildhistoryBase
8from oeqa.utils.commands import runCmd, bitbake, get_bb_var 4from oeqa.utils.commands import runCmd, bitbake, get_bb_var
9import oeqa.utils.ftools as ftools 5import oeqa.utils.ftools as ftools
10from oeqa.utils.decorators import testcase 6from oeqa.core.decorator.oeid import OETestID
11 7
12class LayerAppendTests(oeSelfTest): 8class LayerAppendTests(OESelftestTestCase):
13 layerconf = """ 9 layerconf = """
14# We have a conf and classes directory, append to BBPATH 10# We have a conf and classes directory, append to BBPATH
15BBPATH .= ":${LAYERDIR}" 11BBPATH .= ":${LAYERDIR}"
@@ -51,8 +47,9 @@ SRC_URI_append += "file://appendtest.txt"
51 def tearDownLocal(self): 47 def tearDownLocal(self):
52 if self.layerappend: 48 if self.layerappend:
53 ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend) 49 ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
50 super(LayerAppendTests, self).tearDownLocal()
54 51
55 @testcase(1196) 52 @OETestID(1196)
56 def test_layer_appends(self): 53 def test_layer_appends(self):
57 corebase = get_bb_var("COREBASE") 54 corebase = get_bb_var("COREBASE")
58 55
@@ -96,5 +93,3 @@ SRC_URI_append += "file://appendtest.txt"
96 bitbake("layerappendtest") 93 bitbake("layerappendtest")
97 data = ftools.read_file(stagingdir + "/appendtest.txt") 94 data = ftools.read_file(stagingdir + "/appendtest.txt")
98 self.assertEqual(data, "Layer 2 test") 95 self.assertEqual(data, "Layer 2 test")
99
100
diff --git a/meta/lib/oeqa/selftest/liboe.py b/meta/lib/oeqa/selftest/cases/liboe.py
index 0b0301def6..01b2cab7aa 100644
--- a/meta/lib/oeqa/selftest/liboe.py
+++ b/meta/lib/oeqa/selftest/cases/liboe.py
@@ -1,14 +1,13 @@
1from oeqa.selftest.base import oeSelfTest 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake, runCmd 2from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake, runCmd
3import oe.path 3import oe.path
4import glob
5import os 4import os
6import os.path
7 5
8class LibOE(oeSelfTest): 6class LibOE(OESelftestTestCase):
9 7
10 @classmethod 8 @classmethod
11 def setUpClass(cls): 9 def setUpClass(cls):
10 super(LibOE, cls).setUpClass()
12 cls.tmp_dir = get_bb_var('TMPDIR') 11 cls.tmp_dir = get_bb_var('TMPDIR')
13 12
14 def test_copy_tree_special(self): 13 def test_copy_tree_special(self):
diff --git a/meta/lib/oeqa/selftest/lic-checksum.py b/meta/lib/oeqa/selftest/cases/lic_checksum.py
index 2e81373ae4..37407157c1 100644
--- a/meta/lib/oeqa/selftest/lic-checksum.py
+++ b/meta/lib/oeqa/selftest/cases/lic_checksum.py
@@ -1,16 +1,16 @@
1import os 1import os
2import tempfile 2import tempfile
3 3
4from oeqa.selftest.base import oeSelfTest 4from oeqa.selftest.case import OESelftestTestCase
5from oeqa.utils.commands import bitbake 5from oeqa.utils.commands import bitbake
6from oeqa.utils import CommandError 6from oeqa.utils import CommandError
7from oeqa.utils.decorators import testcase 7from oeqa.core.decorator.oeid import OETestID
8 8
9class LicenseTests(oeSelfTest): 9class LicenseTests(OESelftestTestCase):
10 10
11 # Verify that changing a license file that has an absolute path causes 11 # Verify that changing a license file that has an absolute path causes
12 # the license qa to fail due to a mismatched md5sum. 12 # the license qa to fail due to a mismatched md5sum.
13 @testcase(1197) 13 @OETestID(1197)
14 def test_nonmatching_checksum(self): 14 def test_nonmatching_checksum(self):
15 bitbake_cmd = '-c populate_lic emptytest' 15 bitbake_cmd = '-c populate_lic emptytest'
16 error_msg = 'emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc' 16 error_msg = 'emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
diff --git a/meta/lib/oeqa/selftest/manifest.py b/meta/lib/oeqa/selftest/cases/manifest.py
index fe6f949644..146071934d 100644
--- a/meta/lib/oeqa/selftest/manifest.py
+++ b/meta/lib/oeqa/selftest/cases/manifest.py
@@ -1,9 +1,8 @@
1import unittest
2import os 1import os
3 2
4from oeqa.selftest.base import oeSelfTest 3from oeqa.selftest.case import OESelftestTestCase
5from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake 4from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake
6from oeqa.utils.decorators import testcase 5from oeqa.core.decorator.oeid import OETestID
7 6
8class ManifestEntry: 7class ManifestEntry:
9 '''A manifest item of a collection able to list missing packages''' 8 '''A manifest item of a collection able to list missing packages'''
@@ -11,7 +10,7 @@ class ManifestEntry:
11 self.file = entry 10 self.file = entry
12 self.missing = [] 11 self.missing = []
13 12
14class VerifyManifest(oeSelfTest): 13class VerifyManifest(OESelftestTestCase):
15 '''Tests for the manifest files and contents of an image''' 14 '''Tests for the manifest files and contents of an image'''
16 15
17 @classmethod 16 @classmethod
@@ -21,14 +20,14 @@ class VerifyManifest(oeSelfTest):
21 with open(manifest, "r") as mfile: 20 with open(manifest, "r") as mfile:
22 for line in mfile: 21 for line in mfile:
23 manifest_entry = os.path.join(path, line.split()[0]) 22 manifest_entry = os.path.join(path, line.split()[0])
24 self.log.debug("{}: looking for {}"\ 23 self.logger.debug("{}: looking for {}"\
25 .format(self.classname, manifest_entry)) 24 .format(self.classname, manifest_entry))
26 if not os.path.isfile(manifest_entry): 25 if not os.path.isfile(manifest_entry):
27 manifest_errors.append(manifest_entry) 26 manifest_errors.append(manifest_entry)
28 self.log.debug("{}: {} not found"\ 27 self.logger.debug("{}: {} not found"\
29 .format(self.classname, manifest_entry)) 28 .format(self.classname, manifest_entry))
30 except OSError as e: 29 except OSError as e:
31 self.log.debug("{}: checking of {} failed"\ 30 self.logger.debug("{}: checking of {} failed"\
32 .format(self.classname, manifest)) 31 .format(self.classname, manifest))
33 raise e 32 raise e
34 33
@@ -40,7 +39,7 @@ class VerifyManifest(oeSelfTest):
40 target == self.buildtarget if target == None else target 39 target == self.buildtarget if target == None else target
41 directory = get_bb_var(bb_var, target); 40 directory = get_bb_var(bb_var, target);
42 if not directory or not os.path.isdir(directory): 41 if not directory or not os.path.isdir(directory):
43 self.log.debug("{}: {} points to {} when target = {}"\ 42 self.logger.debug("{}: {} points to {} when target = {}"\
44 .format(self.classname, bb_var, directory, target)) 43 .format(self.classname, bb_var, directory, target))
45 raise OSError 44 raise OSError
46 return directory 45 return directory
@@ -48,18 +47,19 @@ class VerifyManifest(oeSelfTest):
48 @classmethod 47 @classmethod
49 def setUpClass(self): 48 def setUpClass(self):
50 49
50 super(VerifyManifest, self).setUpClass()
51 self.buildtarget = 'core-image-minimal' 51 self.buildtarget = 'core-image-minimal'
52 self.classname = 'VerifyManifest' 52 self.classname = 'VerifyManifest'
53 53
54 self.log.info("{}: doing bitbake {} as a prerequisite of the test"\ 54 self.logger.info("{}: doing bitbake {} as a prerequisite of the test"\
55 .format(self.classname, self.buildtarget)) 55 .format(self.classname, self.buildtarget))
56 if bitbake(self.buildtarget).status: 56 if bitbake(self.buildtarget).status:
57 self.log.debug("{} Failed to setup {}"\ 57 self.logger.debug("{} Failed to setup {}"\
58 .format(self.classname, self.buildtarget)) 58 .format(self.classname, self.buildtarget))
59 unittest.SkipTest("{}: Cannot setup testing scenario"\ 59 self.skipTest("{}: Cannot setup testing scenario"\
60 .format(self.classname)) 60 .format(self.classname))
61 61
62 @testcase(1380) 62 @OETestID(1380)
63 def test_SDK_manifest_entries(self): 63 def test_SDK_manifest_entries(self):
64 '''Verifying the SDK manifest entries exist, this may take a build''' 64 '''Verifying the SDK manifest entries exist, this may take a build'''
65 65
@@ -67,12 +67,12 @@ class VerifyManifest(oeSelfTest):
67 # to do an additional setup for the sdk 67 # to do an additional setup for the sdk
68 sdktask = '-c populate_sdk' 68 sdktask = '-c populate_sdk'
69 bbargs = sdktask + ' ' + self.buildtarget 69 bbargs = sdktask + ' ' + self.buildtarget
70 self.log.debug("{}: doing bitbake {} as a prerequisite of the test"\ 70 self.logger.debug("{}: doing bitbake {} as a prerequisite of the test"\
71 .format(self.classname, bbargs)) 71 .format(self.classname, bbargs))
72 if bitbake(bbargs).status: 72 if bitbake(bbargs).status:
73 self.log.debug("{} Failed to bitbake {}"\ 73 self.logger.debug("{} Failed to bitbake {}"\
74 .format(self.classname, bbargs)) 74 .format(self.classname, bbargs))
75 unittest.SkipTest("{}: Cannot setup testing scenario"\ 75 self.skipTest("{}: Cannot setup testing scenario"\
76 .format(self.classname)) 76 .format(self.classname))
77 77
78 78
@@ -91,7 +91,7 @@ class VerifyManifest(oeSelfTest):
91 k) 91 k)
92 mpath[k] = os.path.join(mdir, mfilename[k]) 92 mpath[k] = os.path.join(mdir, mfilename[k])
93 if not os.path.isfile(mpath[k]): 93 if not os.path.isfile(mpath[k]):
94 self.log.debug("{}: {} does not exist".format( 94 self.logger.debug("{}: {} does not exist".format(
95 self.classname, mpath[k])) 95 self.classname, mpath[k]))
96 raise IOError 96 raise IOError
97 m_entry[k] = ManifestEntry(mpath[k]) 97 m_entry[k] = ManifestEntry(mpath[k])
@@ -101,11 +101,11 @@ class VerifyManifest(oeSelfTest):
101 reverse_dir[k] = os.path.join(pkgdata_dir[k], 101 reverse_dir[k] = os.path.join(pkgdata_dir[k],
102 'runtime-reverse') 102 'runtime-reverse')
103 if not os.path.exists(reverse_dir[k]): 103 if not os.path.exists(reverse_dir[k]):
104 self.log.debug("{}: {} does not exist".format( 104 self.logger.debug("{}: {} does not exist".format(
105 self.classname, reverse_dir[k])) 105 self.classname, reverse_dir[k]))
106 raise IOError 106 raise IOError
107 except OSError: 107 except OSError:
108 raise unittest.SkipTest("{}: Error in obtaining manifest dirs"\ 108 raise self.skipTest("{}: Error in obtaining manifest dirs"\
109 .format(self.classname)) 109 .format(self.classname))
110 except IOError: 110 except IOError:
111 msg = "{}: Error cannot find manifests in the specified dir:\n{}"\ 111 msg = "{}: Error cannot find manifests in the specified dir:\n{}"\
@@ -113,7 +113,7 @@ class VerifyManifest(oeSelfTest):
113 self.fail(msg) 113 self.fail(msg)
114 114
115 for k in d_target.keys(): 115 for k in d_target.keys():
116 self.log.debug("{}: Check manifest {}".format( 116 self.logger.debug("{}: Check manifest {}".format(
117 self.classname, m_entry[k].file)) 117 self.classname, m_entry[k].file))
118 118
119 m_entry[k].missing = self.check_manifest_entries(\ 119 m_entry[k].missing = self.check_manifest_entries(\
@@ -122,11 +122,11 @@ class VerifyManifest(oeSelfTest):
122 msg = '{}: {} Error has the following missing entries'\ 122 msg = '{}: {} Error has the following missing entries'\
123 .format(self.classname, m_entry[k].file) 123 .format(self.classname, m_entry[k].file)
124 logmsg = msg+':\n'+'\n'.join(m_entry[k].missing) 124 logmsg = msg+':\n'+'\n'.join(m_entry[k].missing)
125 self.log.debug(logmsg) 125 self.logger.debug(logmsg)
126 self.log.info(msg) 126 self.logger.info(msg)
127 self.fail(logmsg) 127 self.fail(logmsg)
128 128
129 @testcase(1381) 129 @OETestID(1381)
130 def test_image_manifest_entries(self): 130 def test_image_manifest_entries(self):
131 '''Verifying the image manifest entries exist''' 131 '''Verifying the image manifest entries exist'''
132 132
@@ -146,14 +146,14 @@ class VerifyManifest(oeSelfTest):
146 revdir = os.path.join(pkgdata_dir, 'runtime-reverse') 146 revdir = os.path.join(pkgdata_dir, 'runtime-reverse')
147 if not os.path.exists(revdir): raise IOError 147 if not os.path.exists(revdir): raise IOError
148 except OSError: 148 except OSError:
149 raise unittest.SkipTest("{}: Error in obtaining manifest dirs"\ 149 raise self.skipTest("{}: Error in obtaining manifest dirs"\
150 .format(self.classname)) 150 .format(self.classname))
151 except IOError: 151 except IOError:
152 msg = "{}: Error cannot find manifests in dir:\n{}"\ 152 msg = "{}: Error cannot find manifests in dir:\n{}"\
153 .format(self.classname, mdir) 153 .format(self.classname, mdir)
154 self.fail(msg) 154 self.fail(msg)
155 155
156 self.log.debug("{}: Check manifest {}"\ 156 self.logger.debug("{}: Check manifest {}"\
157 .format(self.classname, m_entry.file)) 157 .format(self.classname, m_entry.file))
158 m_entry.missing = self.check_manifest_entries(\ 158 m_entry.missing = self.check_manifest_entries(\
159 m_entry.file, revdir) 159 m_entry.file, revdir)
@@ -161,6 +161,6 @@ class VerifyManifest(oeSelfTest):
161 msg = '{}: {} Error has the following missing entries'\ 161 msg = '{}: {} Error has the following missing entries'\
162 .format(self.classname, m_entry.file) 162 .format(self.classname, m_entry.file)
163 logmsg = msg+':\n'+'\n'.join(m_entry.missing) 163 logmsg = msg+':\n'+'\n'.join(m_entry.missing)
164 self.log.debug(logmsg) 164 self.logger.debug(logmsg)
165 self.log.info(msg) 165 self.logger.info(msg)
166 self.fail(logmsg) 166 self.fail(logmsg)
diff --git a/meta/lib/oeqa/selftest/oelib/__init__.py b/meta/lib/oeqa/selftest/cases/oelib/__init__.py
index e69de29bb2..e69de29bb2 100644
--- a/meta/lib/oeqa/selftest/oelib/__init__.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/__init__.py
diff --git a/meta/lib/oeqa/selftest/oelib/buildhistory.py b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
index 5ed4b026fe..4e877517c1 100644
--- a/meta/lib/oeqa/selftest/oelib/buildhistory.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
@@ -1,11 +1,11 @@
1import os 1import os
2import unittest 2from oeqa.selftest.case import OESelftestTestCase
3import tempfile 3import tempfile
4from git import Repo 4from git import Repo
5from oeqa.utils.commands import get_bb_var 5from oeqa.utils.commands import get_bb_var
6from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs 6from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs
7 7
8class TestBlobParsing(unittest.TestCase): 8class TestBlobParsing(OESelftestTestCase):
9 9
10 def setUp(self): 10 def setUp(self):
11 import time 11 import time
diff --git a/meta/lib/oeqa/selftest/oelib/elf.py b/meta/lib/oeqa/selftest/cases/oelib/elf.py
index 1f59037ed9..0451ebaffb 100644
--- a/meta/lib/oeqa/selftest/oelib/elf.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/elf.py
@@ -1,7 +1,7 @@
1import unittest 1from oeqa.selftest.case import OESelftestTestCase
2import oe.qa 2import oe.qa
3 3
4class TestElf(unittest.TestCase): 4class TestElf(OESelftestTestCase):
5 def test_machine_name(self): 5 def test_machine_name(self):
6 """ 6 """
7 Test elf_machine_to_string() 7 Test elf_machine_to_string()
diff --git a/meta/lib/oeqa/selftest/oelib/license.py b/meta/lib/oeqa/selftest/cases/oelib/license.py
index c388886184..a6d9c9ac7a 100644
--- a/meta/lib/oeqa/selftest/oelib/license.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/license.py
@@ -1,4 +1,4 @@
1import unittest 1from oeqa.selftest.case import OESelftestTestCase
2import oe.license 2import oe.license
3 3
4class SeenVisitor(oe.license.LicenseVisitor): 4class SeenVisitor(oe.license.LicenseVisitor):
@@ -9,7 +9,7 @@ class SeenVisitor(oe.license.LicenseVisitor):
9 def visit_Str(self, node): 9 def visit_Str(self, node):
10 self.seen.append(node.s) 10 self.seen.append(node.s)
11 11
12class TestSingleLicense(unittest.TestCase): 12class TestSingleLicense(OESelftestTestCase):
13 licenses = [ 13 licenses = [
14 "GPLv2", 14 "GPLv2",
15 "LGPL-2.0", 15 "LGPL-2.0",
@@ -37,7 +37,7 @@ class TestSingleLicense(unittest.TestCase):
37 self.parse(license) 37 self.parse(license)
38 self.assertEqual(cm.exception.license, license) 38 self.assertEqual(cm.exception.license, license)
39 39
40class TestSimpleCombinations(unittest.TestCase): 40class TestSimpleCombinations(OESelftestTestCase):
41 tests = { 41 tests = {
42 "FOO&BAR": ["FOO", "BAR"], 42 "FOO&BAR": ["FOO", "BAR"],
43 "BAZ & MOO": ["BAZ", "MOO"], 43 "BAZ & MOO": ["BAZ", "MOO"],
diff --git a/meta/lib/oeqa/selftest/oelib/path.py b/meta/lib/oeqa/selftest/cases/oelib/path.py
index 44d068143e..2ae5eaf89e 100644
--- a/meta/lib/oeqa/selftest/oelib/path.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/path.py
@@ -1,11 +1,11 @@
1import unittest 1from oeqa.selftest.case import OESelftestTestCase
2import oe, oe.path 2import oe, oe.path
3import tempfile 3import tempfile
4import os 4import os
5import errno 5import errno
6import shutil 6import shutil
7 7
8class TestRealPath(unittest.TestCase): 8class TestRealPath(OESelftestTestCase):
9 DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ] 9 DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
10 FILES = [ "etc/passwd", "b/file" ] 10 FILES = [ "etc/passwd", "b/file" ]
11 LINKS = [ 11 LINKS = [
diff --git a/meta/lib/oeqa/selftest/oelib/types.py b/meta/lib/oeqa/selftest/cases/oelib/types.py
index 4fe2746a3b..99c84044be 100644
--- a/meta/lib/oeqa/selftest/oelib/types.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/types.py
@@ -1,7 +1,7 @@
1import unittest 1from oeqa.selftest.case import OESelftestTestCase
2from oe.maketype import create 2from oe.maketype import create
3 3
4class TestBooleanType(unittest.TestCase): 4class TestBooleanType(OESelftestTestCase):
5 def test_invalid(self): 5 def test_invalid(self):
6 self.assertRaises(ValueError, create, '', 'boolean') 6 self.assertRaises(ValueError, create, '', 'boolean')
7 self.assertRaises(ValueError, create, 'foo', 'boolean') 7 self.assertRaises(ValueError, create, 'foo', 'boolean')
@@ -31,7 +31,7 @@ class TestBooleanType(unittest.TestCase):
31 self.assertEqual(create('y', 'boolean'), True) 31 self.assertEqual(create('y', 'boolean'), True)
32 self.assertNotEqual(create('y', 'boolean'), False) 32 self.assertNotEqual(create('y', 'boolean'), False)
33 33
34class TestList(unittest.TestCase): 34class TestList(OESelftestTestCase):
35 def assertListEqual(self, value, valid, sep=None): 35 def assertListEqual(self, value, valid, sep=None):
36 obj = create(value, 'list', separator=sep) 36 obj = create(value, 'list', separator=sep)
37 self.assertEqual(obj, valid) 37 self.assertEqual(obj, valid)
diff --git a/meta/lib/oeqa/selftest/oelib/utils.py b/meta/lib/oeqa/selftest/cases/oelib/utils.py
index 7deb10f3c8..5bc5fffae7 100644
--- a/meta/lib/oeqa/selftest/oelib/utils.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/utils.py
@@ -1,7 +1,7 @@
1import unittest 1from oeqa.selftest.case import OESelftestTestCase
2from oe.utils import packages_filter_out_system, trim_version 2from oe.utils import packages_filter_out_system, trim_version
3 3
4class TestPackagesFilterOutSystem(unittest.TestCase): 4class TestPackagesFilterOutSystem(OESelftestTestCase):
5 def test_filter(self): 5 def test_filter(self):
6 """ 6 """
7 Test that oe.utils.packages_filter_out_system works. 7 Test that oe.utils.packages_filter_out_system works.
@@ -31,7 +31,7 @@ class TestPackagesFilterOutSystem(unittest.TestCase):
31 self.assertEqual(pkgs, ["foo-data"]) 31 self.assertEqual(pkgs, ["foo-data"])
32 32
33 33
34class TestTrimVersion(unittest.TestCase): 34class TestTrimVersion(OESelftestTestCase):
35 def test_version_exception(self): 35 def test_version_exception(self):
36 with self.assertRaises(TypeError): 36 with self.assertRaises(TypeError):
37 trim_version(None, 2) 37 trim_version(None, 2)
diff --git a/meta/lib/oeqa/selftest/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index 29547f56a9..1ee753763e 100644
--- a/meta/lib/oeqa/selftest/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -1,18 +1,11 @@
1import datetime 1from oeqa.selftest.case import OESelftestTestCase
2import unittest 2from oeqa.selftest.cases.buildhistory import BuildhistoryBase
3import os
4import re
5import shutil
6
7import oeqa.utils.ftools as ftools
8from oeqa.selftest.base import oeSelfTest
9from oeqa.selftest.buildhistory import BuildhistoryBase
10from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer 3from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
11from oeqa.utils.decorators import testcase 4from oeqa.core.decorator.oeid import OETestID
12 5
13class BuildhistoryDiffTests(BuildhistoryBase): 6class BuildhistoryDiffTests(BuildhistoryBase):
14 7
15 @testcase(295) 8 @OETestID(295)
16 def test_buildhistory_diff(self): 9 def test_buildhistory_diff(self):
17 target = 'xcursor-transparent-theme' 10 target = 'xcursor-transparent-theme'
18 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) 11 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
diff --git a/meta/lib/oeqa/selftest/package.py b/meta/lib/oeqa/selftest/cases/package.py
index 95125f220d..6a8bc9283f 100644
--- a/meta/lib/oeqa/selftest/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -1,9 +1,9 @@
1from oeqa.selftest.base import oeSelfTest 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import bitbake, get_bb_vars 2from oeqa.utils.commands import bitbake, get_bb_vars
3import subprocess, os 3import subprocess, os
4import oe.path 4import oe.path
5 5
6class VersionOrdering(oeSelfTest): 6class VersionOrdering(OESelftestTestCase):
7 # version1, version2, sort order 7 # version1, version2, sort order
8 tests = ( 8 tests = (
9 ("1.0", "1.0", 0), 9 ("1.0", "1.0", 0),
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/cases/pkgdata.py
index d69c3c800a..0b4caf1b2c 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
@@ -1,24 +1,21 @@
1import unittest
2import os 1import os
3import tempfile 2import tempfile
4import logging
5import fnmatch 3import fnmatch
6 4
7import oeqa.utils.ftools as ftools 5from oeqa.selftest.case import OESelftestTestCase
8from oeqa.selftest.base import oeSelfTest
9from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
10from oeqa.utils.decorators import testcase 7from oeqa.core.decorator.oeid import OETestID
11 8
12class OePkgdataUtilTests(oeSelfTest): 9class OePkgdataUtilTests(OESelftestTestCase):
13 10
14 @classmethod 11 @classmethod
15 def setUpClass(cls): 12 def setUpClass(cls):
13 super(OePkgdataUtilTests, cls).setUpClass()
16 # Ensure we have the right data in pkgdata 14 # Ensure we have the right data in pkgdata
17 logger = logging.getLogger("selftest") 15 cls.logger.info('Running bitbake to generate pkgdata')
18 logger.info('Running bitbake to generate pkgdata')
19 bitbake('busybox zlib m4') 16 bitbake('busybox zlib m4')
20 17
21 @testcase(1203) 18 @OETestID(1203)
22 def test_lookup_pkg(self): 19 def test_lookup_pkg(self):
23 # Forward tests 20 # Forward tests
24 result = runCmd('oe-pkgdata-util lookup-pkg "zlib busybox"') 21 result = runCmd('oe-pkgdata-util lookup-pkg "zlib busybox"')
@@ -37,7 +34,7 @@ class OePkgdataUtilTests(oeSelfTest):
37 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) 34 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
38 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 35 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
39 36
40 @testcase(1205) 37 @OETestID(1205)
41 def test_read_value(self): 38 def test_read_value(self):
42 result = runCmd('oe-pkgdata-util read-value PN libz1') 39 result = runCmd('oe-pkgdata-util read-value PN libz1')
43 self.assertEqual(result.output, 'zlib') 40 self.assertEqual(result.output, 'zlib')
@@ -47,7 +44,7 @@ class OePkgdataUtilTests(oeSelfTest):
47 pkgsize = int(result.output.strip()) 44 pkgsize = int(result.output.strip())
48 self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output) 45 self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output)
49 46
50 @testcase(1198) 47 @OETestID(1198)
51 def test_find_path(self): 48 def test_find_path(self):
52 result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1') 49 result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')
53 self.assertEqual(result.output, 'zlib: /lib/libz.so.1') 50 self.assertEqual(result.output, 'zlib: /lib/libz.so.1')
@@ -57,7 +54,7 @@ class OePkgdataUtilTests(oeSelfTest):
57 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) 54 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
58 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist') 55 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
59 56
60 @testcase(1204) 57 @OETestID(1204)
61 def test_lookup_recipe(self): 58 def test_lookup_recipe(self):
62 result = runCmd('oe-pkgdata-util lookup-recipe "libz-staticdev busybox"') 59 result = runCmd('oe-pkgdata-util lookup-recipe "libz-staticdev busybox"')
63 self.assertEqual(result.output, 'zlib\nbusybox') 60 self.assertEqual(result.output, 'zlib\nbusybox')
@@ -67,7 +64,7 @@ class OePkgdataUtilTests(oeSelfTest):
67 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) 64 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
68 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 65 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
69 66
70 @testcase(1202) 67 @OETestID(1202)
71 def test_list_pkgs(self): 68 def test_list_pkgs(self):
72 # No arguments 69 # No arguments
73 result = runCmd('oe-pkgdata-util list-pkgs') 70 result = runCmd('oe-pkgdata-util list-pkgs')
@@ -111,7 +108,7 @@ class OePkgdataUtilTests(oeSelfTest):
111 pkglist = sorted(result.output.split()) 108 pkglist = sorted(result.output.split())
112 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'], "Packages listed: %s" % result.output) 109 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'], "Packages listed: %s" % result.output)
113 110
114 @testcase(1201) 111 @OETestID(1201)
115 def test_list_pkg_files(self): 112 def test_list_pkg_files(self):
116 def splitoutput(output): 113 def splitoutput(output):
117 files = {} 114 files = {}
@@ -201,7 +198,7 @@ class OePkgdataUtilTests(oeSelfTest):
201 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) 198 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
202 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) 199 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
203 200
204 @testcase(1200) 201 @OETestID(1200)
205 def test_glob(self): 202 def test_glob(self):
206 tempdir = tempfile.mkdtemp(prefix='pkgdataqa') 203 tempdir = tempfile.mkdtemp(prefix='pkgdataqa')
207 self.track_for_cleanup(tempdir) 204 self.track_for_cleanup(tempdir)
@@ -221,7 +218,7 @@ class OePkgdataUtilTests(oeSelfTest):
221 self.assertNotIn('libz-dev', resultlist) 218 self.assertNotIn('libz-dev', resultlist)
222 self.assertNotIn('libz-dbg', resultlist) 219 self.assertNotIn('libz-dbg', resultlist)
223 220
224 @testcase(1206) 221 @OETestID(1206)
225 def test_specify_pkgdatadir(self): 222 def test_specify_pkgdatadir(self):
226 result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR')) 223 result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
227 self.assertEqual(result.output, 'libz1') 224 self.assertEqual(result.output, 'libz1')
diff --git a/meta/lib/oeqa/selftest/prservice.py b/meta/lib/oeqa/selftest/cases/prservice.py
index 34d419762c..ed36f0fed7 100644
--- a/meta/lib/oeqa/selftest/prservice.py
+++ b/meta/lib/oeqa/selftest/cases/prservice.py
@@ -1,20 +1,19 @@
1import unittest
2import os 1import os
3import logging
4import re 2import re
5import shutil 3import shutil
6import datetime 4import datetime
7 5
8import oeqa.utils.ftools as ftools 6import oeqa.utils.ftools as ftools
9from oeqa.selftest.base import oeSelfTest 7from oeqa.selftest.case import OESelftestTestCase
10from oeqa.utils.commands import runCmd, bitbake, get_bb_var 8from oeqa.utils.commands import runCmd, bitbake, get_bb_var
11from oeqa.utils.decorators import testcase 9from oeqa.core.decorator.oeid import OETestID
12from oeqa.utils.network import get_free_port 10from oeqa.utils.network import get_free_port
13 11
14class BitbakePrTests(oeSelfTest): 12class BitbakePrTests(OESelftestTestCase):
15 13
16 @classmethod 14 @classmethod
17 def setUpClass(cls): 15 def setUpClass(cls):
16 super(BitbakePrTests, cls).setUpClass()
18 cls.pkgdata_dir = get_bb_var('PKGDATA_DIR') 17 cls.pkgdata_dir = get_bb_var('PKGDATA_DIR')
19 18
20 def get_pr_version(self, package_name): 19 def get_pr_version(self, package_name):
@@ -89,39 +88,39 @@ class BitbakePrTests(oeSelfTest):
89 88
90 self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1") 89 self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
91 90
92 @testcase(930) 91 @OETestID(930)
93 def test_import_export_replace_db(self): 92 def test_import_export_replace_db(self):
94 self.run_test_pr_export_import('m4') 93 self.run_test_pr_export_import('m4')
95 94
96 @testcase(931) 95 @OETestID(931)
97 def test_import_export_override_db(self): 96 def test_import_export_override_db(self):
98 self.run_test_pr_export_import('m4', replace_current_db=False) 97 self.run_test_pr_export_import('m4', replace_current_db=False)
99 98
100 @testcase(932) 99 @OETestID(932)
101 def test_pr_service_rpm_arch_dep(self): 100 def test_pr_service_rpm_arch_dep(self):
102 self.run_test_pr_service('m4', 'rpm', 'do_package') 101 self.run_test_pr_service('m4', 'rpm', 'do_package')
103 102
104 @testcase(934) 103 @OETestID(934)
105 def test_pr_service_deb_arch_dep(self): 104 def test_pr_service_deb_arch_dep(self):
106 self.run_test_pr_service('m4', 'deb', 'do_package') 105 self.run_test_pr_service('m4', 'deb', 'do_package')
107 106
108 @testcase(933) 107 @OETestID(933)
109 def test_pr_service_ipk_arch_dep(self): 108 def test_pr_service_ipk_arch_dep(self):
110 self.run_test_pr_service('m4', 'ipk', 'do_package') 109 self.run_test_pr_service('m4', 'ipk', 'do_package')
111 110
112 @testcase(935) 111 @OETestID(935)
113 def test_pr_service_rpm_arch_indep(self): 112 def test_pr_service_rpm_arch_indep(self):
114 self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package') 113 self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package')
115 114
116 @testcase(937) 115 @OETestID(937)
117 def test_pr_service_deb_arch_indep(self): 116 def test_pr_service_deb_arch_indep(self):
118 self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package') 117 self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package')
119 118
120 @testcase(936) 119 @OETestID(936)
121 def test_pr_service_ipk_arch_indep(self): 120 def test_pr_service_ipk_arch_indep(self):
122 self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package') 121 self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package')
123 122
124 @testcase(1419) 123 @OETestID(1419)
125 def test_stopping_prservice_message(self): 124 def test_stopping_prservice_message(self):
126 port = get_free_port() 125 port = get_free_port()
127 126
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index 4344f9fdeb..46f0a7206b 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -1,18 +1,15 @@
1import os 1import os
2import logging
3import shutil 2import shutil
4import tempfile 3import tempfile
5import urllib.parse 4import urllib.parse
6 5
7from oeqa.utils.commands import runCmd, bitbake, get_bb_var 6from oeqa.utils.commands import runCmd, bitbake, get_bb_var
8from oeqa.utils.commands import get_bb_vars, create_temp_layer 7from oeqa.utils.commands import get_bb_vars, create_temp_layer
9from oeqa.utils.decorators import testcase 8from oeqa.core.decorator.oeid import OETestID
10from oeqa.selftest import devtool 9from oeqa.selftest.cases import devtool
11
12 10
13templayerdir = None 11templayerdir = None
14 12
15
16def setUpModule(): 13def setUpModule():
17 global templayerdir 14 global templayerdir
18 templayerdir = tempfile.mkdtemp(prefix='recipetoolqa') 15 templayerdir = tempfile.mkdtemp(prefix='recipetoolqa')
@@ -28,6 +25,7 @@ def tearDownModule():
28class RecipetoolBase(devtool.DevtoolBase): 25class RecipetoolBase(devtool.DevtoolBase):
29 26
30 def setUpLocal(self): 27 def setUpLocal(self):
28 super(RecipetoolBase, self).setUpLocal()
31 self.templayerdir = templayerdir 29 self.templayerdir = templayerdir
32 self.tempdir = tempfile.mkdtemp(prefix='recipetoolqa') 30 self.tempdir = tempfile.mkdtemp(prefix='recipetoolqa')
33 self.track_for_cleanup(self.tempdir) 31 self.track_for_cleanup(self.tempdir)
@@ -37,6 +35,7 @@ class RecipetoolBase(devtool.DevtoolBase):
37 35
38 def tearDownLocal(self): 36 def tearDownLocal(self):
39 runCmd('rm -rf %s/recipes-*' % self.templayerdir) 37 runCmd('rm -rf %s/recipes-*' % self.templayerdir)
38 super(RecipetoolBase, self).tearDownLocal()
40 39
41 def _try_recipetool_appendcmd(self, cmd, testrecipe, expectedfiles, expectedlines=None): 40 def _try_recipetool_appendcmd(self, cmd, testrecipe, expectedfiles, expectedlines=None):
42 result = runCmd(cmd) 41 result = runCmd(cmd)
@@ -70,9 +69,9 @@ class RecipetoolTests(RecipetoolBase):
70 69
71 @classmethod 70 @classmethod
72 def setUpClass(cls): 71 def setUpClass(cls):
72 super(RecipetoolTests, cls).setUpClass()
73 # Ensure we have the right data in shlibs/pkgdata 73 # Ensure we have the right data in shlibs/pkgdata
74 logger = logging.getLogger("selftest") 74 cls.logger.info('Running bitbake to generate pkgdata')
75 logger.info('Running bitbake to generate pkgdata')
76 bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile') 75 bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
77 bb_vars = get_bb_vars(['COREBASE', 'BBPATH']) 76 bb_vars = get_bb_vars(['COREBASE', 'BBPATH'])
78 cls.corebase = bb_vars['COREBASE'] 77 cls.corebase = bb_vars['COREBASE']
@@ -90,7 +89,7 @@ class RecipetoolTests(RecipetoolBase):
90 for errorstr in checkerror: 89 for errorstr in checkerror:
91 self.assertIn(errorstr, result.output) 90 self.assertIn(errorstr, result.output)
92 91
93 @testcase(1177) 92 @OETestID(1177)
94 def test_recipetool_appendfile_basic(self): 93 def test_recipetool_appendfile_basic(self):
95 # Basic test 94 # Basic test
96 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 95 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -98,14 +97,14 @@ class RecipetoolTests(RecipetoolBase):
98 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd']) 97 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd'])
99 self.assertNotIn('WARNING: ', output) 98 self.assertNotIn('WARNING: ', output)
100 99
101 @testcase(1183) 100 @OETestID(1183)
102 def test_recipetool_appendfile_invalid(self): 101 def test_recipetool_appendfile_invalid(self):
103 # Test some commands that should error 102 # Test some commands that should error
104 self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers']) 103 self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers'])
105 self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool']) 104 self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool'])
106 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool']) 105 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool'])
107 106
108 @testcase(1176) 107 @OETestID(1176)
109 def test_recipetool_appendfile_alternatives(self): 108 def test_recipetool_appendfile_alternatives(self):
110 # Now try with a file we know should be an alternative 109 # Now try with a file we know should be an alternative
111 # (this is very much a fake example, but one we know is reliably an alternative) 110 # (this is very much a fake example, but one we know is reliably an alternative)
@@ -129,7 +128,7 @@ class RecipetoolTests(RecipetoolBase):
129 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True) 128 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
130 self.assertNotEqual(result.status, 0, 'New file should have been copied but was not %s' % result.output) 129 self.assertNotEqual(result.status, 0, 'New file should have been copied but was not %s' % result.output)
131 130
132 @testcase(1178) 131 @OETestID(1178)
133 def test_recipetool_appendfile_binary(self): 132 def test_recipetool_appendfile_binary(self):
134 # Try appending a binary file 133 # Try appending a binary file
135 # /bin/ls can be a symlink to /usr/bin/ls 134 # /bin/ls can be a symlink to /usr/bin/ls
@@ -138,7 +137,7 @@ class RecipetoolTests(RecipetoolBase):
138 self.assertIn('WARNING: ', result.output) 137 self.assertIn('WARNING: ', result.output)
139 self.assertIn('is a binary', result.output) 138 self.assertIn('is a binary', result.output)
140 139
141 @testcase(1173) 140 @OETestID(1173)
142 def test_recipetool_appendfile_add(self): 141 def test_recipetool_appendfile_add(self):
143 # Try arbitrary file add to a recipe 142 # Try arbitrary file add to a recipe
144 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 143 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -167,7 +166,7 @@ class RecipetoolTests(RecipetoolBase):
167 '}\n'] 166 '}\n']
168 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name]) 167 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
169 168
170 @testcase(1174) 169 @OETestID(1174)
171 def test_recipetool_appendfile_add_bindir(self): 170 def test_recipetool_appendfile_add_bindir(self):
172 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 171 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
173 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 172 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -181,7 +180,7 @@ class RecipetoolTests(RecipetoolBase):
181 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile']) 180 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
182 self.assertNotIn('WARNING: ', output) 181 self.assertNotIn('WARNING: ', output)
183 182
184 @testcase(1175) 183 @OETestID(1175)
185 def test_recipetool_appendfile_add_machine(self): 184 def test_recipetool_appendfile_add_machine(self):
186 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 185 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
187 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 186 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -197,7 +196,7 @@ class RecipetoolTests(RecipetoolBase):
197 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile']) 196 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
198 self.assertNotIn('WARNING: ', output) 197 self.assertNotIn('WARNING: ', output)
199 198
200 @testcase(1184) 199 @OETestID(1184)
201 def test_recipetool_appendfile_orig(self): 200 def test_recipetool_appendfile_orig(self):
202 # A file that's in SRC_URI and in do_install with the same name 201 # A file that's in SRC_URI and in do_install with the same name
203 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 202 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -205,7 +204,7 @@ class RecipetoolTests(RecipetoolBase):
205 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig']) 204 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig'])
206 self.assertNotIn('WARNING: ', output) 205 self.assertNotIn('WARNING: ', output)
207 206
208 @testcase(1191) 207 @OETestID(1191)
209 def test_recipetool_appendfile_todir(self): 208 def test_recipetool_appendfile_todir(self):
210 # A file that's in SRC_URI and in do_install with destination directory rather than file 209 # A file that's in SRC_URI and in do_install with destination directory rather than file
211 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 210 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -213,7 +212,7 @@ class RecipetoolTests(RecipetoolBase):
213 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir']) 212 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir'])
214 self.assertNotIn('WARNING: ', output) 213 self.assertNotIn('WARNING: ', output)
215 214
216 @testcase(1187) 215 @OETestID(1187)
217 def test_recipetool_appendfile_renamed(self): 216 def test_recipetool_appendfile_renamed(self):
218 # A file that's in SRC_URI with a different name to the destination file 217 # A file that's in SRC_URI with a different name to the destination file
219 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 218 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -221,7 +220,7 @@ class RecipetoolTests(RecipetoolBase):
221 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1']) 220 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1'])
222 self.assertNotIn('WARNING: ', output) 221 self.assertNotIn('WARNING: ', output)
223 222
224 @testcase(1190) 223 @OETestID(1190)
225 def test_recipetool_appendfile_subdir(self): 224 def test_recipetool_appendfile_subdir(self):
226 # A file that's in SRC_URI in a subdir 225 # A file that's in SRC_URI in a subdir
227 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 226 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -235,7 +234,7 @@ class RecipetoolTests(RecipetoolBase):
235 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile']) 234 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
236 self.assertNotIn('WARNING: ', output) 235 self.assertNotIn('WARNING: ', output)
237 236
238 @testcase(1189) 237 @OETestID(1189)
239 def test_recipetool_appendfile_src_glob(self): 238 def test_recipetool_appendfile_src_glob(self):
240 # A file that's in SRC_URI as a glob 239 # A file that's in SRC_URI as a glob
241 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 240 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -249,7 +248,7 @@ class RecipetoolTests(RecipetoolBase):
249 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile']) 248 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile'])
250 self.assertNotIn('WARNING: ', output) 249 self.assertNotIn('WARNING: ', output)
251 250
252 @testcase(1181) 251 @OETestID(1181)
253 def test_recipetool_appendfile_inst_glob(self): 252 def test_recipetool_appendfile_inst_glob(self):
254 # A file that's in do_install as a glob 253 # A file that's in do_install as a glob
255 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 254 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -257,7 +256,7 @@ class RecipetoolTests(RecipetoolBase):
257 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile']) 256 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile'])
258 self.assertNotIn('WARNING: ', output) 257 self.assertNotIn('WARNING: ', output)
259 258
260 @testcase(1182) 259 @OETestID(1182)
261 def test_recipetool_appendfile_inst_todir_glob(self): 260 def test_recipetool_appendfile_inst_todir_glob(self):
262 # A file that's in do_install as a glob with destination as a directory 261 # A file that's in do_install as a glob with destination as a directory
263 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 262 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -265,7 +264,7 @@ class RecipetoolTests(RecipetoolBase):
265 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile']) 264 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile'])
266 self.assertNotIn('WARNING: ', output) 265 self.assertNotIn('WARNING: ', output)
267 266
268 @testcase(1185) 267 @OETestID(1185)
269 def test_recipetool_appendfile_patch(self): 268 def test_recipetool_appendfile_patch(self):
270 # A file that's added by a patch in SRC_URI 269 # A file that's added by a patch in SRC_URI
271 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 270 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -284,7 +283,7 @@ class RecipetoolTests(RecipetoolBase):
284 else: 283 else:
285 self.fail('Patch warning not found in output:\n%s' % output) 284 self.fail('Patch warning not found in output:\n%s' % output)
286 285
287 @testcase(1188) 286 @OETestID(1188)
288 def test_recipetool_appendfile_script(self): 287 def test_recipetool_appendfile_script(self):
289 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install) 288 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install)
290 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 289 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -298,7 +297,7 @@ class RecipetoolTests(RecipetoolBase):
298 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile']) 297 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
299 self.assertNotIn('WARNING: ', output) 298 self.assertNotIn('WARNING: ', output)
300 299
301 @testcase(1180) 300 @OETestID(1180)
302 def test_recipetool_appendfile_inst_func(self): 301 def test_recipetool_appendfile_inst_func(self):
303 # A file that's installed from a function called by do_install 302 # A file that's installed from a function called by do_install
304 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 303 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -306,7 +305,7 @@ class RecipetoolTests(RecipetoolBase):
306 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func']) 305 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func'])
307 self.assertNotIn('WARNING: ', output) 306 self.assertNotIn('WARNING: ', output)
308 307
309 @testcase(1186) 308 @OETestID(1186)
310 def test_recipetool_appendfile_postinstall(self): 309 def test_recipetool_appendfile_postinstall(self):
311 # A file that's created by a postinstall script (and explicitly mentioned in it) 310 # A file that's created by a postinstall script (and explicitly mentioned in it)
312 # First try without specifying recipe 311 # First try without specifying recipe
@@ -322,7 +321,7 @@ class RecipetoolTests(RecipetoolBase):
322 '}\n'] 321 '}\n']
323 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) 322 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
324 323
325 @testcase(1179) 324 @OETestID(1179)
326 def test_recipetool_appendfile_extlayer(self): 325 def test_recipetool_appendfile_extlayer(self):
327 # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure 326 # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure
328 exttemplayerdir = os.path.join(self.tempdir, 'extlayer') 327 exttemplayerdir = os.path.join(self.tempdir, 'extlayer')
@@ -338,7 +337,7 @@ class RecipetoolTests(RecipetoolBase):
338 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig'] 337 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig']
339 self.assertEqual(sorted(createdfiles), sorted(expectedfiles)) 338 self.assertEqual(sorted(createdfiles), sorted(expectedfiles))
340 339
341 @testcase(1192) 340 @OETestID(1192)
342 def test_recipetool_appendfile_wildcard(self): 341 def test_recipetool_appendfile_wildcard(self):
343 342
344 def try_appendfile_wc(options): 343 def try_appendfile_wc(options):
@@ -363,7 +362,7 @@ class RecipetoolTests(RecipetoolBase):
363 filename = try_appendfile_wc('-w') 362 filename = try_appendfile_wc('-w')
364 self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend') 363 self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
365 364
366 @testcase(1193) 365 @OETestID(1193)
367 def test_recipetool_create(self): 366 def test_recipetool_create(self):
368 # Try adding a recipe 367 # Try adding a recipe
369 tempsrc = os.path.join(self.tempdir, 'srctree') 368 tempsrc = os.path.join(self.tempdir, 'srctree')
@@ -380,7 +379,7 @@ class RecipetoolTests(RecipetoolBase):
380 checkvars['SRC_URI[sha256sum]'] = 'dece4bfeb9d8374a0ecafa34be139b5a697db5c926dcc69a9b8715431a22e733' 379 checkvars['SRC_URI[sha256sum]'] = 'dece4bfeb9d8374a0ecafa34be139b5a697db5c926dcc69a9b8715431a22e733'
381 self._test_recipe_contents(recipefile, checkvars, []) 380 self._test_recipe_contents(recipefile, checkvars, [])
382 381
383 @testcase(1194) 382 @OETestID(1194)
384 def test_recipetool_create_git(self): 383 def test_recipetool_create_git(self):
385 if 'x11' not in get_bb_var('DISTRO_FEATURES'): 384 if 'x11' not in get_bb_var('DISTRO_FEATURES'):
386 self.skipTest('Test requires x11 as distro feature') 385 self.skipTest('Test requires x11 as distro feature')
@@ -403,7 +402,7 @@ class RecipetoolTests(RecipetoolBase):
403 inherits = ['autotools', 'pkgconfig'] 402 inherits = ['autotools', 'pkgconfig']
404 self._test_recipe_contents(recipefile, checkvars, inherits) 403 self._test_recipe_contents(recipefile, checkvars, inherits)
405 404
406 @testcase(1392) 405 @OETestID(1392)
407 def test_recipetool_create_simple(self): 406 def test_recipetool_create_simple(self):
408 # Try adding a recipe 407 # Try adding a recipe
409 temprecipe = os.path.join(self.tempdir, 'recipe') 408 temprecipe = os.path.join(self.tempdir, 'recipe')
@@ -426,7 +425,7 @@ class RecipetoolTests(RecipetoolBase):
426 inherits = ['autotools'] 425 inherits = ['autotools']
427 self._test_recipe_contents(os.path.join(temprecipe, dirlist[0]), checkvars, inherits) 426 self._test_recipe_contents(os.path.join(temprecipe, dirlist[0]), checkvars, inherits)
428 427
429 @testcase(1418) 428 @OETestID(1418)
430 def test_recipetool_create_cmake(self): 429 def test_recipetool_create_cmake(self):
431 # Try adding a recipe 430 # Try adding a recipe
432 temprecipe = os.path.join(self.tempdir, 'recipe') 431 temprecipe = os.path.join(self.tempdir, 'recipe')
@@ -621,11 +620,11 @@ class RecipetoolAppendsrcBase(RecipetoolBase):
621 620
622class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase): 621class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
623 622
624 @testcase(1273) 623 @OETestID(1273)
625 def test_recipetool_appendsrcfile_basic(self): 624 def test_recipetool_appendsrcfile_basic(self):
626 self._test_appendsrcfile('base-files', 'a-file') 625 self._test_appendsrcfile('base-files', 'a-file')
627 626
628 @testcase(1274) 627 @OETestID(1274)
629 def test_recipetool_appendsrcfile_basic_wildcard(self): 628 def test_recipetool_appendsrcfile_basic_wildcard(self):
630 testrecipe = 'base-files' 629 testrecipe = 'base-files'
631 self._test_appendsrcfile(testrecipe, 'a-file', options='-w') 630 self._test_appendsrcfile(testrecipe, 'a-file', options='-w')
@@ -633,15 +632,15 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
633 bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir) 632 bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
634 self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe) 633 self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe)
635 634
636 @testcase(1281) 635 @OETestID(1281)
637 def test_recipetool_appendsrcfile_subdir_basic(self): 636 def test_recipetool_appendsrcfile_subdir_basic(self):
638 self._test_appendsrcfile('base-files', 'a-file', 'tmp') 637 self._test_appendsrcfile('base-files', 'a-file', 'tmp')
639 638
640 @testcase(1282) 639 @OETestID(1282)
641 def test_recipetool_appendsrcfile_subdir_basic_dirdest(self): 640 def test_recipetool_appendsrcfile_subdir_basic_dirdest(self):
642 self._test_appendsrcfile('base-files', destdir='tmp') 641 self._test_appendsrcfile('base-files', destdir='tmp')
643 642
644 @testcase(1280) 643 @OETestID(1280)
645 def test_recipetool_appendsrcfile_srcdir_basic(self): 644 def test_recipetool_appendsrcfile_srcdir_basic(self):
646 testrecipe = 'bash' 645 testrecipe = 'bash'
647 bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe) 646 bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe)
@@ -650,14 +649,14 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
650 subdir = os.path.relpath(srcdir, workdir) 649 subdir = os.path.relpath(srcdir, workdir)
651 self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir) 650 self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
652 651
653 @testcase(1275) 652 @OETestID(1275)
654 def test_recipetool_appendsrcfile_existing_in_src_uri(self): 653 def test_recipetool_appendsrcfile_existing_in_src_uri(self):
655 testrecipe = 'base-files' 654 testrecipe = 'base-files'
656 filepath = self._get_first_file_uri(testrecipe) 655 filepath = self._get_first_file_uri(testrecipe)
657 self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe) 656 self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
658 self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False) 657 self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False)
659 658
660 @testcase(1276) 659 @OETestID(1276)
661 def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self): 660 def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self):
662 testrecipe = 'base-files' 661 testrecipe = 'base-files'
663 subdir = 'tmp' 662 subdir = 'tmp'
@@ -667,7 +666,7 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
667 output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False) 666 output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False)
668 self.assertTrue(any('with different parameters' in l for l in output)) 667 self.assertTrue(any('with different parameters' in l for l in output))
669 668
670 @testcase(1277) 669 @OETestID(1277)
671 def test_recipetool_appendsrcfile_replace_file_srcdir(self): 670 def test_recipetool_appendsrcfile_replace_file_srcdir(self):
672 testrecipe = 'bash' 671 testrecipe = 'bash'
673 filepath = 'Makefile.in' 672 filepath = 'Makefile.in'
@@ -680,7 +679,7 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
680 bitbake('%s:do_unpack' % testrecipe) 679 bitbake('%s:do_unpack' % testrecipe)
681 self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read()) 680 self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read())
682 681
683 @testcase(1278) 682 @OETestID(1278)
684 def test_recipetool_appendsrcfiles_basic(self, destdir=None): 683 def test_recipetool_appendsrcfiles_basic(self, destdir=None):
685 newfiles = [self.testfile] 684 newfiles = [self.testfile]
686 for i in range(1, 5): 685 for i in range(1, 5):
@@ -690,6 +689,6 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
690 newfiles.append(testfile) 689 newfiles.append(testfile)
691 self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W') 690 self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W')
692 691
693 @testcase(1279) 692 @OETestID(1279)
694 def test_recipetool_appendsrcfiles_basic_subdir(self): 693 def test_recipetool_appendsrcfiles_basic_subdir(self):
695 self.test_recipetool_appendsrcfiles_basic(destdir='testdir') 694 self.test_recipetool_appendsrcfiles_basic(destdir='testdir')
diff --git a/meta/lib/oeqa/selftest/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index 58c6f96f98..4050a4123b 100644
--- a/meta/lib/oeqa/selftest/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -5,17 +5,18 @@
5import re 5import re
6import logging 6import logging
7 7
8from oeqa.selftest.base import oeSelfTest 8from oeqa.selftest.case import OESelftestTestCase
9from oeqa.utils.commands import bitbake, runqemu, get_bb_var 9from oeqa.utils.commands import bitbake, runqemu, get_bb_var
10from oeqa.utils.decorators import testcase 10from oeqa.core.decorator.oeid import OETestID
11 11
12class RunqemuTests(oeSelfTest): 12class RunqemuTests(OESelftestTestCase):
13 """Runqemu test class""" 13 """Runqemu test class"""
14 14
15 image_is_ready = False 15 image_is_ready = False
16 deploy_dir_image = '' 16 deploy_dir_image = ''
17 17
18 def setUpLocal(self): 18 def setUpLocal(self):
19 super(RunqemuTests, self).setUpLocal()
19 self.recipe = 'core-image-minimal' 20 self.recipe = 'core-image-minimal'
20 self.machine = 'qemux86-64' 21 self.machine = 'qemux86-64'
21 self.fstypes = "ext4 iso hddimg vmdk qcow2 vdi" 22 self.fstypes = "ext4 iso hddimg vmdk qcow2 vdi"
@@ -40,14 +41,14 @@ SYSLINUX_TIMEOUT = "10"
40 bitbake(self.recipe) 41 bitbake(self.recipe)
41 RunqemuTests.image_is_ready = True 42 RunqemuTests.image_is_ready = True
42 43
43 @testcase(2001) 44 @OETestID(2001)
44 def test_boot_machine(self): 45 def test_boot_machine(self):
45 """Test runqemu machine""" 46 """Test runqemu machine"""
46 cmd = "%s %s" % (self.cmd_common, self.machine) 47 cmd = "%s %s" % (self.cmd_common, self.machine)
47 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: 48 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
48 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) 49 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
49 50
50 @testcase(2002) 51 @OETestID(2002)
51 def test_boot_machine_ext4(self): 52 def test_boot_machine_ext4(self):
52 """Test runqemu machine ext4""" 53 """Test runqemu machine ext4"""
53 cmd = "%s %s ext4" % (self.cmd_common, self.machine) 54 cmd = "%s %s ext4" % (self.cmd_common, self.machine)
@@ -55,7 +56,7 @@ SYSLINUX_TIMEOUT = "10"
55 with open(qemu.qemurunnerlog) as f: 56 with open(qemu.qemurunnerlog) as f:
56 self.assertTrue('rootfs.ext4' in f.read(), "Failed: %s" % cmd) 57 self.assertTrue('rootfs.ext4' in f.read(), "Failed: %s" % cmd)
57 58
58 @testcase(2003) 59 @OETestID(2003)
59 def test_boot_machine_iso(self): 60 def test_boot_machine_iso(self):
60 """Test runqemu machine iso""" 61 """Test runqemu machine iso"""
61 cmd = "%s %s iso" % (self.cmd_common, self.machine) 62 cmd = "%s %s iso" % (self.cmd_common, self.machine)
@@ -63,14 +64,14 @@ SYSLINUX_TIMEOUT = "10"
63 with open(qemu.qemurunnerlog) as f: 64 with open(qemu.qemurunnerlog) as f:
64 self.assertTrue(' -cdrom ' in f.read(), "Failed: %s" % cmd) 65 self.assertTrue(' -cdrom ' in f.read(), "Failed: %s" % cmd)
65 66
66 @testcase(2004) 67 @OETestID(2004)
67 def test_boot_recipe_image(self): 68 def test_boot_recipe_image(self):
68 """Test runqemu recipe-image""" 69 """Test runqemu recipe-image"""
69 cmd = "%s %s" % (self.cmd_common, self.recipe) 70 cmd = "%s %s" % (self.cmd_common, self.recipe)
70 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: 71 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
71 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) 72 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
72 73
73 @testcase(2005) 74 @OETestID(2005)
74 def test_boot_recipe_image_vmdk(self): 75 def test_boot_recipe_image_vmdk(self):
75 """Test runqemu recipe-image vmdk""" 76 """Test runqemu recipe-image vmdk"""
76 cmd = "%s %s vmdk" % (self.cmd_common, self.recipe) 77 cmd = "%s %s vmdk" % (self.cmd_common, self.recipe)
@@ -78,7 +79,7 @@ SYSLINUX_TIMEOUT = "10"
78 with open(qemu.qemurunnerlog) as f: 79 with open(qemu.qemurunnerlog) as f:
79 self.assertTrue('format=vmdk' in f.read(), "Failed: %s" % cmd) 80 self.assertTrue('format=vmdk' in f.read(), "Failed: %s" % cmd)
80 81
81 @testcase(2006) 82 @OETestID(2006)
82 def test_boot_recipe_image_vdi(self): 83 def test_boot_recipe_image_vdi(self):
83 """Test runqemu recipe-image vdi""" 84 """Test runqemu recipe-image vdi"""
84 cmd = "%s %s vdi" % (self.cmd_common, self.recipe) 85 cmd = "%s %s vdi" % (self.cmd_common, self.recipe)
@@ -86,14 +87,14 @@ SYSLINUX_TIMEOUT = "10"
86 with open(qemu.qemurunnerlog) as f: 87 with open(qemu.qemurunnerlog) as f:
87 self.assertTrue('format=vdi' in f.read(), "Failed: %s" % cmd) 88 self.assertTrue('format=vdi' in f.read(), "Failed: %s" % cmd)
88 89
89 @testcase(2007) 90 @OETestID(2007)
90 def test_boot_deploy(self): 91 def test_boot_deploy(self):
91 """Test runqemu deploy_dir_image""" 92 """Test runqemu deploy_dir_image"""
92 cmd = "%s %s" % (self.cmd_common, self.deploy_dir_image) 93 cmd = "%s %s" % (self.cmd_common, self.deploy_dir_image)
93 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: 94 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
94 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) 95 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
95 96
96 @testcase(2008) 97 @OETestID(2008)
97 def test_boot_deploy_hddimg(self): 98 def test_boot_deploy_hddimg(self):
98 """Test runqemu deploy_dir_image hddimg""" 99 """Test runqemu deploy_dir_image hddimg"""
99 cmd = "%s %s hddimg" % (self.cmd_common, self.deploy_dir_image) 100 cmd = "%s %s hddimg" % (self.cmd_common, self.deploy_dir_image)
@@ -101,7 +102,7 @@ SYSLINUX_TIMEOUT = "10"
101 with open(qemu.qemurunnerlog) as f: 102 with open(qemu.qemurunnerlog) as f:
102 self.assertTrue(re.search('file=.*.hddimg', f.read()), "Failed: %s" % cmd) 103 self.assertTrue(re.search('file=.*.hddimg', f.read()), "Failed: %s" % cmd)
103 104
104 @testcase(2009) 105 @OETestID(2009)
105 def test_boot_machine_slirp(self): 106 def test_boot_machine_slirp(self):
106 """Test runqemu machine slirp""" 107 """Test runqemu machine slirp"""
107 cmd = "%s slirp %s" % (self.cmd_common, self.machine) 108 cmd = "%s slirp %s" % (self.cmd_common, self.machine)
@@ -109,7 +110,7 @@ SYSLINUX_TIMEOUT = "10"
109 with open(qemu.qemurunnerlog) as f: 110 with open(qemu.qemurunnerlog) as f:
110 self.assertTrue(' -netdev user' in f.read(), "Failed: %s" % cmd) 111 self.assertTrue(' -netdev user' in f.read(), "Failed: %s" % cmd)
111 112
112 @testcase(2009) 113 @OETestID(2009)
113 def test_boot_machine_slirp_qcow2(self): 114 def test_boot_machine_slirp_qcow2(self):
114 """Test runqemu machine slirp qcow2""" 115 """Test runqemu machine slirp qcow2"""
115 cmd = "%s slirp qcow2 %s" % (self.cmd_common, self.machine) 116 cmd = "%s slirp qcow2 %s" % (self.cmd_common, self.machine)
@@ -117,7 +118,7 @@ SYSLINUX_TIMEOUT = "10"
117 with open(qemu.qemurunnerlog) as f: 118 with open(qemu.qemurunnerlog) as f:
118 self.assertTrue('format=qcow2' in f.read(), "Failed: %s" % cmd) 119 self.assertTrue('format=qcow2' in f.read(), "Failed: %s" % cmd)
119 120
120 @testcase(2010) 121 @OETestID(2010)
121 def test_boot_qemu_boot(self): 122 def test_boot_qemu_boot(self):
122 """Test runqemu /path/to/image.qemuboot.conf""" 123 """Test runqemu /path/to/image.qemuboot.conf"""
123 qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine) 124 qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine)
@@ -128,7 +129,7 @@ SYSLINUX_TIMEOUT = "10"
128 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: 129 with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
129 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) 130 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
130 131
131 @testcase(2011) 132 @OETestID(2011)
132 def test_boot_rootfs(self): 133 def test_boot_rootfs(self):
133 """Test runqemu /path/to/rootfs.ext4""" 134 """Test runqemu /path/to/rootfs.ext4"""
134 rootfs = "%s-%s.ext4" % (self.recipe, self.machine) 135 rootfs = "%s-%s.ext4" % (self.recipe, self.machine)
diff --git a/meta/lib/oeqa/selftest/runtime-test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 13a4c03a15..9fec4d869b 100644
--- a/meta/lib/oeqa/selftest/runtime-test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -1,14 +1,15 @@
1from oeqa.selftest.base import oeSelfTest 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu 2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
3from oeqa.utils.decorators import testcase 3from oeqa.core.decorator.oeid import OETestID
4import os 4import os
5import re 5import re
6 6
7class TestExport(oeSelfTest): 7class TestExport(OESelftestTestCase):
8 8
9 @classmethod 9 @classmethod
10 def tearDownClass(cls): 10 def tearDownClass(cls):
11 runCmd("rm -rf /tmp/sdk") 11 runCmd("rm -rf /tmp/sdk")
12 super(TestExport, cls).tearDownClass()
12 13
13 def test_testexport_basic(self): 14 def test_testexport_basic(self):
14 """ 15 """
@@ -101,7 +102,7 @@ class TestExport(oeSelfTest):
101 self.assertEqual(0, result.status, "Couldn't run tar from SDK") 102 self.assertEqual(0, result.status, "Couldn't run tar from SDK")
102 103
103 104
104class TestImage(oeSelfTest): 105class TestImage(OESelftestTestCase):
105 106
106 def test_testimage_install(self): 107 def test_testimage_install(self):
107 """ 108 """
@@ -129,8 +130,8 @@ class TestImage(oeSelfTest):
129 bitbake('core-image-full-cmdline socat') 130 bitbake('core-image-full-cmdline socat')
130 bitbake('-c testimage core-image-full-cmdline') 131 bitbake('-c testimage core-image-full-cmdline')
131 132
132class Postinst(oeSelfTest): 133class Postinst(OESelftestTestCase):
133 @testcase(1540) 134 @OETestID(1540)
134 def test_verify_postinst(self): 135 def test_verify_postinst(self):
135 """ 136 """
136 Summary: The purpose of this test is to verify the execution order of postinst Bugzilla ID: [5319] 137 Summary: The purpose of this test is to verify the execution order of postinst Bugzilla ID: [5319]
@@ -180,7 +181,7 @@ postinst-delayed-t \
180 self.assertEqual(idx, len(postinst_list), "Not found all postinsts") 181 self.assertEqual(idx, len(postinst_list), "Not found all postinsts")
181 break 182 break
182 183
183 @testcase(1545) 184 @OETestID(1545)
184 def test_postinst_rootfs_and_boot(self): 185 def test_postinst_rootfs_and_boot(self):
185 """ 186 """
186 Summary: The purpose of this test case is to verify Post-installation 187 Summary: The purpose of this test case is to verify Post-installation
diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
index 0ac3d1fac9..edb5f653f2 100644
--- a/meta/lib/oeqa/selftest/signing.py
+++ b/meta/lib/oeqa/selftest/cases/signing.py
@@ -1,15 +1,15 @@
1from oeqa.selftest.base import oeSelfTest 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
3import os 3import os
4import glob 4import glob
5import re 5import re
6import shutil 6import shutil
7import tempfile 7import tempfile
8from oeqa.utils.decorators import testcase 8from oeqa.core.decorator.oeid import OETestID
9from oeqa.utils.ftools import write_file 9from oeqa.utils.ftools import write_file
10 10
11 11
12class Signing(oeSelfTest): 12class Signing(OESelftestTestCase):
13 13
14 gpg_dir = "" 14 gpg_dir = ""
15 pub_key_path = "" 15 pub_key_path = ""
@@ -17,6 +17,7 @@ class Signing(oeSelfTest):
17 17
18 @classmethod 18 @classmethod
19 def setUpClass(cls): 19 def setUpClass(cls):
20 super(Signing, cls).setUpClass()
20 # Check that we can find the gpg binary and fail early if we can't 21 # Check that we can find the gpg binary and fail early if we can't
21 if not shutil.which("gpg"): 22 if not shutil.which("gpg"):
22 raise AssertionError("This test needs GnuPG") 23 raise AssertionError("This test needs GnuPG")
@@ -29,7 +30,7 @@ class Signing(oeSelfTest):
29 30
30 runCmd('gpg --batch --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path)) 31 runCmd('gpg --batch --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path))
31 32
32 @testcase(1362) 33 @OETestID(1362)
33 def test_signing_packages(self): 34 def test_signing_packages(self):
34 """ 35 """
35 Summary: Test that packages can be signed in the package feed 36 Summary: Test that packages can be signed in the package feed
@@ -92,7 +93,7 @@ class Signing(oeSelfTest):
92 bitbake('core-image-minimal') 93 bitbake('core-image-minimal')
93 94
94 95
95 @testcase(1382) 96 @OETestID(1382)
96 def test_signing_sstate_archive(self): 97 def test_signing_sstate_archive(self):
97 """ 98 """
98 Summary: Test that sstate archives can be signed 99 Summary: Test that sstate archives can be signed
@@ -135,9 +136,9 @@ class Signing(oeSelfTest):
135 self.assertIn('gpg: Good signature from', ret.output, 'Package signed incorrectly.') 136 self.assertIn('gpg: Good signature from', ret.output, 'Package signed incorrectly.')
136 137
137 138
138class LockedSignatures(oeSelfTest): 139class LockedSignatures(OESelftestTestCase):
139 140
140 @testcase(1420) 141 @OETestID(1420)
141 def test_locked_signatures(self): 142 def test_locked_signatures(self):
142 """ 143 """
143 Summary: Test locked signature mechanism 144 Summary: Test locked signature mechanism
diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/cases/sstate.py
index f54bc41465..bc2fdbd8cc 100644
--- a/meta/lib/oeqa/selftest/sstate.py
+++ b/meta/lib/oeqa/selftest/cases/sstate.py
@@ -5,13 +5,14 @@ import re
5import shutil 5import shutil
6 6
7import oeqa.utils.ftools as ftools 7import oeqa.utils.ftools as ftools
8from oeqa.selftest.base import oeSelfTest 8from oeqa.selftest.case import OESelftestTestCase
9from oeqa.utils.commands import runCmd, bitbake, get_bb_vars, get_test_layer 9from oeqa.utils.commands import runCmd, bitbake, get_bb_vars, get_test_layer
10 10
11 11
12class SStateBase(oeSelfTest): 12class SStateBase(OESelftestTestCase):
13 13
14 def setUpLocal(self): 14 def setUpLocal(self):
15 super(SStateBase, self).setUpLocal()
15 self.temp_sstate_location = None 16 self.temp_sstate_location = None
16 needed_vars = ['SSTATE_DIR', 'NATIVELSBSTRING', 'TCLIBC', 'TUNE_ARCH', 17 needed_vars = ['SSTATE_DIR', 'NATIVELSBSTRING', 'TCLIBC', 'TUNE_ARCH',
17 'TOPDIR', 'TARGET_VENDOR', 'TARGET_OS'] 18 'TOPDIR', 'TARGET_VENDOR', 'TARGET_OS']
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index e35ddfff5f..8d05e30423 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -1,16 +1,12 @@
1import datetime
2import unittest
3import os 1import os
4import re
5import shutil 2import shutil
6import glob 3import glob
7import subprocess 4import subprocess
8 5
9import oeqa.utils.ftools as ftools 6from oeqa.selftest.case import OESelftestTestCase
10from oeqa.selftest.base import oeSelfTest
11from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer 7from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
12from oeqa.selftest.sstate import SStateBase 8from oeqa.selftest.cases.sstate import SStateBase
13from oeqa.utils.decorators import testcase 9from oeqa.core.decorator.oeid import OETestID
14 10
15class SStateTests(SStateBase): 11class SStateTests(SStateBase):
16 12
@@ -39,19 +35,19 @@ class SStateTests(SStateBase):
39 else: 35 else:
40 self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker))) 36 self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker)))
41 37
42 @testcase(975) 38 @OETestID(975)
43 def test_sstate_creation_distro_specific_pass(self): 39 def test_sstate_creation_distro_specific_pass(self):
44 self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) 40 self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
45 41
46 @testcase(1374) 42 @OETestID(1374)
47 def test_sstate_creation_distro_specific_fail(self): 43 def test_sstate_creation_distro_specific_fail(self):
48 self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) 44 self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
49 45
50 @testcase(976) 46 @OETestID(976)
51 def test_sstate_creation_distro_nonspecific_pass(self): 47 def test_sstate_creation_distro_nonspecific_pass(self):
52 self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True) 48 self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
53 49
54 @testcase(1375) 50 @OETestID(1375)
55 def test_sstate_creation_distro_nonspecific_fail(self): 51 def test_sstate_creation_distro_nonspecific_fail(self):
56 self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False) 52 self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
57 53
@@ -72,17 +68,17 @@ class SStateTests(SStateBase):
72 tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific) 68 tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
73 self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed))) 69 self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed)))
74 70
75 @testcase(977) 71 @OETestID(977)
76 def test_cleansstate_task_distro_specific_nonspecific(self): 72 def test_cleansstate_task_distro_specific_nonspecific(self):
77 targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] 73 targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
78 targets.append('linux-libc-headers') 74 targets.append('linux-libc-headers')
79 self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True) 75 self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
80 76
81 @testcase(1376) 77 @OETestID(1376)
82 def test_cleansstate_task_distro_nonspecific(self): 78 def test_cleansstate_task_distro_nonspecific(self):
83 self.run_test_cleansstate_task(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True) 79 self.run_test_cleansstate_task(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
84 80
85 @testcase(1377) 81 @OETestID(1377)
86 def test_cleansstate_task_distro_specific(self): 82 def test_cleansstate_task_distro_specific(self):
87 targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] 83 targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
88 targets.append('linux-libc-headers') 84 targets.append('linux-libc-headers')
@@ -121,15 +117,15 @@ class SStateTests(SStateBase):
121 created_once = [x for x in file_tracker_2 if x not in file_tracker_1] 117 created_once = [x for x in file_tracker_2 if x not in file_tracker_1]
122 self.assertTrue(created_once == [], msg="The following sstate files ware created only in the second run: %s" % ', '.join(map(str, created_once))) 118 self.assertTrue(created_once == [], msg="The following sstate files ware created only in the second run: %s" % ', '.join(map(str, created_once)))
123 119
124 @testcase(175) 120 @OETestID(175)
125 def test_rebuild_distro_specific_sstate_cross_native_targets(self): 121 def test_rebuild_distro_specific_sstate_cross_native_targets(self):
126 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch, 'binutils-native'], temp_sstate_location=True) 122 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch, 'binutils-native'], temp_sstate_location=True)
127 123
128 @testcase(1372) 124 @OETestID(1372)
129 def test_rebuild_distro_specific_sstate_cross_target(self): 125 def test_rebuild_distro_specific_sstate_cross_target(self):
130 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch], temp_sstate_location=True) 126 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch], temp_sstate_location=True)
131 127
132 @testcase(1373) 128 @OETestID(1373)
133 def test_rebuild_distro_specific_sstate_native_target(self): 129 def test_rebuild_distro_specific_sstate_native_target(self):
134 self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True) 130 self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True)
135 131
@@ -176,7 +172,7 @@ class SStateTests(SStateBase):
176 expected_not_actual = [x for x in expected_remaining_sstate if x not in actual_remaining_sstate] 172 expected_not_actual = [x for x in expected_remaining_sstate if x not in actual_remaining_sstate]
177 self.assertFalse(expected_not_actual, msg="Extra files ware removed: %s" ', '.join(map(str, expected_not_actual))) 173 self.assertFalse(expected_not_actual, msg="Extra files ware removed: %s" ', '.join(map(str, expected_not_actual)))
178 174
179 @testcase(973) 175 @OETestID(973)
180 def test_sstate_cache_management_script_using_pr_1(self): 176 def test_sstate_cache_management_script_using_pr_1(self):
181 global_config = [] 177 global_config = []
182 target_config = [] 178 target_config = []
@@ -184,7 +180,7 @@ class SStateTests(SStateBase):
184 target_config.append('PR = "0"') 180 target_config.append('PR = "0"')
185 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 181 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
186 182
187 @testcase(978) 183 @OETestID(978)
188 def test_sstate_cache_management_script_using_pr_2(self): 184 def test_sstate_cache_management_script_using_pr_2(self):
189 global_config = [] 185 global_config = []
190 target_config = [] 186 target_config = []
@@ -194,7 +190,7 @@ class SStateTests(SStateBase):
194 target_config.append('PR = "1"') 190 target_config.append('PR = "1"')
195 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 191 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
196 192
197 @testcase(979) 193 @OETestID(979)
198 def test_sstate_cache_management_script_using_pr_3(self): 194 def test_sstate_cache_management_script_using_pr_3(self):
199 global_config = [] 195 global_config = []
200 target_config = [] 196 target_config = []
@@ -206,7 +202,7 @@ class SStateTests(SStateBase):
206 target_config.append('PR = "1"') 202 target_config.append('PR = "1"')
207 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 203 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
208 204
209 @testcase(974) 205 @OETestID(974)
210 def test_sstate_cache_management_script_using_machine(self): 206 def test_sstate_cache_management_script_using_machine(self):
211 global_config = [] 207 global_config = []
212 target_config = [] 208 target_config = []
@@ -216,7 +212,7 @@ class SStateTests(SStateBase):
216 target_config.append('') 212 target_config.append('')
217 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 213 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
218 214
219 @testcase(1270) 215 @OETestID(1270)
220 def test_sstate_32_64_same_hash(self): 216 def test_sstate_32_64_same_hash(self):
221 """ 217 """
222 The sstate checksums for both native and target should not vary whether 218 The sstate checksums for both native and target should not vary whether
@@ -263,7 +259,7 @@ PACKAGE_CLASSES = "package_rpm package_ipk package_deb"
263 self.assertCountEqual(files1, files2) 259 self.assertCountEqual(files1, files2)
264 260
265 261
266 @testcase(1271) 262 @OETestID(1271)
267 def test_sstate_nativelsbstring_same_hash(self): 263 def test_sstate_nativelsbstring_same_hash(self):
268 """ 264 """
269 The sstate checksums should be independent of whichever NATIVELSBSTRING is 265 The sstate checksums should be independent of whichever NATIVELSBSTRING is
@@ -295,7 +291,7 @@ NATIVELSBSTRING = \"DistroB\"
295 self.maxDiff = None 291 self.maxDiff = None
296 self.assertCountEqual(files1, files2) 292 self.assertCountEqual(files1, files2)
297 293
298 @testcase(1368) 294 @OETestID(1368)
299 def test_sstate_allarch_samesigs(self): 295 def test_sstate_allarch_samesigs(self):
300 """ 296 """
301 The sstate checksums of allarch packages should be independent of whichever 297 The sstate checksums of allarch packages should be independent of whichever
@@ -369,7 +365,7 @@ MULTILIBS = \"\"
369 self.maxDiff = None 365 self.maxDiff = None
370 self.assertEqual(files1, files2) 366 self.assertEqual(files1, files2)
371 367
372 @testcase(1369) 368 @OETestID(1369)
373 def test_sstate_sametune_samesigs(self): 369 def test_sstate_sametune_samesigs(self):
374 """ 370 """
375 The sstate checksums of two identical machines (using the same tune) should be the 371 The sstate checksums of two identical machines (using the same tune) should be the
diff --git a/meta/lib/oeqa/selftest/tinfoil.py b/meta/lib/oeqa/selftest/cases/tinfoil.py
index 73a0c3bac0..1394d426e7 100644
--- a/meta/lib/oeqa/selftest/tinfoil.py
+++ b/meta/lib/oeqa/selftest/cases/tinfoil.py
@@ -1,16 +1,15 @@
1import unittest
2import os 1import os
3import re 2import re
4import bb.tinfoil 3import bb.tinfoil
5 4
6from oeqa.selftest.base import oeSelfTest 5from oeqa.selftest.case import OESelftestTestCase
7from oeqa.utils.commands import runCmd 6from oeqa.utils.commands import runCmd
8from oeqa.utils.decorators import testcase 7from oeqa.core.decorator.oeid import OETestID
9 8
10class TinfoilTests(oeSelfTest): 9class TinfoilTests(OESelftestTestCase):
11 """ Basic tests for the tinfoil API """ 10 """ Basic tests for the tinfoil API """
12 11
13 @testcase(1568) 12 @OETestID(1568)
14 def test_getvar(self): 13 def test_getvar(self):
15 with bb.tinfoil.Tinfoil() as tinfoil: 14 with bb.tinfoil.Tinfoil() as tinfoil:
16 tinfoil.prepare(True) 15 tinfoil.prepare(True)
@@ -18,7 +17,7 @@ class TinfoilTests(oeSelfTest):
18 if not machine: 17 if not machine:
19 self.fail('Unable to get MACHINE value - returned %s' % machine) 18 self.fail('Unable to get MACHINE value - returned %s' % machine)
20 19
21 @testcase(1569) 20 @OETestID(1569)
22 def test_expand(self): 21 def test_expand(self):
23 with bb.tinfoil.Tinfoil() as tinfoil: 22 with bb.tinfoil.Tinfoil() as tinfoil:
24 tinfoil.prepare(True) 23 tinfoil.prepare(True)
@@ -27,7 +26,7 @@ class TinfoilTests(oeSelfTest):
27 if not pid: 26 if not pid:
28 self.fail('Unable to expand "%s" - returned %s' % (expr, pid)) 27 self.fail('Unable to expand "%s" - returned %s' % (expr, pid))
29 28
30 @testcase(1570) 29 @OETestID(1570)
31 def test_getvar_bb_origenv(self): 30 def test_getvar_bb_origenv(self):
32 with bb.tinfoil.Tinfoil() as tinfoil: 31 with bb.tinfoil.Tinfoil() as tinfoil:
33 tinfoil.prepare(True) 32 tinfoil.prepare(True)
@@ -36,7 +35,7 @@ class TinfoilTests(oeSelfTest):
36 self.fail('Unable to get BB_ORIGENV value - returned %s' % origenv) 35 self.fail('Unable to get BB_ORIGENV value - returned %s' % origenv)
37 self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME']) 36 self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME'])
38 37
39 @testcase(1571) 38 @OETestID(1571)
40 def test_parse_recipe(self): 39 def test_parse_recipe(self):
41 with bb.tinfoil.Tinfoil() as tinfoil: 40 with bb.tinfoil.Tinfoil() as tinfoil:
42 tinfoil.prepare(config_only=False, quiet=2) 41 tinfoil.prepare(config_only=False, quiet=2)
@@ -47,7 +46,7 @@ class TinfoilTests(oeSelfTest):
47 rd = tinfoil.parse_recipe_file(best[3]) 46 rd = tinfoil.parse_recipe_file(best[3])
48 self.assertEqual(testrecipe, rd.getVar('PN')) 47 self.assertEqual(testrecipe, rd.getVar('PN'))
49 48
50 @testcase(1572) 49 @OETestID(1572)
51 def test_parse_recipe_copy_expand(self): 50 def test_parse_recipe_copy_expand(self):
52 with bb.tinfoil.Tinfoil() as tinfoil: 51 with bb.tinfoil.Tinfoil() as tinfoil:
53 tinfoil.prepare(config_only=False, quiet=2) 52 tinfoil.prepare(config_only=False, quiet=2)
@@ -66,7 +65,7 @@ class TinfoilTests(oeSelfTest):
66 localdata.setVar('PN', 'hello') 65 localdata.setVar('PN', 'hello')
67 self.assertEqual('hello', localdata.getVar('BPN')) 66 self.assertEqual('hello', localdata.getVar('BPN'))
68 67
69 @testcase(1573) 68 @OETestID(1573)
70 def test_parse_recipe_initial_datastore(self): 69 def test_parse_recipe_initial_datastore(self):
71 with bb.tinfoil.Tinfoil() as tinfoil: 70 with bb.tinfoil.Tinfoil() as tinfoil:
72 tinfoil.prepare(config_only=False, quiet=2) 71 tinfoil.prepare(config_only=False, quiet=2)
@@ -80,7 +79,7 @@ class TinfoilTests(oeSelfTest):
80 # Check we can get variable values 79 # Check we can get variable values
81 self.assertEqual('somevalue', rd.getVar('MYVARIABLE')) 80 self.assertEqual('somevalue', rd.getVar('MYVARIABLE'))
82 81
83 @testcase(1574) 82 @OETestID(1574)
84 def test_list_recipes(self): 83 def test_list_recipes(self):
85 with bb.tinfoil.Tinfoil() as tinfoil: 84 with bb.tinfoil.Tinfoil() as tinfoil:
86 tinfoil.prepare(config_only=False, quiet=2) 85 tinfoil.prepare(config_only=False, quiet=2)
@@ -99,7 +98,7 @@ class TinfoilTests(oeSelfTest):
99 if checkpns: 98 if checkpns:
100 self.fail('Unable to find pkg_fn entries for: %s' % ', '.join(checkpns)) 99 self.fail('Unable to find pkg_fn entries for: %s' % ', '.join(checkpns))
101 100
102 @testcase(1575) 101 @OETestID(1575)
103 def test_wait_event(self): 102 def test_wait_event(self):
104 with bb.tinfoil.Tinfoil() as tinfoil: 103 with bb.tinfoil.Tinfoil() as tinfoil:
105 tinfoil.prepare(config_only=True) 104 tinfoil.prepare(config_only=True)
@@ -130,7 +129,7 @@ class TinfoilTests(oeSelfTest):
130 self.assertNotEqual(waitcount, 0, 'Timed out waiting for CommandCompleted event from bitbake server') 129 self.assertNotEqual(waitcount, 0, 'Timed out waiting for CommandCompleted event from bitbake server')
131 self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound event from bitbake server') 130 self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound event from bitbake server')
132 131
133 @testcase(1576) 132 @OETestID(1576)
134 def test_setvariable_clean(self): 133 def test_setvariable_clean(self):
135 # First check that setVariable affects the datastore 134 # First check that setVariable affects the datastore
136 with bb.tinfoil.Tinfoil() as tinfoil: 135 with bb.tinfoil.Tinfoil() as tinfoil:
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index cdec80c076..4040cf7246 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -32,9 +32,9 @@ from shutil import rmtree
32from functools import wraps, lru_cache 32from functools import wraps, lru_cache
33from tempfile import NamedTemporaryFile 33from tempfile import NamedTemporaryFile
34 34
35from oeqa.selftest.base import oeSelfTest 35from oeqa.selftest.case import OESelftestTestCase
36from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu 36from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
37from oeqa.utils.decorators import testcase 37from oeqa.core.decorator.oeid import OETestID
38 38
39 39
40@lru_cache(maxsize=32) 40@lru_cache(maxsize=32)
@@ -61,7 +61,7 @@ def only_for_arch(archs, image='core-image-minimal'):
61 return wrapper 61 return wrapper
62 62
63 63
64class Wic(oeSelfTest): 64class Wic(OESelftestTestCase):
65 """Wic test class.""" 65 """Wic test class."""
66 66
67 resultdir = "/var/tmp/wic.oe-selftest/" 67 resultdir = "/var/tmp/wic.oe-selftest/"
@@ -71,6 +71,7 @@ class Wic(oeSelfTest):
71 71
72 def setUpLocal(self): 72 def setUpLocal(self):
73 """This code is executed before each test method.""" 73 """This code is executed before each test method."""
74 super(Wic, self).setUpLocal()
74 if not self.native_sysroot: 75 if not self.native_sysroot:
75 Wic.native_sysroot = get_bb_var('STAGING_DIR_NATIVE', 'wic-tools') 76 Wic.native_sysroot = get_bb_var('STAGING_DIR_NATIVE', 'wic-tools')
76 77
@@ -91,64 +92,65 @@ class Wic(oeSelfTest):
91 def tearDownLocal(self): 92 def tearDownLocal(self):
92 """Remove resultdir as it may contain images.""" 93 """Remove resultdir as it may contain images."""
93 rmtree(self.resultdir, ignore_errors=True) 94 rmtree(self.resultdir, ignore_errors=True)
95 super(Wic, self).tearDownLocal()
94 96
95 @testcase(1552) 97 @OETestID(1552)
96 def test_version(self): 98 def test_version(self):
97 """Test wic --version""" 99 """Test wic --version"""
98 self.assertEqual(0, runCmd('wic --version').status) 100 self.assertEqual(0, runCmd('wic --version').status)
99 101
100 @testcase(1208) 102 @OETestID(1208)
101 def test_help(self): 103 def test_help(self):
102 """Test wic --help and wic -h""" 104 """Test wic --help and wic -h"""
103 self.assertEqual(0, runCmd('wic --help').status) 105 self.assertEqual(0, runCmd('wic --help').status)
104 self.assertEqual(0, runCmd('wic -h').status) 106 self.assertEqual(0, runCmd('wic -h').status)
105 107
106 @testcase(1209) 108 @OETestID(1209)
107 def test_createhelp(self): 109 def test_createhelp(self):
108 """Test wic create --help""" 110 """Test wic create --help"""
109 self.assertEqual(0, runCmd('wic create --help').status) 111 self.assertEqual(0, runCmd('wic create --help').status)
110 112
111 @testcase(1210) 113 @OETestID(1210)
112 def test_listhelp(self): 114 def test_listhelp(self):
113 """Test wic list --help""" 115 """Test wic list --help"""
114 self.assertEqual(0, runCmd('wic list --help').status) 116 self.assertEqual(0, runCmd('wic list --help').status)
115 117
116 @testcase(1553) 118 @OETestID(1553)
117 def test_help_create(self): 119 def test_help_create(self):
118 """Test wic help create""" 120 """Test wic help create"""
119 self.assertEqual(0, runCmd('wic help create').status) 121 self.assertEqual(0, runCmd('wic help create').status)
120 122
121 @testcase(1554) 123 @OETestID(1554)
122 def test_help_list(self): 124 def test_help_list(self):
123 """Test wic help list""" 125 """Test wic help list"""
124 self.assertEqual(0, runCmd('wic help list').status) 126 self.assertEqual(0, runCmd('wic help list').status)
125 127
126 @testcase(1215) 128 @OETestID(1215)
127 def test_help_overview(self): 129 def test_help_overview(self):
128 """Test wic help overview""" 130 """Test wic help overview"""
129 self.assertEqual(0, runCmd('wic help overview').status) 131 self.assertEqual(0, runCmd('wic help overview').status)
130 132
131 @testcase(1216) 133 @OETestID(1216)
132 def test_help_plugins(self): 134 def test_help_plugins(self):
133 """Test wic help plugins""" 135 """Test wic help plugins"""
134 self.assertEqual(0, runCmd('wic help plugins').status) 136 self.assertEqual(0, runCmd('wic help plugins').status)
135 137
136 @testcase(1217) 138 @OETestID(1217)
137 def test_help_kickstart(self): 139 def test_help_kickstart(self):
138 """Test wic help kickstart""" 140 """Test wic help kickstart"""
139 self.assertEqual(0, runCmd('wic help kickstart').status) 141 self.assertEqual(0, runCmd('wic help kickstart').status)
140 142
141 @testcase(1555) 143 @OETestID(1555)
142 def test_list_images(self): 144 def test_list_images(self):
143 """Test wic list images""" 145 """Test wic list images"""
144 self.assertEqual(0, runCmd('wic list images').status) 146 self.assertEqual(0, runCmd('wic list images').status)
145 147
146 @testcase(1556) 148 @OETestID(1556)
147 def test_list_source_plugins(self): 149 def test_list_source_plugins(self):
148 """Test wic list source-plugins""" 150 """Test wic list source-plugins"""
149 self.assertEqual(0, runCmd('wic list source-plugins').status) 151 self.assertEqual(0, runCmd('wic list source-plugins').status)
150 152
151 @testcase(1557) 153 @OETestID(1557)
152 def test_listed_images_help(self): 154 def test_listed_images_help(self):
153 """Test wic listed images help""" 155 """Test wic listed images help"""
154 output = runCmd('wic list images').output 156 output = runCmd('wic list images').output
@@ -156,24 +158,24 @@ class Wic(oeSelfTest):
156 for image in imagelist: 158 for image in imagelist:
157 self.assertEqual(0, runCmd('wic list %s help' % image).status) 159 self.assertEqual(0, runCmd('wic list %s help' % image).status)
158 160
159 @testcase(1213) 161 @OETestID(1213)
160 def test_unsupported_subcommand(self): 162 def test_unsupported_subcommand(self):
161 """Test unsupported subcommand""" 163 """Test unsupported subcommand"""
162 self.assertNotEqual(0, runCmd('wic unsupported', ignore_status=True).status) 164 self.assertNotEqual(0, runCmd('wic unsupported', ignore_status=True).status)
163 165
164 @testcase(1214) 166 @OETestID(1214)
165 def test_no_command(self): 167 def test_no_command(self):
166 """Test wic without command""" 168 """Test wic without command"""
167 self.assertEqual(1, runCmd('wic', ignore_status=True).status) 169 self.assertEqual(1, runCmd('wic', ignore_status=True).status)
168 170
169 @testcase(1211) 171 @OETestID(1211)
170 def test_build_image_name(self): 172 def test_build_image_name(self):
171 """Test wic create wictestdisk --image-name=core-image-minimal""" 173 """Test wic create wictestdisk --image-name=core-image-minimal"""
172 cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir 174 cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir
173 self.assertEqual(0, runCmd(cmd).status) 175 self.assertEqual(0, runCmd(cmd).status)
174 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) 176 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
175 177
176 @testcase(1157) 178 @OETestID(1157)
177 @only_for_arch(['i586', 'i686', 'x86_64']) 179 @only_for_arch(['i586', 'i686', 'x86_64'])
178 def test_gpt_image(self): 180 def test_gpt_image(self):
179 """Test creation of core-image-minimal with gpt table and UUID boot""" 181 """Test creation of core-image-minimal with gpt table and UUID boot"""
@@ -181,7 +183,7 @@ class Wic(oeSelfTest):
181 self.assertEqual(0, runCmd(cmd).status) 183 self.assertEqual(0, runCmd(cmd).status)
182 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) 184 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
183 185
184 @testcase(1346) 186 @OETestID(1346)
185 @only_for_arch(['i586', 'i686', 'x86_64']) 187 @only_for_arch(['i586', 'i686', 'x86_64'])
186 def test_iso_image(self): 188 def test_iso_image(self):
187 """Test creation of hybrid iso image with legacy and EFI boot""" 189 """Test creation of hybrid iso image with legacy and EFI boot"""
@@ -195,7 +197,7 @@ class Wic(oeSelfTest):
195 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct"))) 197 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
196 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso"))) 198 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
197 199
198 @testcase(1348) 200 @OETestID(1348)
199 @only_for_arch(['i586', 'i686', 'x86_64']) 201 @only_for_arch(['i586', 'i686', 'x86_64'])
200 def test_qemux86_directdisk(self): 202 def test_qemux86_directdisk(self):
201 """Test creation of qemux-86-directdisk image""" 203 """Test creation of qemux-86-directdisk image"""
@@ -203,7 +205,7 @@ class Wic(oeSelfTest):
203 self.assertEqual(0, runCmd(cmd).status) 205 self.assertEqual(0, runCmd(cmd).status)
204 self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct"))) 206 self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct")))
205 207
206 @testcase(1350) 208 @OETestID(1350)
207 @only_for_arch(['i586', 'i686', 'x86_64']) 209 @only_for_arch(['i586', 'i686', 'x86_64'])
208 def test_mkefidisk(self): 210 def test_mkefidisk(self):
209 """Test creation of mkefidisk image""" 211 """Test creation of mkefidisk image"""
@@ -211,7 +213,7 @@ class Wic(oeSelfTest):
211 self.assertEqual(0, runCmd(cmd).status) 213 self.assertEqual(0, runCmd(cmd).status)
212 self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct"))) 214 self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct")))
213 215
214 @testcase(1385) 216 @OETestID(1385)
215 @only_for_arch(['i586', 'i686', 'x86_64']) 217 @only_for_arch(['i586', 'i686', 'x86_64'])
216 def test_bootloader_config(self): 218 def test_bootloader_config(self):
217 """Test creation of directdisk-bootloader-config image""" 219 """Test creation of directdisk-bootloader-config image"""
@@ -219,7 +221,7 @@ class Wic(oeSelfTest):
219 self.assertEqual(0, runCmd(cmd).status) 221 self.assertEqual(0, runCmd(cmd).status)
220 self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct"))) 222 self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct")))
221 223
222 @testcase(1560) 224 @OETestID(1560)
223 @only_for_arch(['i586', 'i686', 'x86_64']) 225 @only_for_arch(['i586', 'i686', 'x86_64'])
224 def test_systemd_bootdisk(self): 226 def test_systemd_bootdisk(self):
225 """Test creation of systemd-bootdisk image""" 227 """Test creation of systemd-bootdisk image"""
@@ -231,7 +233,7 @@ class Wic(oeSelfTest):
231 self.assertEqual(0, runCmd(cmd).status) 233 self.assertEqual(0, runCmd(cmd).status)
232 self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct"))) 234 self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct")))
233 235
234 @testcase(1561) 236 @OETestID(1561)
235 def test_sdimage_bootpart(self): 237 def test_sdimage_bootpart(self):
236 """Test creation of sdimage-bootpart image""" 238 """Test creation of sdimage-bootpart image"""
237 cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s" % self.resultdir 239 cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s" % self.resultdir
@@ -240,7 +242,7 @@ class Wic(oeSelfTest):
240 self.assertEqual(0, runCmd(cmd).status) 242 self.assertEqual(0, runCmd(cmd).status)
241 self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct"))) 243 self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
242 244
243 @testcase(1562) 245 @OETestID(1562)
244 @only_for_arch(['i586', 'i686', 'x86_64']) 246 @only_for_arch(['i586', 'i686', 'x86_64'])
245 def test_default_output_dir(self): 247 def test_default_output_dir(self):
246 """Test default output location""" 248 """Test default output location"""
@@ -250,7 +252,7 @@ class Wic(oeSelfTest):
250 self.assertEqual(0, runCmd(cmd).status) 252 self.assertEqual(0, runCmd(cmd).status)
251 self.assertEqual(1, len(glob("directdisk-*.direct"))) 253 self.assertEqual(1, len(glob("directdisk-*.direct")))
252 254
253 @testcase(1212) 255 @OETestID(1212)
254 @only_for_arch(['i586', 'i686', 'x86_64']) 256 @only_for_arch(['i586', 'i686', 'x86_64'])
255 def test_build_artifacts(self): 257 def test_build_artifacts(self):
256 """Test wic create directdisk providing all artifacts.""" 258 """Test wic create directdisk providing all artifacts."""
@@ -269,7 +271,7 @@ class Wic(oeSelfTest):
269 self.assertEqual(0, status) 271 self.assertEqual(0, status)
270 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) 272 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
271 273
272 @testcase(1264) 274 @OETestID(1264)
273 def test_compress_gzip(self): 275 def test_compress_gzip(self):
274 """Test compressing an image with gzip""" 276 """Test compressing an image with gzip"""
275 self.assertEqual(0, runCmd("wic create wictestdisk " 277 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -277,7 +279,7 @@ class Wic(oeSelfTest):
277 "-c gzip -o %s" % self.resultdir).status) 279 "-c gzip -o %s" % self.resultdir).status)
278 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz"))) 280 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz")))
279 281
280 @testcase(1265) 282 @OETestID(1265)
281 def test_compress_bzip2(self): 283 def test_compress_bzip2(self):
282 """Test compressing an image with bzip2""" 284 """Test compressing an image with bzip2"""
283 self.assertEqual(0, runCmd("wic create wictestdisk " 285 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -285,7 +287,7 @@ class Wic(oeSelfTest):
285 "-c bzip2 -o %s" % self.resultdir).status) 287 "-c bzip2 -o %s" % self.resultdir).status)
286 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2"))) 288 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2")))
287 289
288 @testcase(1266) 290 @OETestID(1266)
289 def test_compress_xz(self): 291 def test_compress_xz(self):
290 """Test compressing an image with xz""" 292 """Test compressing an image with xz"""
291 self.assertEqual(0, runCmd("wic create wictestdisk " 293 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -293,7 +295,7 @@ class Wic(oeSelfTest):
293 "--compress-with=xz -o %s" % self.resultdir).status) 295 "--compress-with=xz -o %s" % self.resultdir).status)
294 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz"))) 296 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz")))
295 297
296 @testcase(1267) 298 @OETestID(1267)
297 def test_wrong_compressor(self): 299 def test_wrong_compressor(self):
298 """Test how wic breaks if wrong compressor is provided""" 300 """Test how wic breaks if wrong compressor is provided"""
299 self.assertEqual(2, runCmd("wic create wictestdisk " 301 self.assertEqual(2, runCmd("wic create wictestdisk "
@@ -301,7 +303,7 @@ class Wic(oeSelfTest):
301 "-c wrong -o %s" % self.resultdir, 303 "-c wrong -o %s" % self.resultdir,
302 ignore_status=True).status) 304 ignore_status=True).status)
303 305
304 @testcase(1558) 306 @OETestID(1558)
305 def test_debug_short(self): 307 def test_debug_short(self):
306 """Test -D option""" 308 """Test -D option"""
307 self.assertEqual(0, runCmd("wic create wictestdisk " 309 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -316,7 +318,7 @@ class Wic(oeSelfTest):
316 "--debug -o %s" % self.resultdir).status) 318 "--debug -o %s" % self.resultdir).status)
317 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) 319 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
318 320
319 @testcase(1563) 321 @OETestID(1563)
320 def test_skip_build_check_short(self): 322 def test_skip_build_check_short(self):
321 """Test -s option""" 323 """Test -s option"""
322 self.assertEqual(0, runCmd("wic create wictestdisk " 324 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -332,7 +334,7 @@ class Wic(oeSelfTest):
332 "--outdir %s" % self.resultdir).status) 334 "--outdir %s" % self.resultdir).status)
333 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) 335 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
334 336
335 @testcase(1564) 337 @OETestID(1564)
336 def test_build_rootfs_short(self): 338 def test_build_rootfs_short(self):
337 """Test -f option""" 339 """Test -f option"""
338 self.assertEqual(0, runCmd("wic create wictestdisk " 340 self.assertEqual(0, runCmd("wic create wictestdisk "
@@ -348,7 +350,7 @@ class Wic(oeSelfTest):
348 "--outdir %s" % self.resultdir).status) 350 "--outdir %s" % self.resultdir).status)
349 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) 351 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
350 352
351 @testcase(1268) 353 @OETestID(1268)
352 @only_for_arch(['i586', 'i686', 'x86_64']) 354 @only_for_arch(['i586', 'i686', 'x86_64'])
353 def test_rootfs_indirect_recipes(self): 355 def test_rootfs_indirect_recipes(self):
354 """Test usage of rootfs plugin with rootfs recipes""" 356 """Test usage of rootfs plugin with rootfs recipes"""
@@ -360,7 +362,7 @@ class Wic(oeSelfTest):
360 self.assertEqual(0, status) 362 self.assertEqual(0, status)
361 self.assertEqual(1, len(glob(self.resultdir + "directdisk-multi-rootfs*.direct"))) 363 self.assertEqual(1, len(glob(self.resultdir + "directdisk-multi-rootfs*.direct")))
362 364
363 @testcase(1269) 365 @OETestID(1269)
364 @only_for_arch(['i586', 'i686', 'x86_64']) 366 @only_for_arch(['i586', 'i686', 'x86_64'])
365 def test_rootfs_artifacts(self): 367 def test_rootfs_artifacts(self):
366 """Test usage of rootfs plugin with rootfs paths""" 368 """Test usage of rootfs plugin with rootfs paths"""
@@ -506,7 +508,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
506 % (wks_file, self.resultdir), ignore_status=True).status) 508 % (wks_file, self.resultdir), ignore_status=True).status)
507 os.remove(wks_file) 509 os.remove(wks_file)
508 510
509 @testcase(1496) 511 @OETestID(1496)
510 def test_bmap_short(self): 512 def test_bmap_short(self):
511 """Test generation of .bmap file -m option""" 513 """Test generation of .bmap file -m option"""
512 cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir 514 cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir
@@ -533,7 +535,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
533 self.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata') 535 self.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
534 return self.wicenv_cache[image] 536 return self.wicenv_cache[image]
535 537
536 @testcase(1347) 538 @OETestID(1347)
537 def test_image_env(self): 539 def test_image_env(self):
538 """Test generation of <image>.env files.""" 540 """Test generation of <image>.env files."""
539 image = 'core-image-minimal' 541 image = 'core-image-minimal'
@@ -556,7 +558,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
556 self.assertTrue(var in content, "%s is not in .env file" % var) 558 self.assertTrue(var in content, "%s is not in .env file" % var)
557 self.assertTrue(content[var]) 559 self.assertTrue(content[var])
558 560
559 @testcase(1559) 561 @OETestID(1559)
560 def test_image_vars_dir_short(self): 562 def test_image_vars_dir_short(self):
561 """Test image vars directory selection -v option""" 563 """Test image vars directory selection -v option"""
562 image = 'core-image-minimal' 564 image = 'core-image-minimal'
@@ -578,7 +580,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
578 % (image, imgenvdir, self.resultdir)).status) 580 % (image, imgenvdir, self.resultdir)).status)
579 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) 581 self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
580 582
581 @testcase(1351) 583 @OETestID(1351)
582 @only_for_arch(['i586', 'i686', 'x86_64']) 584 @only_for_arch(['i586', 'i686', 'x86_64'])
583 def test_wic_image_type(self): 585 def test_wic_image_type(self):
584 """Test building wic images by bitbake""" 586 """Test building wic images by bitbake"""
@@ -599,7 +601,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
599 self.assertTrue(os.path.islink(path)) 601 self.assertTrue(os.path.islink(path))
600 self.assertTrue(os.path.isfile(os.path.realpath(path))) 602 self.assertTrue(os.path.isfile(os.path.realpath(path)))
601 603
602 @testcase(1422) 604 @OETestID(1422)
603 @only_for_arch(['i586', 'i686', 'x86_64']) 605 @only_for_arch(['i586', 'i686', 'x86_64'])
604 def test_qemu(self): 606 def test_qemu(self):
605 """Test wic-image-minimal under qemu""" 607 """Test wic-image-minimal under qemu"""