summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2016-03-04 12:55:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-09 16:58:12 +0000
commitf8a9774f79f8309d9e225987203aa11baacb7648 (patch)
tree9c7056c83f9c89d81588f86bdc0388c77ac3ff37 /meta/lib/oeqa/selftest
parent656aeff16aa1c062d28d71ad00309a1bfc299779 (diff)
downloadpoky-f8a9774f79f8309d9e225987203aa11baacb7648.tar.gz
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] (From OE-Core rev: 8adaad7f3a76d527f34d2caa4b032beba7e21840) 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>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/buildoptions.py43
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 @@
1import os 1import os
2import re 2import re
3import glob as g 3import glob as g
4 4import shutil
5import tempfile
5from oeqa.selftest.base import oeSelfTest 6from oeqa.selftest.base import oeSelfTest
6from oeqa.selftest.buildhistory import BuildhistoryBase 7from oeqa.selftest.buildhistory import BuildhistoryBase
7from oeqa.utils.commands import runCmd, bitbake, get_bb_var 8from oeqa.utils.commands import runCmd, bitbake, get_bb_var
@@ -137,6 +138,46 @@ do_install_append_pn-gzip () {
137 line = self.getline(res, "QA Issue: nfs-utils") 138 line = self.getline(res, "QA Issue: nfs-utils")
138 self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) 139 self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output)
139 140
141 @testcase(1421)
142 def test_layer_git_revisions_are_displayed_and_do_not_fail_without_git_repo(self):
143 """
144 Summary: Test that layer git revisions are displayed and do not fail without git repository
145 Expected: The build to be successful and without "fatal" errors
146 Product: oe-core
147 Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
148 AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
149 """
150
151 dirpath = tempfile.mkdtemp()
152
153 dummy_layer_name = 'meta-dummy'
154 dummy_layer_path = os.path.join(dirpath, dummy_layer_name)
155 dummy_layer_conf_dir = os.path.join(dummy_layer_path, 'conf')
156 os.makedirs(dummy_layer_conf_dir)
157 dummy_layer_conf_path = os.path.join(dummy_layer_conf_dir, 'layer.conf')
158
159 dummy_layer_content = 'BBPATH .= ":${LAYERDIR}"\n' \
160 'BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"\n' \
161 'BBFILE_COLLECTIONS += "%s"\n' \
162 'BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' \
163 'BBFILE_PRIORITY_%s = "6"\n' % (dummy_layer_name, dummy_layer_name, dummy_layer_name)
164
165 ftools.write_file(dummy_layer_conf_path, dummy_layer_content)
166
167 bblayers_conf = 'BBLAYERS += "%s"\n' % dummy_layer_path
168 self.write_bblayers_config(bblayers_conf)
169
170 test_recipe = 'ed'
171
172 ret = bitbake('-n %s' % test_recipe)
173
174 err = 'fatal: Not a git repository'
175
176 shutil.rmtree(dirpath)
177
178 self.assertNotIn(err, ret.output)
179
180
140class BuildhistoryTests(BuildhistoryBase): 181class BuildhistoryTests(BuildhistoryBase):
141 182
142 @testcase(293) 183 @testcase(293)