diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2020-05-30 00:03:24 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-03 15:25:54 +0100 |
commit | 8ee4f7c076b0fdbfc5b9d6b5bbbf8a02f5d062a7 (patch) | |
tree | 58694a9e5281ed5860ce6ba1d664b6a8fd507867 /meta | |
parent | 06a24a615549af3550302a56ea08147000a608f3 (diff) | |
download | openembedded-core-contrib-8ee4f7c076b0fdbfc5b9d6b5bbbf8a02f5d062a7.tar.gz |
meta-selftest: add test of .gitignore in tarball
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 5886862d6c..0218f0821c 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1108,6 +1108,32 @@ class DevtoolUpdateTests(DevtoolBase): ('??', '.*/0001-Add-new-file.patch$')] self._check_repo_status(os.path.dirname(recipefile), expected_status) + def test_devtool_update_recipe_with_gitignore(self): + # First, modify the recipe + testrecipe = 'devtool-test-ignored' + bb_vars = get_bb_vars(['FILE'], testrecipe) + recipefile = bb_vars['FILE'] + patchfile = os.path.join(os.path.dirname(recipefile), testrecipe, testrecipe + '.patch') + newpatchfile = os.path.join(os.path.dirname(recipefile), testrecipe, testrecipe + '.patch.expected') + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + # (don't bother with cleaning the recipe on teardown, we won't be building it) + result = runCmd('devtool modify %s' % testrecipe) + self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) + result = runCmd('devtool finish --force-patch-refresh %s meta-selftest' % testrecipe) + # Check recipe got changed as expected + with open(newpatchfile, 'r') as f: + desiredlines = f.readlines() + with open(patchfile, 'r') as f: + newlines = f.readlines() + # Ignore the initial lines, because oe-selftest creates own meta-selftest repo + # which changes the metadata subject which is added into the patch, but keep + # .patch.expected as it is in case someone runs devtool finish --force-patch-refresh + # devtool-test-ignored manually, then it should generate exactly the same .patch file + self.assertEqual(desiredlines[5:], newlines[5:]) + def test_devtool_update_recipe_local_files_3(self): # First, modify the recipe testrecipe = 'devtool-test-localonly' |