diff options
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 36 |
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. |