summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-05-30 00:03:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-04 13:27:29 +0100
commit047d3f39f5b9522a340746d07f7a745ca140877c (patch)
tree61f037a3d8a7e72a79e354843f9b010ddc8ceeb4 /meta/lib/oeqa
parent41c8e1b7065103d80ab30af290c7487e94b6765c (diff)
downloadpoky-047d3f39f5b9522a340746d07f7a745ca140877c.tar.gz
meta-selftest: add test for .patch file with long filename and without subject
(From OE-Core rev: 7c3e17f34c74e838990006aaf570df501aa2c167) 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.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 0218f0821c..49cee6d6a8 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1134,6 +1134,33 @@ class DevtoolUpdateTests(DevtoolBase):
1134 # devtool-test-ignored manually, then it should generate exactly the same .patch file 1134 # devtool-test-ignored manually, then it should generate exactly the same .patch file
1135 self.assertEqual(desiredlines[5:], newlines[5:]) 1135 self.assertEqual(desiredlines[5:], newlines[5:])
1136 1136
1137 def test_devtool_update_recipe_long_filename(self):
1138 # First, modify the recipe
1139 testrecipe = 'devtool-test-long-filename'
1140 bb_vars = get_bb_vars(['FILE'], testrecipe)
1141 recipefile = bb_vars['FILE']
1142 patchfilename = '0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch'
1143 patchfile = os.path.join(os.path.dirname(recipefile), testrecipe, patchfilename)
1144 newpatchfile = os.path.join(os.path.dirname(recipefile), testrecipe, patchfilename + '.expected')
1145 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1146 self.track_for_cleanup(tempdir)
1147 self.track_for_cleanup(self.workspacedir)
1148 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
1149 # (don't bother with cleaning the recipe on teardown, we won't be building it)
1150 result = runCmd('devtool modify %s' % testrecipe)
1151 self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
1152 result = runCmd('devtool finish --force-patch-refresh %s meta-selftest' % testrecipe)
1153 # Check recipe got changed as expected
1154 with open(newpatchfile, 'r') as f:
1155 desiredlines = f.readlines()
1156 with open(patchfile, 'r') as f:
1157 newlines = f.readlines()
1158 # Ignore the initial lines, because oe-selftest creates own meta-selftest repo
1159 # which changes the metadata subject which is added into the patch, but keep
1160 # .patch.expected as it is in case someone runs devtool finish --force-patch-refresh
1161 # devtool-test-ignored manually, then it should generate exactly the same .patch file
1162 self.assertEqual(desiredlines[5:], newlines[5:])
1163
1137 def test_devtool_update_recipe_local_files_3(self): 1164 def test_devtool_update_recipe_local_files_3(self):
1138 # First, modify the recipe 1165 # First, modify the recipe
1139 testrecipe = 'devtool-test-localonly' 1166 testrecipe = 'devtool-test-localonly'