diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/bbtests.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bbtests.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py index b932d5276b..4187cb840a 100644 --- a/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/meta/lib/oeqa/selftest/cases/bbtests.py | |||
@@ -163,7 +163,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" | |||
163 | """) | 163 | """) |
164 | self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) | 164 | self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) |
165 | 165 | ||
166 | data = 'SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' | 166 | data = 'SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' |
167 | self.write_recipeinc('aspell', data) | 167 | self.write_recipeinc('aspell', data) |
168 | result = bitbake('-f -c fetch aspell', ignore_status=True) | 168 | result = bitbake('-f -c fetch aspell', ignore_status=True) |
169 | self.delete_recipeinc('aspell') | 169 | self.delete_recipeinc('aspell') |
@@ -300,3 +300,32 @@ INHERIT_remove = \"report-error\" | |||
300 | 300 | ||
301 | test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe) | 301 | test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe) |
302 | self.assertEqual(expected_recipe_summary, test_recipe_summary_after) | 302 | self.assertEqual(expected_recipe_summary, test_recipe_summary_after) |
303 | |||
304 | def test_git_patchtool(self): | ||
305 | """ PATCHTOOL=git should work with non-git sources like tarballs | ||
306 | test recipe for the test must NOT containt git:// repository in SRC_URI | ||
307 | """ | ||
308 | test_recipe = "man-db" | ||
309 | self.write_recipeinc(test_recipe, 'PATCHTOOL=\"git\"') | ||
310 | src = get_bb_var("SRC_URI",test_recipe) | ||
311 | gitscm = re.search("git://", src) | ||
312 | self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe)) | ||
313 | result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) | ||
314 | fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output) | ||
315 | self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"") | ||
316 | self.delete_recipeinc(test_recipe) | ||
317 | bitbake('-cclean {}'.format(test_recipe)) | ||
318 | |||
319 | def test_git_patchtool2(self): | ||
320 | """ Test if PATCHTOOL=git works with git repo and doesn't reinitialize it | ||
321 | """ | ||
322 | test_recipe = "gitrepotest" | ||
323 | src = get_bb_var("SRC_URI",test_recipe) | ||
324 | gitscm = re.search("git://", src) | ||
325 | self.assertTrue(gitscm, "test_git_patchtool pre-condition failed: {} test recipe doesn't contains git repo!".format(test_recipe)) | ||
326 | result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) | ||
327 | srcdir = get_bb_var('S', test_recipe) | ||
328 | result = runCmd("git log", cwd = srcdir) | ||
329 | self.assertFalse("bitbake_patching_started" in result.output, msg = "Repository has been reinitialized. {}".format(srcdir)) | ||
330 | self.delete_recipeinc(test_recipe) | ||
331 | bitbake('-cclean {}'.format(test_recipe)) | ||