diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-12-07 23:03:40 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-10 22:45:20 +0000 |
commit | 6ef6326b37550380a3467720c0771f718e35006b (patch) | |
tree | 6a16a91206bc9800b67349b2d2f30e4bbe509780 | |
parent | 26e6edfb7bc5b7da2e8c6b3ef130cc432a614ad9 (diff) | |
download | poky-6ef6326b37550380a3467720c0771f718e35006b.tar.gz |
oe-selftest: devtool: fix test for changes in lzo recipe
acinclude.m4 is about to be removed from the lzo recipe which breaks
test_devtool_update_recipe_local_files_2. Create a synthetic recipe in
meta-selftest with some local files and use that instead.
(From OE-Core rev: ed27470fa6a9f3cc1a0eb884474fe7985babde7a)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 files changed, 27 insertions, 6 deletions
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file1 b/meta-selftest/recipes-test/devtool/devtool-test-local/file1 new file mode 100644 index 0000000000..f4bdcfc831 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file1 | |||
@@ -0,0 +1 @@ | |||
The first file | |||
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file2 b/meta-selftest/recipes-test/devtool/devtool-test-local/file2 new file mode 100644 index 0000000000..a7e2414bd5 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file2 | |||
@@ -0,0 +1 @@ | |||
The second file | |||
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb new file mode 100644 index 0000000000..6bfc557060 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | LICENSE = "GPLv2+" | ||
2 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
3 | |||
4 | INHIBIT_DEFAULT_DEPS = "1" | ||
5 | |||
6 | SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.xz \ | ||
7 | file://file1 \ | ||
8 | file://file2" | ||
9 | |||
10 | SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13" | ||
11 | SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e" | ||
12 | |||
13 | S = "${WORKDIR}/syslinux-${PV}" | ||
14 | |||
15 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 43280cdc0e..8a1e6858d3 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -987,8 +987,12 @@ class DevtoolTests(DevtoolBase): | |||
987 | @OETestID(1371) | 987 | @OETestID(1371) |
988 | def test_devtool_update_recipe_local_files_2(self): | 988 | def test_devtool_update_recipe_local_files_2(self): |
989 | """Check local source files support when oe-local-files is in Git""" | 989 | """Check local source files support when oe-local-files is in Git""" |
990 | testrecipe = 'lzo' | 990 | testrecipe = 'devtool-test-local' |
991 | recipefile = get_bb_var('FILE', testrecipe) | 991 | recipefile = get_bb_var('FILE', testrecipe) |
992 | recipedir = os.path.dirname(recipefile) | ||
993 | result = runCmd('git status --porcelain .', cwd=recipedir) | ||
994 | if result.output.strip(): | ||
995 | self.fail('Recipe directory for %s contains uncommitted changes' % testrecipe) | ||
992 | # Setup srctree for modifying the recipe | 996 | # Setup srctree for modifying the recipe |
993 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | 997 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') |
994 | self.track_for_cleanup(tempdir) | 998 | self.track_for_cleanup(tempdir) |
@@ -1002,9 +1006,9 @@ class DevtoolTests(DevtoolBase): | |||
1002 | runCmd('git add oe-local-files', cwd=tempdir) | 1006 | runCmd('git add oe-local-files', cwd=tempdir) |
1003 | runCmd('git commit -m "Add local sources"', cwd=tempdir) | 1007 | runCmd('git commit -m "Add local sources"', cwd=tempdir) |
1004 | # Edit / commit local sources | 1008 | # Edit / commit local sources |
1005 | runCmd('echo "# Foobar" >> oe-local-files/acinclude.m4', cwd=tempdir) | 1009 | runCmd('echo "# Foobar" >> oe-local-files/file1', cwd=tempdir) |
1006 | runCmd('git commit -am "Edit existing file"', cwd=tempdir) | 1010 | runCmd('git commit -am "Edit existing file"', cwd=tempdir) |
1007 | runCmd('git rm oe-local-files/run-ptest', cwd=tempdir) | 1011 | runCmd('git rm oe-local-files/file2', cwd=tempdir) |
1008 | runCmd('git commit -m"Remove file"', cwd=tempdir) | 1012 | runCmd('git commit -m"Remove file"', cwd=tempdir) |
1009 | runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir) | 1013 | runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir) |
1010 | runCmd('git add oe-local-files/new-local', cwd=tempdir) | 1014 | runCmd('git add oe-local-files/new-local', cwd=tempdir) |
@@ -1016,11 +1020,11 @@ class DevtoolTests(DevtoolBase): | |||
1016 | os.path.dirname(recipefile)) | 1020 | os.path.dirname(recipefile)) |
1017 | # Checkout unmodified file to working copy -> devtool should still pick | 1021 | # Checkout unmodified file to working copy -> devtool should still pick |
1018 | # the modified version from HEAD | 1022 | # the modified version from HEAD |
1019 | runCmd('git checkout HEAD^ -- oe-local-files/acinclude.m4', cwd=tempdir) | 1023 | runCmd('git checkout HEAD^ -- oe-local-files/file1', cwd=tempdir) |
1020 | runCmd('devtool update-recipe %s' % testrecipe) | 1024 | runCmd('devtool update-recipe %s' % testrecipe) |
1021 | expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), | 1025 | expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), |
1022 | (' M', '.*/acinclude.m4$'), | 1026 | (' M', '.*/file1$'), |
1023 | (' D', '.*/run-ptest$'), | 1027 | (' D', '.*/file2$'), |
1024 | ('??', '.*/new-local$'), | 1028 | ('??', '.*/new-local$'), |
1025 | ('??', '.*/0001-Add-new-file.patch$')] | 1029 | ('??', '.*/0001-Add-new-file.patch$')] |
1026 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | 1030 | self._check_repo_status(os.path.dirname(recipefile), expected_status) |