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-04 13:27:29 +0100 |
commit | 456e7ab51361af23671f6c74a18fbd54a79ac1e8 (patch) | |
tree | 45244e697c04fe034c6301224db54c2d2a47f2df /meta/lib/oeqa | |
parent | eb4e519f4c2c6d8ee5f635bc477de3c4b5d5c2d6 (diff) | |
download | poky-456e7ab51361af23671f6c74a18fbd54a79ac1e8.tar.gz |
meta-selftest: add test of .gitignore in tarball
(From OE-Core rev: 8ee4f7c076b0fdbfc5b9d6b5bbbf8a02f5d062a7)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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): | |||
1108 | ('??', '.*/0001-Add-new-file.patch$')] | 1108 | ('??', '.*/0001-Add-new-file.patch$')] |
1109 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | 1109 | self._check_repo_status(os.path.dirname(recipefile), expected_status) |
1110 | 1110 | ||
1111 | def test_devtool_update_recipe_with_gitignore(self): | ||
1112 | # First, modify the recipe | ||
1113 | testrecipe = 'devtool-test-ignored' | ||
1114 | bb_vars = get_bb_vars(['FILE'], testrecipe) | ||
1115 | recipefile = bb_vars['FILE'] | ||
1116 | patchfile = os.path.join(os.path.dirname(recipefile), testrecipe, testrecipe + '.patch') | ||
1117 | newpatchfile = os.path.join(os.path.dirname(recipefile), testrecipe, testrecipe + '.patch.expected') | ||
1118 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
1119 | self.track_for_cleanup(tempdir) | ||
1120 | self.track_for_cleanup(self.workspacedir) | ||
1121 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
1122 | # (don't bother with cleaning the recipe on teardown, we won't be building it) | ||
1123 | result = runCmd('devtool modify %s' % testrecipe) | ||
1124 | self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) | ||
1125 | result = runCmd('devtool finish --force-patch-refresh %s meta-selftest' % testrecipe) | ||
1126 | # Check recipe got changed as expected | ||
1127 | with open(newpatchfile, 'r') as f: | ||
1128 | desiredlines = f.readlines() | ||
1129 | with open(patchfile, 'r') as f: | ||
1130 | newlines = f.readlines() | ||
1131 | # Ignore the initial lines, because oe-selftest creates own meta-selftest repo | ||
1132 | # which changes the metadata subject which is added into the patch, but keep | ||
1133 | # .patch.expected as it is in case someone runs devtool finish --force-patch-refresh | ||
1134 | # devtool-test-ignored manually, then it should generate exactly the same .patch file | ||
1135 | self.assertEqual(desiredlines[5:], newlines[5:]) | ||
1136 | |||
1111 | def test_devtool_update_recipe_local_files_3(self): | 1137 | def test_devtool_update_recipe_local_files_3(self): |
1112 | # First, modify the recipe | 1138 | # First, modify the recipe |
1113 | testrecipe = 'devtool-test-localonly' | 1139 | testrecipe = 'devtool-test-localonly' |