[PATCH 05/20] oeqa.selftest.buildhistory: Split configuration from code

Jose Lamego
2016-08-08T16:23:20Z

meta/lib/oeqa/selftest/buildhistory.py | 10 +++++++++-
meta/lib/oeqa/selftest/conf/buildhistory.conf | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 meta/lib/oeqa/selftest/conf/buildhistory.conf

diff --git a/meta/lib/oeqa/selftest/buildhistory.py b/meta/lib/oeqa/selftest/buildhistory.py
index 674da62..9553788 100644
--- a/meta/lib/oeqa/selftest/buildhistory.py
+++ b/meta/lib/oeqa/selftest/buildhistory.py
@@ -5,13 +5,21 @@ import datetime
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import bitbake, get_bb_var
from oeqa.utils.decorators import testcase
+from oeqa.utils.readconfig import conffile

class BuildhistoryBase(oeSelfTest):

+ @classmethod
+ def setUpClass(cls):
+ # Get test configurations from configuration file
+ cls.config = conffile(__file__)
+
def config_buildhistory(self, tmp_bh_location=False):
if (not 'buildhistory' in get_bb_var('USER_CLASSES')) and (not 'buildhistory' in get_bb_var('INHERIT')):
- add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"'
+ add_buildhistory_config = self.config.get(
+ 'buildhistory',
+ 'config_buildhistory_features')
self.append_config(add_buildhistory_config)

if tmp_bh_location:
diff --git a/meta/lib/oeqa/selftest/conf/buildhistory.conf b/meta/lib/oeqa/selftest/conf/buildhistory.conf
new file mode 100644
index 0000000..e81c701
--- /dev/null
+++ b/meta/lib/oeqa/selftest/conf/buildhistory.conf
@@ -0,0 +1,3 @@
+[buildhistory]
+config_buildhistory_features = INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "1"
--
1.8.3.1