diff options
3 files changed, 71 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb new file mode 100644 index 0000000000..9bfce0afee --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "A simple tool to wait for a specific signal over DBus" | ||
2 | HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait" | ||
3 | SECTION = "base" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
6 | |||
7 | DEPENDS = "dbus" | ||
8 | |||
9 | # Note: this is intentionally not the latest version in the original .bb | ||
10 | SRCREV = "1a3e1343761b30750bed70e0fd688f6d3c7b3717" | ||
11 | PV = "0.1+git${SRCPV}" | ||
12 | PR = "r2" | ||
13 | |||
14 | SRC_URI = "git://git.yoctoproject.org/dbus-wait" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | inherit autotools pkgconfig | ||
diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded new file mode 100644 index 0000000000..9b947ed9ea --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "A simple tool to wait for a specific signal over DBus" | ||
2 | HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait" | ||
3 | SECTION = "base" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
6 | |||
7 | DEPENDS = "dbus" | ||
8 | |||
9 | # Note: this is intentionally not the latest version in the original .bb | ||
10 | SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517" | ||
11 | PV = "0.1+git${SRCPV}" | ||
12 | |||
13 | SRC_URI = "git://git.yoctoproject.org/dbus-wait" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | inherit autotools pkgconfig | ||
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. |