[oe-commits] [openembedded-core] 59/69: oeqa/selftest/buildoptions: Test build does not fail without git rev
git at git.openembedded.org
git at git.openembedded.org
Mon Mar 7 22:12:49 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 79420f87b78f72a8e327fec089329e6a6b3751b8
Author: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
AuthorDate: Fri Mar 4 12:55:33 2016 +0200
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 at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/selftest/buildoptions.py | 43 +++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index 6f322c5..1a427f1 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 at intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate at 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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list