summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-11 14:13:36 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-11 12:33:03 +0000
commite64ce73b7e05bfb317cb673306f5dd1b9b7b716d (patch)
tree7b3e0f1e867d5b5e3bb4349e1af250eec8243194 /meta/lib/oeqa/selftest
parenta5095d146d124478cda34bb3fd734210223511a2 (diff)
downloadpoky-e64ce73b7e05bfb317cb673306f5dd1b9b7b716d.tar.gz
oe-selftest: devtool: add another devtool add test
Add a test so we validate the following recently implemented/fixed aspects of "devtool add": * Adding from a local directory with no name specified * Auto-detecting the name and version from autoconf files * Setting SRC_URI and S from the local git repo * Showing the recipe file path in "devtool status" if it has been created within the workspace Incidentally also tests: * LICENSE and LIC_FILES_CHKSUM detection (though just for this piece of software) * Extracting a dependency from autoconf (though just for this narrow case since there's only one) (From OE-Core rev: d991fe7f17861dc5c21f7eac30d8c912b4d5dbed) Signed-off-by: Paul Eggleton <paul.eggleton@linux.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.py37
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...