diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-11-08 10:29:25 +1300 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-11-10 14:41:58 +1300 |
commit | 367fa9e71b216f28106720672560f6a63b95907c (patch) | |
tree | 23ade976d643bc6969b363f44a28259b3d71ec43 | |
parent | 1f4d71e6296c711d38615319be632edcb3fbfcf5 (diff) | |
download | openembedded-core-contrib-paule/devtool23-oe.tar.gz |
oe-selftest: devtool: test that updating a file with subdir= workspaule/devtool23-oe
If you have a file:// entry in SRC_URI with a subdir= parameter that
makes it extract into the source tree, then when you update that file in
oe-local-files and run devtool update-recipe then you want the original
file to be updated. This was made to work by OE-Core commit
9069fef5dad5a873c8a8f720f7bcbc7625556309 together with
31f1bbad248c36a8c86dde4ff57ce42efc664082, however until now there was no
oe-selftest test to verify it.
Note that in order to succeed this test also requires the fix
"lib/oe/recipeutils: ignore archives by default in
get_recipe_local_files()" since the test recipe uses a local tarball.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r-- | meta-selftest/recipes-test/devtool/devtool-test-subdir.bb | 7 | ||||
-rw-r--r-- | meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz | bin | 0 -> 181 bytes | |||
-rw-r--r-- | meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile | 1 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 25 |
4 files changed, 33 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb new file mode 100644 index 0000000000..1a163f8a4a --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb @@ -0,0 +1,7 @@ +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://devtool-test-subdir.tar.gz \ + file://testfile;subdir=${BPN}" + +S = "${WORKDIR}/${BPN}" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz Binary files differnew file mode 100644 index 0000000000..3d44f803cb --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile new file mode 100644 index 0000000000..12b519c0d6 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile @@ -0,0 +1 @@ +Modified version diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 92dc5e5869..2a08721336 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py @@ -972,6 +972,31 @@ class DevtoolTests(DevtoolBase): if 'gzip compressed data' not in result.output: self.fail('New patch file is not gzipped - file reports:\n%s' % result.output) + def test_devtool_update_recipe_local_files_subdir(self): + # Try devtool extract on a recipe that has a file with subdir= set in + # SRC_URI such that it overwrites a file that was in an archive that + # was also in SRC_URI + # First, modify the recipe + testrecipe = 'devtool-test-subdir' + recipefile = get_bb_var('FILE', testrecipe) + src_uri = get_bb_var('SRC_URI', testrecipe) + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + # (don't bother with cleaning the recipe on teardown, we won't be building it) + result = runCmd('devtool modify %s' % testrecipe) + testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile') + self.assertTrue(os.path.exists(testfile), 'Extracted source could not be found') + with open(testfile, 'r') as f: + contents = f.read().rstrip() + self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been') + # Test devtool update-recipe without modifying any files + self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) + result = runCmd('devtool update-recipe %s' % testrecipe) + expected_status = [] + self._check_repo_status(os.path.dirname(recipefile), expected_status) + @testcase(1163) def test_devtool_extract(self): tempdir = tempfile.mkdtemp(prefix='devtoolqa') |