aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-06-29 11:59:41 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-07 23:56:22 +0100
commit477ed5931f40dd504a2ae3e184c09153f4fa9735 (patch)
tree4ffa63c03f8bbd48c3b967f6e9ee59d5dd86ca9e
parent8b20eaf7cbadd0cd87cfa192d60ca1b7da435216 (diff)
downloadopenembedded-core-contrib-477ed5931f40dd504a2ae3e184c09153f4fa9735.tar.gz
oeqa/selftest: Add methods to manipulate bblayers.conf in base.py
Added methods for manipulating bblayers.conf file in the same manner as local.conf file: - write_bblayers_config - append_bblayers_config - remove_bblayers_config Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/lib/oeqa/selftest/base.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py
index 80b9b4b312..b2faa661e5 100644
--- a/meta/lib/oeqa/selftest/base.py
+++ b/meta/lib/oeqa/selftest/base.py
@@ -27,6 +27,8 @@ class oeSelfTest(unittest.TestCase):
self.builddir = os.environ.get("BUILDDIR")
self.localconf_path = os.path.join(self.builddir, "conf/local.conf")
self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
+ self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
+ self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
self.testlayer_path = oeSelfTest.testlayer_path
self._extra_tear_down_commands = []
self._track_for_cleanup = []
@@ -45,6 +47,11 @@ class oeSelfTest(unittest.TestCase):
for f in files:
if f == 'test_recipe.inc':
os.remove(os.path.join(root, f))
+ try:
+ os.remove(self.testinc_bblayers_path)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
# tests might need their own setup
# but if they overwrite this one they have to call
# super each time, so let's give them an alternative
@@ -129,3 +136,18 @@ class oeSelfTest(unittest.TestCase):
except OSError as e:
if e.errno != errno.ENOENT:
raise
+
+ # write to <builddir>/conf/bblayers.inc
+ def write_bblayers_config(self, data):
+ self.log.debug("Writing to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.write_file(self.testinc_bblayers_path, data)
+
+ # append to <builddir>/conf/bblayers.inc
+ def append_bblayers_config(self, data):
+ self.log.debug("Appending to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.append_file(self.testinc_bblayers_path, data)
+
+ # remove data from <builddir>/conf/bblayers.inc
+ def remove_bblayers_config(self, data):
+ self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
+ ftools.remove_from_file(self.testinc_bblayers_path, data)