summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-12-07 23:03:40 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:45:20 +0000
commit6ef6326b37550380a3467720c0771f718e35006b (patch)
tree6a16a91206bc9800b67349b2d2f30e4bbe509780 /meta/lib
parent26e6edfb7bc5b7da2e8c6b3ef130cc432a614ad9 (diff)
downloadpoky-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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py16
1 files changed, 10 insertions, 6 deletions
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)