diff options
Diffstat (limited to 'meta/lib')
| -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' |
