diff options
author | Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 2016-03-04 12:55:33 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 16:54:36 +0000 |
commit | 8adaad7f3a76d527f34d2caa4b032beba7e21840 (patch) | |
tree | d48e794f429846fc411e1b9ae531cde19526a0c4 | |
parent | 398728a78ddb6cbf770045e2684d910a0ba0fc90 (diff) | |
download | openembedded-core-8adaad7f3a76d527f34d2caa4b032beba7e21840.tar.gz openembedded-core-8adaad7f3a76d527f34d2caa4b032beba7e21840.tar.bz2 openembedded-core-8adaad7f3a76d527f34d2caa4b032beba7e21840.zip |
oeqa/selftest/buildoptions: Test build does not fail without git rev
Test that layer git revisions are displayed and
do not fail without git repository.
fix for [YOCTO #8852]
Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 6f322c5ba7..1a427f1625 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -1,7 +1,8 @@ import os import re import glob as g - +import shutil +import tempfile from oeqa.selftest.base import oeSelfTest from oeqa.selftest.buildhistory import BuildhistoryBase from oeqa.utils.commands import runCmd, bitbake, get_bb_var @@ -137,6 +138,46 @@ do_install_append_pn-gzip () { line = self.getline(res, "QA Issue: nfs-utils") self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) + @testcase(1421) + def test_layer_git_revisions_are_displayed_and_do_not_fail_without_git_repo(self): + """ + Summary: Test that layer git revisions are displayed and do not fail without git repository + Expected: The build to be successful and without "fatal" errors + Product: oe-core + Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> + """ + + dirpath = tempfile.mkdtemp() + + dummy_layer_name = 'meta-dummy' + dummy_layer_path = os.path.join(dirpath, dummy_layer_name) + dummy_layer_conf_dir = os.path.join(dummy_layer_path, 'conf') + os.makedirs(dummy_layer_conf_dir) + dummy_layer_conf_path = os.path.join(dummy_layer_conf_dir, 'layer.conf') + + dummy_layer_content = 'BBPATH .= ":${LAYERDIR}"\n' \ + 'BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"\n' \ + 'BBFILE_COLLECTIONS += "%s"\n' \ + 'BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' \ + 'BBFILE_PRIORITY_%s = "6"\n' % (dummy_layer_name, dummy_layer_name, dummy_layer_name) + + ftools.write_file(dummy_layer_conf_path, dummy_layer_content) + + bblayers_conf = 'BBLAYERS += "%s"\n' % dummy_layer_path + self.write_bblayers_config(bblayers_conf) + + test_recipe = 'ed' + + ret = bitbake('-n %s' % test_recipe) + + err = 'fatal: Not a git repository' + + shutil.rmtree(dirpath) + + self.assertNotIn(err, ret.output) + + class BuildhistoryTests(BuildhistoryBase): @testcase(293) |