summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir.bb7
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gzbin0 -> 181 bytes
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile1
-rw-r--r--meta/lib/oeqa/selftest/devtool.py25
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 @@
1LICENSE = "CLOSED"
2INHIBIT_DEFAULT_DEPS = "1"
3
4SRC_URI = "file://devtool-test-subdir.tar.gz \
5 file://testfile;subdir=${BPN}"
6
7S = "${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
new file mode 100644
index 0000000000..3d44f803cb
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
Binary files differ
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):
972 if 'gzip compressed data' not in result.output: 972 if 'gzip compressed data' not in result.output:
973 self.fail('New patch file is not gzipped - file reports:\n%s' % result.output) 973 self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
974 974
975 def test_devtool_update_recipe_local_files_subdir(self):
976 # Try devtool extract on a recipe that has a file with subdir= set in
977 # SRC_URI such that it overwrites a file that was in an archive that
978 # was also in SRC_URI
979 # First, modify the recipe
980 testrecipe = 'devtool-test-subdir'
981 recipefile = get_bb_var('FILE', testrecipe)
982 src_uri = get_bb_var('SRC_URI', testrecipe)
983 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
984 self.track_for_cleanup(tempdir)
985 self.track_for_cleanup(self.workspacedir)
986 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
987 # (don't bother with cleaning the recipe on teardown, we won't be building it)
988 result = runCmd('devtool modify %s' % testrecipe)
989 testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile')
990 self.assertTrue(os.path.exists(testfile), 'Extracted source could not be found')
991 with open(testfile, 'r') as f:
992 contents = f.read().rstrip()
993 self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been')
994 # Test devtool update-recipe without modifying any files
995 self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
996 result = runCmd('devtool update-recipe %s' % testrecipe)
997 expected_status = []
998 self._check_repo_status(os.path.dirname(recipefile), expected_status)
999
975 @testcase(1163) 1000 @testcase(1163)
976 def test_devtool_extract(self): 1001 def test_devtool_extract(self):
977 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1002 tempdir = tempfile.mkdtemp(prefix='devtoolqa')