diff options
author | Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> | 2020-01-24 18:07:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:48:09 +0000 |
commit | 44b2ab8d5eb4fd1fc9a157fce37aaa7b7a7065e5 (patch) | |
tree | 07a0ec6c392975e847698fbf9881f5944d13d68e | |
parent | 4bb2d97e7ff710170482f263cee3fa7eb79f56e5 (diff) | |
download | poky-44b2ab8d5eb4fd1fc9a157fce37aaa7b7a7065e5.tar.gz |
oeqa/selftest/recipetool: add npm recipe creation test
This commit adds a recipetool creation test for npm recipe:
- recipetool.RecipetoolTests.test_recipetool_create_npm
(From OE-Core rev: 61cabc2ccaa6a972b799d19fda8964926cc7ecec)
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index c1562c63b2..6bfe8f177f 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -421,6 +421,31 @@ class RecipetoolTests(RecipetoolBase): | |||
421 | inherits = ['cmake'] | 421 | inherits = ['cmake'] |
422 | self._test_recipe_contents(recipefile, checkvars, inherits) | 422 | self._test_recipe_contents(recipefile, checkvars, inherits) |
423 | 423 | ||
424 | def test_recipetool_create_npm(self): | ||
425 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
426 | os.makedirs(temprecipe) | ||
427 | recipefile = os.path.join(temprecipe, 'savoirfairelinux-node-server-example_1.0.0.bb') | ||
428 | shrinkwrap = os.path.join(temprecipe, 'savoirfairelinux-node-server-example', 'npm-shrinkwrap.json') | ||
429 | srcuri = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' | ||
430 | result = runCmd('recipetool create -o %s \'%s\'' % (temprecipe, srcuri)) | ||
431 | self.assertTrue(os.path.isfile(recipefile)) | ||
432 | self.assertTrue(os.path.isfile(shrinkwrap)) | ||
433 | checkvars = {} | ||
434 | checkvars['SUMMARY'] = 'Node Server Example' | ||
435 | checkvars['HOMEPAGE'] = 'https://github.com/savoirfairelinux/node-server-example#readme' | ||
436 | checkvars['LICENSE'] = set(['MIT', 'ISC', 'Unknown']) | ||
437 | urls = [] | ||
438 | urls.append('npm://registry.npmjs.org/;package=@savoirfairelinux/node-server-example;version=${PV}') | ||
439 | urls.append('npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json') | ||
440 | checkvars['SRC_URI'] = set(urls) | ||
441 | checkvars['S'] = '${WORKDIR}/npm' | ||
442 | checkvars['LICENSE_${PN}'] = 'MIT' | ||
443 | checkvars['LICENSE_${PN}-base64'] = 'Unknown' | ||
444 | checkvars['LICENSE_${PN}-accepts'] = 'MIT' | ||
445 | checkvars['LICENSE_${PN}-inherits'] = 'ISC' | ||
446 | inherits = ['npm'] | ||
447 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
448 | |||
424 | def test_recipetool_create_github(self): | 449 | def test_recipetool_create_github(self): |
425 | # Basic test to see if github URL mangling works | 450 | # Basic test to see if github URL mangling works |
426 | temprecipe = os.path.join(self.tempdir, 'recipe') | 451 | temprecipe = os.path.join(self.tempdir, 'recipe') |