summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/bblayers.py1
-rw-r--r--meta/lib/oeqa/selftest/devtool.py15
-rw-r--r--meta/lib/oeqa/selftest/layerappend.py1
-rw-r--r--meta/lib/oeqa/selftest/lic-checksum.py2
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py8
-rw-r--r--meta/lib/oeqa/selftest/recipetool.py25
6 files changed, 49 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py
index 3a18029a02..bf3dd1b083 100644
--- a/meta/lib/oeqa/selftest/bblayers.py
+++ b/meta/lib/oeqa/selftest/bblayers.py
@@ -43,6 +43,7 @@ class BitbakeLayers(oeSelfTest):
43 find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) 43 find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
44 self.assertTrue(find_in_contents) 44 self.assertTrue(find_in_contents)
45 45
46 @testcase(1195)
46 def test_bitbakelayers_add_remove(self): 47 def test_bitbakelayers_add_remove(self):
47 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton') 48 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
48 result = runCmd('bitbake-layers show-layers') 49 result = runCmd('bitbake-layers show-layers')
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index c4a0399832..ab412b6168 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -84,6 +84,7 @@ class DevtoolBase(oeSelfTest):
84 84
85class DevtoolTests(DevtoolBase): 85class DevtoolTests(DevtoolBase):
86 86
87 @testcase(1158)
87 def test_create_workspace(self): 88 def test_create_workspace(self):
88 # Check preconditions 89 # Check preconditions
89 workspacedir = os.path.join(self.builddir, 'workspace') 90 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -106,6 +107,7 @@ class DevtoolTests(DevtoolBase):
106 self.assertNotIn(tempdir, result.output) 107 self.assertNotIn(tempdir, result.output)
107 self.assertIn(workspacedir, result.output) 108 self.assertIn(workspacedir, result.output)
108 109
110 @testcase(1159)
109 def test_devtool_add(self): 111 def test_devtool_add(self):
110 # Check preconditions 112 # Check preconditions
111 workspacedir = os.path.join(self.builddir, 'workspace') 113 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -140,6 +142,7 @@ class DevtoolTests(DevtoolBase):
140 bindir = bindir[1:] 142 bindir = bindir[1:]
141 self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D') 143 self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D')
142 144
145 @testcase(1162)
143 def test_devtool_add_library(self): 146 def test_devtool_add_library(self):
144 # Check preconditions 147 # Check preconditions
145 workspacedir = os.path.join(self.builddir, 'workspace') 148 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -180,6 +183,7 @@ class DevtoolTests(DevtoolBase):
180 self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned') 183 self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned')
181 self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning') 184 self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning')
182 185
186 @testcase(1160)
183 def test_devtool_add_fetch(self): 187 def test_devtool_add_fetch(self):
184 # Check preconditions 188 # Check preconditions
185 workspacedir = os.path.join(self.builddir, 'workspace') 189 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -226,6 +230,7 @@ class DevtoolTests(DevtoolBase):
226 checkvars['SRC_URI'] = url.replace(testver, '${PV}') 230 checkvars['SRC_URI'] = url.replace(testver, '${PV}')
227 self._test_recipe_contents(recipefile, checkvars, []) 231 self._test_recipe_contents(recipefile, checkvars, [])
228 232
233 @testcase(1161)
229 def test_devtool_add_fetch_git(self): 234 def test_devtool_add_fetch_git(self):
230 # Check preconditions 235 # Check preconditions
231 workspacedir = os.path.join(self.builddir, 'workspace') 236 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -277,6 +282,7 @@ class DevtoolTests(DevtoolBase):
277 checkvars['SRCREV'] = checkrev 282 checkvars['SRCREV'] = checkrev
278 self._test_recipe_contents(recipefile, checkvars, []) 283 self._test_recipe_contents(recipefile, checkvars, [])
279 284
285 @testcase(1164)
280 def test_devtool_modify(self): 286 def test_devtool_modify(self):
281 # Check preconditions 287 # Check preconditions
282 workspacedir = os.path.join(self.builddir, 'workspace') 288 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -328,6 +334,7 @@ class DevtoolTests(DevtoolBase):
328 matches = glob.glob(stampprefix + '*') 334 matches = glob.glob(stampprefix + '*')
329 self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned') 335 self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned')
330 336
337 @testcase(1166)
331 def test_devtool_modify_invalid(self): 338 def test_devtool_modify_invalid(self):
332 # Check preconditions 339 # Check preconditions
333 workspacedir = os.path.join(self.builddir, 'workspace') 340 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -360,6 +367,7 @@ class DevtoolTests(DevtoolBase):
360 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed' % testrecipe) 367 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed' % testrecipe)
361 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) 368 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
362 369
370 @testcase(1165)
363 def test_devtool_modify_git(self): 371 def test_devtool_modify_git(self):
364 # Check preconditions 372 # Check preconditions
365 workspacedir = os.path.join(self.builddir, 'workspace') 373 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -393,6 +401,7 @@ class DevtoolTests(DevtoolBase):
393 # Try building 401 # Try building
394 bitbake(testrecipe) 402 bitbake(testrecipe)
395 403
404 @testcase(1167)
396 def test_devtool_modify_localfiles(self): 405 def test_devtool_modify_localfiles(self):
397 # Check preconditions 406 # Check preconditions
398 workspacedir = os.path.join(self.builddir, 'workspace') 407 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -425,6 +434,7 @@ class DevtoolTests(DevtoolBase):
425 # Try building 434 # Try building
426 bitbake(testrecipe) 435 bitbake(testrecipe)
427 436
437 @testcase(1169)
428 def test_devtool_update_recipe(self): 438 def test_devtool_update_recipe(self):
429 # Check preconditions 439 # Check preconditions
430 workspacedir = os.path.join(self.builddir, 'workspace') 440 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -471,6 +481,7 @@ class DevtoolTests(DevtoolBase):
471 else: 481 else:
472 raise AssertionError('Unexpected modified file in status: %s' % line) 482 raise AssertionError('Unexpected modified file in status: %s' % line)
473 483
484 @testcase(1172)
474 def test_devtool_update_recipe_git(self): 485 def test_devtool_update_recipe_git(self):
475 # Check preconditions 486 # Check preconditions
476 workspacedir = os.path.join(self.builddir, 'workspace') 487 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -545,6 +556,7 @@ class DevtoolTests(DevtoolBase):
545 break 556 break
546 self.assertTrue(matched, 'Unexpected diff remove line: %s' % line) 557 self.assertTrue(matched, 'Unexpected diff remove line: %s' % line)
547 558
559 @testcase(1170)
548 def test_devtool_update_recipe_append(self): 560 def test_devtool_update_recipe_append(self):
549 # Check preconditions 561 # Check preconditions
550 workspacedir = os.path.join(self.builddir, 'workspace') 562 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -620,6 +632,7 @@ class DevtoolTests(DevtoolBase):
620 self.assertEqual(expectedlines, f.readlines()) 632 self.assertEqual(expectedlines, f.readlines())
621 # Deleting isn't expected to work under these circumstances 633 # Deleting isn't expected to work under these circumstances
622 634
635 @testcase(1171)
623 def test_devtool_update_recipe_append_git(self): 636 def test_devtool_update_recipe_append_git(self):
624 # Check preconditions 637 # Check preconditions
625 workspacedir = os.path.join(self.builddir, 'workspace') 638 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -716,6 +729,7 @@ class DevtoolTests(DevtoolBase):
716 self.assertEqual(expectedlines, f.readlines()) 729 self.assertEqual(expectedlines, f.readlines())
717 # Deleting isn't expected to work under these circumstances 730 # Deleting isn't expected to work under these circumstances
718 731
732 @testcase(1163)
719 def test_devtool_extract(self): 733 def test_devtool_extract(self):
720 # Check preconditions 734 # Check preconditions
721 workspacedir = os.path.join(self.builddir, 'workspace') 735 workspacedir = os.path.join(self.builddir, 'workspace')
@@ -729,6 +743,7 @@ class DevtoolTests(DevtoolBase):
729 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') 743 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
730 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found') 744 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
731 745
746 @testcase(1168)
732 def test_devtool_reset_all(self): 747 def test_devtool_reset_all(self):
733 # Check preconditions 748 # Check preconditions
734 workspacedir = os.path.join(self.builddir, 'workspace') 749 workspacedir = os.path.join(self.builddir, 'workspace')
diff --git a/meta/lib/oeqa/selftest/layerappend.py b/meta/lib/oeqa/selftest/layerappend.py
index 79b6137cb0..a82a6c8b9d 100644
--- a/meta/lib/oeqa/selftest/layerappend.py
+++ b/meta/lib/oeqa/selftest/layerappend.py
@@ -51,6 +51,7 @@ SRC_URI_append += "file://appendtest.txt"
51 def tearDownLocal(self): 51 def tearDownLocal(self):
52 ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/..")) 52 ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
53 53
54 @testcase(1196)
54 def test_layer_appends(self): 55 def test_layer_appends(self):
55 corebase = get_bb_var("COREBASE") 56 corebase = get_bb_var("COREBASE")
56 stagingdir = get_bb_var("STAGING_DIR_TARGET") 57 stagingdir = get_bb_var("STAGING_DIR_TARGET")
diff --git a/meta/lib/oeqa/selftest/lic-checksum.py b/meta/lib/oeqa/selftest/lic-checksum.py
index 92fc3a84f1..bd3b9a1ba3 100644
--- a/meta/lib/oeqa/selftest/lic-checksum.py
+++ b/meta/lib/oeqa/selftest/lic-checksum.py
@@ -4,11 +4,13 @@ import tempfile
4from oeqa.selftest.base import oeSelfTest 4from oeqa.selftest.base import oeSelfTest
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
7 8
8class LicenseTests(oeSelfTest): 9class LicenseTests(oeSelfTest):
9 10
10 # 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
11 # the license qa to fail due to a mismatched md5sum. 12 # the license qa to fail due to a mismatched md5sum.
13 @testcase(1197)
12 def test_nonmatching_checksum(self): 14 def test_nonmatching_checksum(self):
13 bitbake_cmd = '-c configure emptytest' 15 bitbake_cmd = '-c configure emptytest'
14 error_msg = 'ERROR: emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc' 16 error_msg = 'ERROR: emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
index 34eea468e8..c4d34bd590 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -18,6 +18,7 @@ class OePkgdataUtilTests(oeSelfTest):
18 logger.info('Running bitbake to generate pkgdata') 18 logger.info('Running bitbake to generate pkgdata')
19 bitbake('glibc busybox zlib bash') 19 bitbake('glibc busybox zlib bash')
20 20
21 @testcase(1203)
21 def test_lookup_pkg(self): 22 def test_lookup_pkg(self):
22 # Forward tests 23 # Forward tests
23 result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"') 24 result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"')
@@ -36,6 +37,7 @@ class OePkgdataUtilTests(oeSelfTest):
36 self.assertEqual(result.status, 1) 37 self.assertEqual(result.status, 1)
37 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 38 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
38 39
40 @testcase(1205)
39 def test_read_value(self): 41 def test_read_value(self):
40 result = runCmd('oe-pkgdata-util read-value PN libz1') 42 result = runCmd('oe-pkgdata-util read-value PN libz1')
41 self.assertEqual(result.output, 'zlib') 43 self.assertEqual(result.output, 'zlib')
@@ -43,6 +45,7 @@ class OePkgdataUtilTests(oeSelfTest):
43 pkgsize = int(result.output.strip()) 45 pkgsize = int(result.output.strip())
44 self.assertGreater(pkgsize, 1) 46 self.assertGreater(pkgsize, 1)
45 47
48 @testcase(1198)
46 def test_find_path(self): 49 def test_find_path(self):
47 result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6') 50 result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6')
48 self.assertEqual(result.output, 'glibc: /lib/libc.so.6') 51 self.assertEqual(result.output, 'glibc: /lib/libc.so.6')
@@ -52,6 +55,7 @@ class OePkgdataUtilTests(oeSelfTest):
52 self.assertEqual(result.status, 1) 55 self.assertEqual(result.status, 1)
53 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist') 56 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
54 57
58 @testcase(1204)
55 def test_lookup_recipe(self): 59 def test_lookup_recipe(self):
56 result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"') 60 result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"')
57 self.assertEqual(result.output, 'glibc\nbusybox') 61 self.assertEqual(result.output, 'glibc\nbusybox')
@@ -61,6 +65,7 @@ class OePkgdataUtilTests(oeSelfTest):
61 self.assertEqual(result.status, 1) 65 self.assertEqual(result.status, 1)
62 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 66 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
63 67
68 @testcase(1202)
64 def test_list_pkgs(self): 69 def test_list_pkgs(self):
65 # No arguments 70 # No arguments
66 result = runCmd('oe-pkgdata-util list-pkgs') 71 result = runCmd('oe-pkgdata-util list-pkgs')
@@ -105,6 +110,7 @@ class OePkgdataUtilTests(oeSelfTest):
105 pkglist = sorted(result.output.split()) 110 pkglist = sorted(result.output.split())
106 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc']) 111 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'])
107 112
113 @testcase(1201)
108 def test_list_pkg_files(self): 114 def test_list_pkg_files(self):
109 def splitoutput(output): 115 def splitoutput(output):
110 files = {} 116 files = {}
@@ -193,6 +199,7 @@ class OePkgdataUtilTests(oeSelfTest):
193 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) 199 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
194 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) 200 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
195 201
202 @testcase(1200)
196 def test_glob(self): 203 def test_glob(self):
197 tempdir = tempfile.mkdtemp(prefix='pkgdataqa') 204 tempdir = tempfile.mkdtemp(prefix='pkgdataqa')
198 self.track_for_cleanup(tempdir) 205 self.track_for_cleanup(tempdir)
@@ -213,6 +220,7 @@ class OePkgdataUtilTests(oeSelfTest):
213 self.assertNotIn('libz-dev', resultlist) 220 self.assertNotIn('libz-dev', resultlist)
214 self.assertNotIn('libz-dbg', resultlist) 221 self.assertNotIn('libz-dbg', resultlist)
215 222
223 @testcase(1206)
216 def test_specify_pkgdatadir(self): 224 def test_specify_pkgdatadir(self):
217 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR')) 225 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))
218 self.assertEqual(result.output, 'libc6') 226 self.assertEqual(result.output, 'libc6')
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
index b3ca171698..08ff4f14e0 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -71,7 +71,7 @@ class RecipetoolTests(DevtoolBase):
71 for errorstr in checkerror: 71 for errorstr in checkerror:
72 self.assertIn(errorstr, result.output) 72 self.assertIn(errorstr, result.output)
73 73
74 74 @testcase(1177)
75 def test_recipetool_appendfile_basic(self): 75 def test_recipetool_appendfile_basic(self):
76 # Basic test 76 # Basic test
77 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 77 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -79,12 +79,14 @@ class RecipetoolTests(DevtoolBase):
79 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd']) 79 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd'])
80 self.assertNotIn('WARNING: ', output) 80 self.assertNotIn('WARNING: ', output)
81 81
82 @testcase(1183)
82 def test_recipetool_appendfile_invalid(self): 83 def test_recipetool_appendfile_invalid(self):
83 # Test some commands that should error 84 # Test some commands that should error
84 self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers']) 85 self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers'])
85 self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool']) 86 self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool'])
86 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool']) 87 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool'])
87 88
89 @testcase(1176)
88 def test_recipetool_appendfile_alternatives(self): 90 def test_recipetool_appendfile_alternatives(self):
89 # Now try with a file we know should be an alternative 91 # Now try with a file we know should be an alternative
90 # (this is very much a fake example, but one we know is reliably an alternative) 92 # (this is very much a fake example, but one we know is reliably an alternative)
@@ -109,6 +111,7 @@ class RecipetoolTests(DevtoolBase):
109 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True) 111 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
110 self.assertNotEqual(result.status, 0, 'New file should have been copied but was not') 112 self.assertNotEqual(result.status, 0, 'New file should have been copied but was not')
111 113
114 @testcase(1178)
112 def test_recipetool_appendfile_binary(self): 115 def test_recipetool_appendfile_binary(self):
113 # Try appending a binary file 116 # Try appending a binary file
114 # /bin/ls can be a symlink to /usr/bin/ls 117 # /bin/ls can be a symlink to /usr/bin/ls
@@ -117,6 +120,7 @@ class RecipetoolTests(DevtoolBase):
117 self.assertIn('WARNING: ', result.output) 120 self.assertIn('WARNING: ', result.output)
118 self.assertIn('is a binary', result.output) 121 self.assertIn('is a binary', result.output)
119 122
123 @testcase(1173)
120 def test_recipetool_appendfile_add(self): 124 def test_recipetool_appendfile_add(self):
121 corebase = get_bb_var('COREBASE') 125 corebase = get_bb_var('COREBASE')
122 # Try arbitrary file add to a recipe 126 # Try arbitrary file add to a recipe
@@ -146,6 +150,7 @@ class RecipetoolTests(DevtoolBase):
146 '}\n'] 150 '}\n']
147 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name]) 151 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
148 152
153 @testcase(1174)
149 def test_recipetool_appendfile_add_bindir(self): 154 def test_recipetool_appendfile_add_bindir(self):
150 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 155 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
151 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 156 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -159,6 +164,7 @@ class RecipetoolTests(DevtoolBase):
159 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile']) 164 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
160 self.assertNotIn('WARNING: ', output) 165 self.assertNotIn('WARNING: ', output)
161 166
167 @testcase(1175)
162 def test_recipetool_appendfile_add_machine(self): 168 def test_recipetool_appendfile_add_machine(self):
163 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 169 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
164 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 170 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -174,6 +180,7 @@ class RecipetoolTests(DevtoolBase):
174 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile']) 180 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
175 self.assertNotIn('WARNING: ', output) 181 self.assertNotIn('WARNING: ', output)
176 182
183 @testcase(1184)
177 def test_recipetool_appendfile_orig(self): 184 def test_recipetool_appendfile_orig(self):
178 # A file that's in SRC_URI and in do_install with the same name 185 # A file that's in SRC_URI and in do_install with the same name
179 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 186 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -181,6 +188,7 @@ class RecipetoolTests(DevtoolBase):
181 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig']) 188 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig'])
182 self.assertNotIn('WARNING: ', output) 189 self.assertNotIn('WARNING: ', output)
183 190
191 @testcase(1191)
184 def test_recipetool_appendfile_todir(self): 192 def test_recipetool_appendfile_todir(self):
185 # A file that's in SRC_URI and in do_install with destination directory rather than file 193 # A file that's in SRC_URI and in do_install with destination directory rather than file
186 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 194 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -188,6 +196,7 @@ class RecipetoolTests(DevtoolBase):
188 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir']) 196 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir'])
189 self.assertNotIn('WARNING: ', output) 197 self.assertNotIn('WARNING: ', output)
190 198
199 @testcase(1187)
191 def test_recipetool_appendfile_renamed(self): 200 def test_recipetool_appendfile_renamed(self):
192 # A file that's in SRC_URI with a different name to the destination file 201 # A file that's in SRC_URI with a different name to the destination file
193 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 202 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -195,6 +204,7 @@ class RecipetoolTests(DevtoolBase):
195 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1']) 204 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1'])
196 self.assertNotIn('WARNING: ', output) 205 self.assertNotIn('WARNING: ', output)
197 206
207 @testcase(1190)
198 def test_recipetool_appendfile_subdir(self): 208 def test_recipetool_appendfile_subdir(self):
199 # A file that's in SRC_URI in a subdir 209 # A file that's in SRC_URI in a subdir
200 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 210 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -208,6 +218,7 @@ class RecipetoolTests(DevtoolBase):
208 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile']) 218 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
209 self.assertNotIn('WARNING: ', output) 219 self.assertNotIn('WARNING: ', output)
210 220
221 @testcase(1189)
211 def test_recipetool_appendfile_src_glob(self): 222 def test_recipetool_appendfile_src_glob(self):
212 # A file that's in SRC_URI as a glob 223 # A file that's in SRC_URI as a glob
213 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 224 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -221,6 +232,7 @@ class RecipetoolTests(DevtoolBase):
221 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile']) 232 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile'])
222 self.assertNotIn('WARNING: ', output) 233 self.assertNotIn('WARNING: ', output)
223 234
235 @testcase(1181)
224 def test_recipetool_appendfile_inst_glob(self): 236 def test_recipetool_appendfile_inst_glob(self):
225 # A file that's in do_install as a glob 237 # A file that's in do_install as a glob
226 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 238 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -228,6 +240,7 @@ class RecipetoolTests(DevtoolBase):
228 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile']) 240 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile'])
229 self.assertNotIn('WARNING: ', output) 241 self.assertNotIn('WARNING: ', output)
230 242
243 @testcase(1182)
231 def test_recipetool_appendfile_inst_todir_glob(self): 244 def test_recipetool_appendfile_inst_todir_glob(self):
232 # A file that's in do_install as a glob with destination as a directory 245 # A file that's in do_install as a glob with destination as a directory
233 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 246 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -235,6 +248,7 @@ class RecipetoolTests(DevtoolBase):
235 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile']) 248 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile'])
236 self.assertNotIn('WARNING: ', output) 249 self.assertNotIn('WARNING: ', output)
237 250
251 @testcase(1185)
238 def test_recipetool_appendfile_patch(self): 252 def test_recipetool_appendfile_patch(self):
239 # A file that's added by a patch in SRC_URI 253 # A file that's added by a patch in SRC_URI
240 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 254 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -253,6 +267,7 @@ class RecipetoolTests(DevtoolBase):
253 else: 267 else:
254 self.assertTrue(False, 'Patch warning not found in output:\n%s' % output) 268 self.assertTrue(False, 'Patch warning not found in output:\n%s' % output)
255 269
270 @testcase(1188)
256 def test_recipetool_appendfile_script(self): 271 def test_recipetool_appendfile_script(self):
257 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install) 272 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install)
258 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 273 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -266,6 +281,7 @@ class RecipetoolTests(DevtoolBase):
266 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile']) 281 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
267 self.assertNotIn('WARNING: ', output) 282 self.assertNotIn('WARNING: ', output)
268 283
284 @testcase(1180)
269 def test_recipetool_appendfile_inst_func(self): 285 def test_recipetool_appendfile_inst_func(self):
270 # A file that's installed from a function called by do_install 286 # A file that's installed from a function called by do_install
271 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 287 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
@@ -273,6 +289,7 @@ class RecipetoolTests(DevtoolBase):
273 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func']) 289 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func'])
274 self.assertNotIn('WARNING: ', output) 290 self.assertNotIn('WARNING: ', output)
275 291
292 @testcase(1186)
276 def test_recipetool_appendfile_postinstall(self): 293 def test_recipetool_appendfile_postinstall(self):
277 # A file that's created by a postinstall script (and explicitly mentioned in it) 294 # A file that's created by a postinstall script (and explicitly mentioned in it)
278 # First try without specifying recipe 295 # First try without specifying recipe
@@ -288,6 +305,7 @@ class RecipetoolTests(DevtoolBase):
288 '}\n'] 305 '}\n']
289 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) 306 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
290 307
308 @testcase(1179)
291 def test_recipetool_appendfile_extlayer(self): 309 def test_recipetool_appendfile_extlayer(self):
292 # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure 310 # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure
293 exttemplayerdir = os.path.join(self.tempdir, 'extlayer') 311 exttemplayerdir = os.path.join(self.tempdir, 'extlayer')
@@ -303,6 +321,7 @@ class RecipetoolTests(DevtoolBase):
303 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig'] 321 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig']
304 self.assertEqual(sorted(createdfiles), sorted(expectedfiles)) 322 self.assertEqual(sorted(createdfiles), sorted(expectedfiles))
305 323
324 @testcase(1192)
306 def test_recipetool_appendfile_wildcard(self): 325 def test_recipetool_appendfile_wildcard(self):
307 326
308 def try_appendfile_wc(options): 327 def try_appendfile_wc(options):
@@ -327,8 +346,7 @@ class RecipetoolTests(DevtoolBase):
327 filename = try_appendfile_wc('-w') 346 filename = try_appendfile_wc('-w')
328 self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend') 347 self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
329 348
330 349 @testcase(1193)
331
332 def test_recipetool_create(self): 350 def test_recipetool_create(self):
333 # Try adding a recipe 351 # Try adding a recipe
334 tempsrc = os.path.join(self.tempdir, 'srctree') 352 tempsrc = os.path.join(self.tempdir, 'srctree')
@@ -345,6 +363,7 @@ class RecipetoolTests(DevtoolBase):
345 checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64' 363 checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64'
346 self._test_recipe_contents(recipefile, checkvars, []) 364 self._test_recipe_contents(recipefile, checkvars, [])
347 365
366 @testcase(1194)
348 def test_recipetool_create_git(self): 367 def test_recipetool_create_git(self):
349 # Ensure we have the right data in shlibs/pkgdata 368 # Ensure we have the right data in shlibs/pkgdata
350 bitbake('libpng pango libx11 libxext jpeg') 369 bitbake('libpng pango libx11 libxext jpeg')