diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 345cabbda9..e5a2134132 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
| @@ -201,6 +201,43 @@ class DevtoolTests(DevtoolBase): | |||
| 201 | bindir = bindir[1:] | 201 | bindir = bindir[1:] |
| 202 | self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D') | 202 | self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D') |
| 203 | 203 | ||
| 204 | def test_devtool_add_git_local(self): | ||
| 205 | # Fetch source from a remote URL, but do it outside of devtool | ||
| 206 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 207 | self.track_for_cleanup(tempdir) | ||
| 208 | pn = 'dbus-wait' | ||
| 209 | # We choose an https:// git URL here to check rewriting the URL works | ||
| 210 | url = 'https://git.yoctoproject.org/git/dbus-wait' | ||
| 211 | # Force fetching to "noname" subdir so we verify we're picking up the name from autoconf | ||
| 212 | # instead of the directory name | ||
| 213 | result = runCmd('git clone %s noname' % url, cwd=tempdir) | ||
| 214 | srcdir = os.path.join(tempdir, 'noname') | ||
| 215 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure script in source directory') | ||
| 216 | # Test devtool add | ||
| 217 | self.track_for_cleanup(self.workspacedir) | ||
| 218 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
| 219 | # Don't specify a name since we should be able to auto-detect it | ||
| 220 | result = runCmd('devtool add %s' % srcdir) | ||
| 221 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | ||
| 222 | # Check the recipe name is correct | ||
| 223 | recipefile = get_bb_var('FILE', pn) | ||
| 224 | self.assertIn('%s_git.bb' % pn, recipefile, 'Recipe file incorrectly named') | ||
| 225 | self.assertIn(recipefile, result.output) | ||
| 226 | # Test devtool status | ||
| 227 | result = runCmd('devtool status') | ||
| 228 | self.assertIn(pn, result.output) | ||
| 229 | self.assertIn(srcdir, result.output) | ||
| 230 | self.assertIn(recipefile, result.output) | ||
| 231 | checkvars = {} | ||
| 232 | checkvars['LICENSE'] = 'GPLv2' | ||
| 233 | checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263' | ||
| 234 | checkvars['S'] = '${WORKDIR}/git' | ||
| 235 | checkvars['PV'] = '0.1+git${SRCPV}' | ||
| 236 | checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https' | ||
| 237 | checkvars['SRCREV'] = '${AUTOREV}' | ||
| 238 | checkvars['DEPENDS'] = set(['dbus']) | ||
| 239 | self._test_recipe_contents(recipefile, checkvars, []) | ||
| 240 | |||
| 204 | @testcase(1162) | 241 | @testcase(1162) |
| 205 | def test_devtool_add_library(self): | 242 | def test_devtool_add_library(self): |
| 206 | # We don't have the ability to pick up this dependency automatically yet... | 243 | # We don't have the ability to pick up this dependency automatically yet... |
