summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-26 02:57:50 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-08 23:47:13 (GMT)
commit2de1a5cefb5a094a55d8e2bc0fa7711b6a2efdc7 (patch)
treecc8c1ef19c4e67fdab723e5948d5b9394bbdb647
parenta7c3e18de07d18ebe079dad9cfe2b042c6446f91 (diff)
downloadpoky-2de1a5cefb5a094a55d8e2bc0fa7711b6a2efdc7.tar.gz
oe-selftest: recipetool: add tests for git URL mangling
Add three tests to verify that the git URL mangling is working the way it's supposed to. This should prevent us regressing on this again in future. (From OE-Core rev: d8d01f462ddbb79cff23b544fcd0ce251f05f8ce) (From OE-Core rev: e8d0b5ca2e0f6086d9e9873137b335a527630a54) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/recipetool.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
index d7d155f..2cccf2b 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -442,6 +442,49 @@ class RecipetoolTests(RecipetoolBase):
442 inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig'] 442 inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig']
443 self._test_recipe_contents(recipefile, checkvars, inherits) 443 self._test_recipe_contents(recipefile, checkvars, inherits)
444 444
445 def test_recipetool_create_github(self):
446 # Basic test to see if github URL mangling works
447 temprecipe = os.path.join(self.tempdir, 'recipe')
448 os.makedirs(temprecipe)
449 recipefile = os.path.join(temprecipe, 'meson_git.bb')
450 srcuri = 'https://github.com/mesonbuild/meson'
451 result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
452 self.assertTrue(os.path.isfile(recipefile))
453 checkvars = {}
454 checkvars['LICENSE'] = set(['Apache-2.0'])
455 checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https'
456 inherits = ['setuptools']
457 self._test_recipe_contents(recipefile, checkvars, inherits)
458
459 def test_recipetool_create_github_tarball(self):
460 # Basic test to ensure github URL mangling doesn't apply to release tarballs
461 temprecipe = os.path.join(self.tempdir, 'recipe')
462 os.makedirs(temprecipe)
463 pv = '0.32.0'
464 recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv)
465 srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv)
466 result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
467 self.assertTrue(os.path.isfile(recipefile))
468 checkvars = {}
469 checkvars['LICENSE'] = set(['Apache-2.0'])
470 checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz'
471 inherits = ['setuptools']
472 self._test_recipe_contents(recipefile, checkvars, inherits)
473
474 def test_recipetool_create_git_http(self):
475 # Basic test to check http git URL mangling works
476 temprecipe = os.path.join(self.tempdir, 'recipe')
477 os.makedirs(temprecipe)
478 recipefile = os.path.join(temprecipe, 'matchbox-terminal_git.bb')
479 srcuri = 'http://git.yoctoproject.org/git/matchbox-terminal'
480 result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
481 self.assertTrue(os.path.isfile(recipefile))
482 checkvars = {}
483 checkvars['LICENSE'] = set(['GPLv2'])
484 checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/matchbox-terminal;protocol=http'
485 inherits = ['pkgconfig', 'autotools']
486 self._test_recipe_contents(recipefile, checkvars, inherits)
487
445class RecipetoolAppendsrcBase(RecipetoolBase): 488class RecipetoolAppendsrcBase(RecipetoolBase):
446 def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles): 489 def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles):
447 cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile) 490 cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile)