summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/bbtests.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-10-19 15:58:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:56:07 +0100
commit2d008033c540f07c12e025c342f7474e09e1c615 (patch)
tree03b1aaf0882723233b3b206dd77c3b6975040a55 /meta/lib/oeqa/selftest/bbtests.py
parent1881564cdd8f52c2d7ee46e4c2d38272c4d9820c (diff)
downloadpoky-2d008033c540f07c12e025c342f7474e09e1c615.tar.gz
oeqa/selftest: improve config writing and cleanup
The selftest.inc configuration file is deleted in both tearDown() and setUp() so there's no need to use addCleanup() to remove statements from it. Use write_config instead of append_config if the intention is to start from an empty config file, for clarity. Finally remove some misleading comments that claim that append_config() writes to local.conf when it doesn't. (From OE-Core rev: ad33259b507914bfc8de92d1df12e0974157900e) 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/bbtests.py')
-rw-r--r--meta/lib/oeqa/selftest/bbtests.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py
index 1c0e588c04..94ca79c031 100644
--- a/meta/lib/oeqa/selftest/bbtests.py
+++ b/meta/lib/oeqa/selftest/bbtests.py
@@ -156,8 +156,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
156 156
157 @testcase(1028) 157 @testcase(1028)
158 def test_environment(self): 158 def test_environment(self):
159 self.append_config("TEST_ENV=\"localconf\"") 159 self.write_config("TEST_ENV=\"localconf\"")
160 self.addCleanup(self.remove_config, "TEST_ENV=\"localconf\"")
161 result = runCmd('bitbake -e | grep TEST_ENV=') 160 result = runCmd('bitbake -e | grep TEST_ENV=')
162 self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='") 161 self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='")
163 162
@@ -184,8 +183,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
184 ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") 183 ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"")
185 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') 184 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
186 self.assertTrue('prefile' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration. ") 185 self.assertTrue('prefile' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration. ")
187 self.append_config("TEST_PREFILE=\"localconf\"") 186 self.write_config("TEST_PREFILE=\"localconf\"")
188 self.addCleanup(self.remove_config, "TEST_PREFILE=\"localconf\"")
189 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') 187 result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
190 self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.") 188 self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.")
191 189
@@ -194,8 +192,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
194 postconf = os.path.join(self.builddir, 'conf/postfile.conf') 192 postconf = os.path.join(self.builddir, 'conf/postfile.conf')
195 self.track_for_cleanup(postconf) 193 self.track_for_cleanup(postconf)
196 ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") 194 ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"")
197 self.append_config("TEST_POSTFILE=\"localconf\"") 195 self.write_config("TEST_POSTFILE=\"localconf\"")
198 self.addCleanup(self.remove_config, "TEST_POSTFILE=\"localconf\"")
199 result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') 196 result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=')
200 self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.") 197 self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.")
201 198