summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/recipetool.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-28 23:28:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-02 15:44:10 +0100
commitbb6ddc3691ab04162ec5fd69a2d5e7876713fd15 (patch)
tree76e376b01253c3aace1a98a5021bcaad3c92e861 /meta/lib/oeqa/selftest/cases/recipetool.py
parentfcc456ee4b8f619134abb4649db53c638074082c (diff)
downloadpoky-bb6ddc3691ab04162ec5fd69a2d5e7876713fd15.tar.gz
Convert to new override syntax
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/recipetool.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py62
1 files changed, 31 insertions, 31 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index f0685d3718..3b99417e84 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -94,7 +94,7 @@ class RecipetoolTests(RecipetoolBase):
94 94
95 def test_recipetool_appendfile_basic(self): 95 def test_recipetool_appendfile_basic(self):
96 # Basic test 96 # Basic test
97 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 97 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
98 '\n'] 98 '\n']
99 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd']) 99 _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd'])
100 self.assertNotIn('WARNING: ', output) 100 self.assertNotIn('WARNING: ', output)
@@ -112,11 +112,11 @@ class RecipetoolTests(RecipetoolBase):
112 # Need a test file - should be executable 112 # Need a test file - should be executable
113 testfile2 = os.path.join(self.corebase, 'oe-init-build-env') 113 testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
114 testfile2name = os.path.basename(testfile2) 114 testfile2name = os.path.basename(testfile2)
115 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 115 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
116 '\n', 116 '\n',
117 'SRC_URI += "file://%s"\n' % testfile2name, 117 'SRC_URI += "file://%s"\n' % testfile2name,
118 '\n', 118 '\n',
119 'do_install_append() {\n', 119 'do_install:append() {\n',
120 ' install -d ${D}${base_bindir}\n', 120 ' install -d ${D}${base_bindir}\n',
121 ' install -m 0755 ${WORKDIR}/%s ${D}${base_bindir}/ls\n' % testfile2name, 121 ' install -m 0755 ${WORKDIR}/%s ${D}${base_bindir}/ls\n' % testfile2name,
122 '}\n'] 122 '}\n']
@@ -138,11 +138,11 @@ class RecipetoolTests(RecipetoolBase):
138 138
139 def test_recipetool_appendfile_add(self): 139 def test_recipetool_appendfile_add(self):
140 # Try arbitrary file add to a recipe 140 # Try arbitrary file add to a recipe
141 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 141 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
142 '\n', 142 '\n',
143 'SRC_URI += "file://testfile"\n', 143 'SRC_URI += "file://testfile"\n',
144 '\n', 144 '\n',
145 'do_install_append() {\n', 145 'do_install:append() {\n',
146 ' install -d ${D}${datadir}\n', 146 ' install -d ${D}${datadir}\n',
147 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 147 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
148 '}\n'] 148 '}\n']
@@ -151,13 +151,13 @@ class RecipetoolTests(RecipetoolBase):
151 # (so we're testing that, plus modifying an existing bbappend) 151 # (so we're testing that, plus modifying an existing bbappend)
152 testfile2 = os.path.join(self.corebase, 'oe-init-build-env') 152 testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
153 testfile2name = os.path.basename(testfile2) 153 testfile2name = os.path.basename(testfile2)
154 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 154 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
155 '\n', 155 '\n',
156 'SRC_URI += "file://testfile \\\n', 156 'SRC_URI += "file://testfile \\\n',
157 ' file://%s \\\n' % testfile2name, 157 ' file://%s \\\n' % testfile2name,
158 ' "\n', 158 ' "\n',
159 '\n', 159 '\n',
160 'do_install_append() {\n', 160 'do_install:append() {\n',
161 ' install -d ${D}${datadir}\n', 161 ' install -d ${D}${datadir}\n',
162 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 162 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
163 ' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name, 163 ' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
@@ -166,11 +166,11 @@ class RecipetoolTests(RecipetoolBase):
166 166
167 def test_recipetool_appendfile_add_bindir(self): 167 def test_recipetool_appendfile_add_bindir(self):
168 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 168 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
169 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 169 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
170 '\n', 170 '\n',
171 'SRC_URI += "file://testfile"\n', 171 'SRC_URI += "file://testfile"\n',
172 '\n', 172 '\n',
173 'do_install_append() {\n', 173 'do_install:append() {\n',
174 ' install -d ${D}${bindir}\n', 174 ' install -d ${D}${bindir}\n',
175 ' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n', 175 ' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
176 '}\n'] 176 '}\n']
@@ -179,13 +179,13 @@ class RecipetoolTests(RecipetoolBase):
179 179
180 def test_recipetool_appendfile_add_machine(self): 180 def test_recipetool_appendfile_add_machine(self):
181 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable 181 # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
182 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 182 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
183 '\n', 183 '\n',
184 'PACKAGE_ARCH = "${MACHINE_ARCH}"\n', 184 'PACKAGE_ARCH = "${MACHINE_ARCH}"\n',
185 '\n', 185 '\n',
186 'SRC_URI_append_mymachine = " file://testfile"\n', 186 'SRC_URI:append_mymachine = " file://testfile"\n',
187 '\n', 187 '\n',
188 'do_install_append_mymachine() {\n', 188 'do_install:append_mymachine() {\n',
189 ' install -d ${D}${datadir}\n', 189 ' install -d ${D}${datadir}\n',
190 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 190 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
191 '}\n'] 191 '}\n']
@@ -194,32 +194,32 @@ class RecipetoolTests(RecipetoolBase):
194 194
195 def test_recipetool_appendfile_orig(self): 195 def test_recipetool_appendfile_orig(self):
196 # A file that's in SRC_URI and in do_install with the same name 196 # A file that's in SRC_URI and in do_install with the same name
197 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 197 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
198 '\n'] 198 '\n']
199 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig']) 199 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig'])
200 self.assertNotIn('WARNING: ', output) 200 self.assertNotIn('WARNING: ', output)
201 201
202 def test_recipetool_appendfile_todir(self): 202 def test_recipetool_appendfile_todir(self):
203 # A file that's in SRC_URI and in do_install with destination directory rather than file 203 # A file that's in SRC_URI and in do_install with destination directory rather than file
204 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 204 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
205 '\n'] 205 '\n']
206 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir']) 206 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir'])
207 self.assertNotIn('WARNING: ', output) 207 self.assertNotIn('WARNING: ', output)
208 208
209 def test_recipetool_appendfile_renamed(self): 209 def test_recipetool_appendfile_renamed(self):
210 # A file that's in SRC_URI with a different name to the destination file 210 # A file that's in SRC_URI with a different name to the destination file
211 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 211 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
212 '\n'] 212 '\n']
213 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1']) 213 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1'])
214 self.assertNotIn('WARNING: ', output) 214 self.assertNotIn('WARNING: ', output)
215 215
216 def test_recipetool_appendfile_subdir(self): 216 def test_recipetool_appendfile_subdir(self):
217 # A file that's in SRC_URI in a subdir 217 # A file that's in SRC_URI in a subdir
218 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 218 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
219 '\n', 219 '\n',
220 'SRC_URI += "file://testfile"\n', 220 'SRC_URI += "file://testfile"\n',
221 '\n', 221 '\n',
222 'do_install_append() {\n', 222 'do_install:append() {\n',
223 ' install -d ${D}${datadir}\n', 223 ' install -d ${D}${datadir}\n',
224 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n', 224 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
225 '}\n'] 225 '}\n']
@@ -228,25 +228,25 @@ class RecipetoolTests(RecipetoolBase):
228 228
229 def test_recipetool_appendfile_inst_glob(self): 229 def test_recipetool_appendfile_inst_glob(self):
230 # A file that's in do_install as a glob 230 # A file that's in do_install as a glob
231 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 231 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
232 '\n'] 232 '\n']
233 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile']) 233 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile'])
234 self.assertNotIn('WARNING: ', output) 234 self.assertNotIn('WARNING: ', output)
235 235
236 def test_recipetool_appendfile_inst_todir_glob(self): 236 def test_recipetool_appendfile_inst_todir_glob(self):
237 # A file that's in do_install as a glob with destination as a directory 237 # A file that's in do_install as a glob with destination as a directory
238 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 238 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
239 '\n'] 239 '\n']
240 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile']) 240 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile'])
241 self.assertNotIn('WARNING: ', output) 241 self.assertNotIn('WARNING: ', output)
242 242
243 def test_recipetool_appendfile_patch(self): 243 def test_recipetool_appendfile_patch(self):
244 # A file that's added by a patch in SRC_URI 244 # A file that's added by a patch in SRC_URI
245 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 245 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
246 '\n', 246 '\n',
247 'SRC_URI += "file://testfile"\n', 247 'SRC_URI += "file://testfile"\n',
248 '\n', 248 '\n',
249 'do_install_append() {\n', 249 'do_install:append() {\n',
250 ' install -d ${D}${sysconfdir}\n', 250 ' install -d ${D}${sysconfdir}\n',
251 ' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n', 251 ' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
252 '}\n'] 252 '}\n']
@@ -260,11 +260,11 @@ class RecipetoolTests(RecipetoolBase):
260 260
261 def test_recipetool_appendfile_script(self): 261 def test_recipetool_appendfile_script(self):
262 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install) 262 # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install)
263 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 263 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
264 '\n', 264 '\n',
265 'SRC_URI += "file://testfile"\n', 265 'SRC_URI += "file://testfile"\n',
266 '\n', 266 '\n',
267 'do_install_append() {\n', 267 'do_install:append() {\n',
268 ' install -d ${D}${datadir}\n', 268 ' install -d ${D}${datadir}\n',
269 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n', 269 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
270 '}\n'] 270 '}\n']
@@ -273,7 +273,7 @@ class RecipetoolTests(RecipetoolBase):
273 273
274 def test_recipetool_appendfile_inst_func(self): 274 def test_recipetool_appendfile_inst_func(self):
275 # A file that's installed from a function called by do_install 275 # A file that's installed from a function called by do_install
276 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 276 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
277 '\n'] 277 '\n']
278 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func']) 278 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func'])
279 self.assertNotIn('WARNING: ', output) 279 self.assertNotIn('WARNING: ', output)
@@ -283,11 +283,11 @@ class RecipetoolTests(RecipetoolBase):
283 # First try without specifying recipe 283 # First try without specifying recipe
284 self._try_recipetool_appendfile_fail('/usr/share/selftest-replaceme-postinst', self.testfile, ['File /usr/share/selftest-replaceme-postinst may be written out in a pre/postinstall script of the following recipes:', 'selftest-recipetool-appendfile']) 284 self._try_recipetool_appendfile_fail('/usr/share/selftest-replaceme-postinst', self.testfile, ['File /usr/share/selftest-replaceme-postinst may be written out in a pre/postinstall script of the following recipes:', 'selftest-recipetool-appendfile'])
285 # Now specify recipe 285 # Now specify recipe
286 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 286 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
287 '\n', 287 '\n',
288 'SRC_URI += "file://testfile"\n', 288 'SRC_URI += "file://testfile"\n',
289 '\n', 289 '\n',
290 'do_install_append() {\n', 290 'do_install:append() {\n',
291 ' install -d ${D}${datadir}\n', 291 ' install -d ${D}${datadir}\n',
292 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n', 292 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
293 '}\n'] 293 '}\n']
@@ -430,10 +430,10 @@ class RecipetoolTests(RecipetoolBase):
430 urls.append('npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json') 430 urls.append('npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json')
431 checkvars['SRC_URI'] = set(urls) 431 checkvars['SRC_URI'] = set(urls)
432 checkvars['S'] = '${WORKDIR}/npm' 432 checkvars['S'] = '${WORKDIR}/npm'
433 checkvars['LICENSE_${PN}'] = 'MIT' 433 checkvars['LICENSE:${PN}'] = 'MIT'
434 checkvars['LICENSE_${PN}-base64'] = 'Unknown' 434 checkvars['LICENSE:${PN}-base64'] = 'Unknown'
435 checkvars['LICENSE_${PN}-accepts'] = 'MIT' 435 checkvars['LICENSE:${PN}-accepts'] = 'MIT'
436 checkvars['LICENSE_${PN}-inherits'] = 'ISC' 436 checkvars['LICENSE:${PN}-inherits'] = 'ISC'
437 inherits = ['npm'] 437 inherits = ['npm']
438 self._test_recipe_contents(recipefile, checkvars, inherits) 438 self._test_recipe_contents(recipefile, checkvars, inherits)
439 439
@@ -620,7 +620,7 @@ class RecipetoolAppendsrcBase(RecipetoolBase):
620 else: 620 else:
621 destpath = '.' + os.sep 621 destpath = '.' + os.sep
622 622
623 expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', 623 expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
624 '\n'] 624 '\n']
625 if has_src_uri: 625 if has_src_uri:
626 uri = 'file://%s' % filename 626 uri = 'file://%s' % filename