summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-24 17:30:17 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-28 11:33:01 +0000
commitbf4d380b978c253f3244dbacbee7d2dd8f381599 (patch)
tree9721c077aa72b27f6336e809c3789d3614e172bd /meta/lib/oeqa/selftest
parent4bae2f25b8a55c80c3ca48b63d093c5a7594c636 (diff)
downloadpoky-bf4d380b978c253f3244dbacbee7d2dd8f381599.tar.gz
oe-selftest: devtool: add an additional test for devtool upgrade
Add a test for devtool upgrade with a recipe pointing to a git repository, since this uses several different code paths. (From OE-Core rev: d3ec74ff4db248ea11a568d5214708d6a1757012) 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/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 4d280bb4af..d41af2fb26 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1136,6 +1136,42 @@ class DevtoolTests(DevtoolBase):
1136 self.assertNotIn(recipe, result.output) 1136 self.assertNotIn(recipe, result.output)
1137 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting') 1137 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
1138 1138
1139 def test_devtool_upgrade_git(self):
1140 # Check preconditions
1141 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
1142 self.track_for_cleanup(self.workspacedir)
1143 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
1144 recipe = 'devtool-upgrade-test2'
1145 commit = '6cc6077a36fe2648a5f993fe7c16c9632f946517'
1146 oldrecipefile = get_bb_var('FILE', recipe)
1147 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1148 self.track_for_cleanup(tempdir)
1149 # Check that recipe is not already under devtool control
1150 result = runCmd('devtool status')
1151 self.assertNotIn(recipe, result.output)
1152 # Check upgrade
1153 result = runCmd('devtool upgrade %s %s -S %s' % (recipe, tempdir, commit))
1154 # Check if srctree at least is populated
1155 self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, commit))
1156 # Check new recipe file is present
1157 newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldrecipefile))
1158 self.assertTrue(os.path.exists(newrecipefile), 'Recipe file should exist after upgrade')
1159 # Check devtool status and make sure recipe is present
1160 result = runCmd('devtool status')
1161 self.assertIn(recipe, result.output)
1162 self.assertIn(tempdir, result.output)
1163 # Check recipe got changed as expected
1164 with open(oldrecipefile + '.upgraded', 'r') as f:
1165 desiredlines = f.readlines()
1166 with open(newrecipefile, 'r') as f:
1167 newlines = f.readlines()
1168 self.assertEqual(desiredlines, newlines)
1169 # Check devtool reset recipe
1170 result = runCmd('devtool reset %s -n' % recipe)
1171 result = runCmd('devtool status')
1172 self.assertNotIn(recipe, result.output)
1173 self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
1174
1139 @testcase(1352) 1175 @testcase(1352)
1140 def test_devtool_layer_plugins(self): 1176 def test_devtool_layer_plugins(self):
1141 """Test that devtool can use plugins from other layers. 1177 """Test that devtool can use plugins from other layers.