summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>2020-01-24 18:07:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-27 16:38:54 +0000
commit61cabc2ccaa6a972b799d19fda8964926cc7ecec (patch)
tree782a0a81b637a6c6d2847c9b5a7a4bee22cda498 /meta/lib/oeqa
parent401a9818c633373854d3c7dec032b9f455f2b2b4 (diff)
downloadopenembedded-core-contrib-61cabc2ccaa6a972b799d19fda8964926cc7ecec.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 Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py25
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):
inherits = ['cmake']
self._test_recipe_contents(recipefile, checkvars, inherits)
+ def test_recipetool_create_npm(self):
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ recipefile = os.path.join(temprecipe, 'savoirfairelinux-node-server-example_1.0.0.bb')
+ shrinkwrap = os.path.join(temprecipe, 'savoirfairelinux-node-server-example', 'npm-shrinkwrap.json')
+ srcuri = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'
+ result = runCmd('recipetool create -o %s \'%s\'' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ self.assertTrue(os.path.isfile(shrinkwrap))
+ checkvars = {}
+ checkvars['SUMMARY'] = 'Node Server Example'
+ checkvars['HOMEPAGE'] = 'https://github.com/savoirfairelinux/node-server-example#readme'
+ checkvars['LICENSE'] = set(['MIT', 'ISC', 'Unknown'])
+ urls = []
+ urls.append('npm://registry.npmjs.org/;package=@savoirfairelinux/node-server-example;version=${PV}')
+ urls.append('npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json')
+ checkvars['SRC_URI'] = set(urls)
+ checkvars['S'] = '${WORKDIR}/npm'
+ checkvars['LICENSE_${PN}'] = 'MIT'
+ checkvars['LICENSE_${PN}-base64'] = 'Unknown'
+ checkvars['LICENSE_${PN}-accepts'] = 'MIT'
+ checkvars['LICENSE_${PN}-inherits'] = 'ISC'
+ inherits = ['npm']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
def test_recipetool_create_github(self):
# Basic test to see if github URL mangling works
temprecipe = os.path.join(self.tempdir, 'recipe')