summaryrefslogtreecommitdiffstats
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-08 00:01:18 +0100
commit9f91aa697fb2cf5314aa4a99b2abbf0229cb1ea2 (patch)
treec571107b5f9b162d64448a2627f7c129d933dd06
parentcd379328b9ee211d87d65490af6d6f79b77ed80a (diff)
downloadpoky-9f91aa697fb2cf5314aa4a99b2abbf0229cb1ea2.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 (From OE-Core rev: 477ed5931f40dd504a2ae3e184c09153f4fa9735) 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/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):
27 self.builddir = os.environ.get("BUILDDIR") 27 self.builddir = os.environ.get("BUILDDIR")
28 self.localconf_path = os.path.join(self.builddir, "conf/local.conf") 28 self.localconf_path = os.path.join(self.builddir, "conf/local.conf")
29 self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc") 29 self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
30 self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
31 self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
30 self.testlayer_path = oeSelfTest.testlayer_path 32 self.testlayer_path = oeSelfTest.testlayer_path
31 self._extra_tear_down_commands = [] 33 self._extra_tear_down_commands = []
32 self._track_for_cleanup = [] 34 self._track_for_cleanup = []
@@ -45,6 +47,11 @@ class oeSelfTest(unittest.TestCase):
45 for f in files: 47 for f in files:
46 if f == 'test_recipe.inc': 48 if f == 'test_recipe.inc':
47 os.remove(os.path.join(root, f)) 49 os.remove(os.path.join(root, f))
50 try:
51 os.remove(self.testinc_bblayers_path)
52 except OSError as e:
53 if e.errno != errno.ENOENT:
54 raise
48 # tests might need their own setup 55 # tests might need their own setup
49 # but if they overwrite this one they have to call 56 # but if they overwrite this one they have to call
50 # super each time, so let's give them an alternative 57 # super each time, so let's give them an alternative
@@ -129,3 +136,18 @@ class oeSelfTest(unittest.TestCase):
129 except OSError as e: 136 except OSError as e:
130 if e.errno != errno.ENOENT: 137 if e.errno != errno.ENOENT:
131 raise 138 raise
139
140 # write to <builddir>/conf/bblayers.inc
141 def write_bblayers_config(self, data):
142 self.log.debug("Writing to: %s\n%s\n" % (self.testinc_bblayers_path, data))
143 ftools.write_file(self.testinc_bblayers_path, data)
144
145 # append to <builddir>/conf/bblayers.inc
146 def append_bblayers_config(self, data):
147 self.log.debug("Appending to: %s\n%s\n" % (self.testinc_bblayers_path, data))
148 ftools.append_file(self.testinc_bblayers_path, data)
149
150 # remove data from <builddir>/conf/bblayers.inc
151 def remove_bblayers_config(self, data):
152 self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
153 ftools.remove_from_file(self.testinc_bblayers_path, data)