diff options
5 files changed, 59 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb b/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb new file mode 100644 index 0000000000..3ec22cae7f --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | LICENSE = "CLOSED" | ||
2 | INHIBIT_DEFAULT_DEPS = "1" | ||
3 | |||
4 | SRC_URI = "file://${BPN}.tar.gz \ | ||
5 | file://0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch" | ||
6 | |||
7 | S = "${WORKDIR}/${BPN}" | ||
8 | |||
9 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch new file mode 100644 index 0000000000..6aaf409ebc --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch | |||
@@ -0,0 +1,7 @@ | |||
1 | diff --git a/patch-me b/patch-me | ||
2 | index a20b29a..5e35d1b 100644 | ||
3 | --- a/patch-me | ||
4 | +++ b/patch-me | ||
5 | @@ -1 +1 @@ | ||
6 | -please | ||
7 | +NO | ||
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected new file mode 100644 index 0000000000..1bf25a61d0 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected | |||
@@ -0,0 +1,16 @@ | |||
1 | From 45ba3d107ea60777a6b6e134fd00fe5009749177 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
3 | Date: Thu, 28 May 2020 02:03:39 +0200 | ||
4 | Subject: [PATCH] meta-selftest: add test for .patch file with long filename | ||
5 | |||
6 | --- | ||
7 | patch-me | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/patch-me b/patch-me | ||
11 | index a20b29a..5e35d1b 100644 | ||
12 | --- a/patch-me | ||
13 | +++ b/patch-me | ||
14 | @@ -1 +1 @@ | ||
15 | -please | ||
16 | +NO | ||
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz new file mode 100644 index 0000000000..ab6242aae7 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz | |||
Binary files differ | |||
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' |