[PATCH 02/20] oeqa.selftest._sstatetests_noauto: Split configuration from code

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

meta/lib/oeqa/selftest/_sstatetests_noauto.py | 9 +++++++--
meta/lib/oeqa/selftest/conf/_sstatetests_noauto.conf | 3 +++
2 files changed, 10 insertions(+), 2 deletions(-)
create mode 100644 meta/lib/oeqa/selftest/conf/_sstatetests_noauto.conf

diff --git a/meta/lib/oeqa/selftest/_sstatetests_noauto.py b/meta/lib/oeqa/selftest/_sstatetests_noauto.py
index fc9ae7e..f35811e 100644
--- a/meta/lib/oeqa/selftest/_sstatetests_noauto.py
+++ b/meta/lib/oeqa/selftest/_sstatetests_noauto.py
@@ -8,6 +8,7 @@ import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.selftest.sstate import SStateBase
+from oeqa.utils.readconfig import conffile

class RebuildFromSState(SStateBase):
@@ -15,6 +16,8 @@ class RebuildFromSState(SStateBase):
@classmethod
def setUpClass(self):
self.builddir = os.path.join(os.environ.get('BUILDDIR'))
+ # Get test configurations from configuration file
+ self.config = conffile(__file__)

def get_dep_targets(self, primary_targets):
found_targets = []
@@ -89,7 +92,9 @@ class RebuildFromSState(SStateBase):
self.assertFalse(failed_cleansstate, msg="The following recipes have failed cleansstate(all others have passed both cleansstate and rebuild from sstate tests): %s" % ' '.join(map(str, failed_cleansstate)))

def test_sstate_relocation(self):
- self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=True, rebuild_dependencies=True)
+ image = self.config.get('RebuildFromSState', 'sstate_relocation_image')
+ self.run_test_sstate_rebuild([image], relocate=True, rebuild_dependencies=True)

def test_sstate_rebuild(self):
- self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=False, rebuild_dependencies=True)
+ image = self.config.get('RebuildFromSState', 'sstate_rebuild_image')
+ self.run_test_sstate_rebuild([image], relocate=False, rebuild_dependencies=True)
diff --git a/meta/lib/oeqa/selftest/conf/_sstatetests_noauto.conf b/meta/lib/oeqa/selftest/conf/_sstatetests_noauto.conf
new file mode 100644
index 0000000..41854a0
--- /dev/null
+++ b/meta/lib/oeqa/selftest/conf/_sstatetests_noauto.conf
@@ -0,0 +1,3 @@
+[RebuildFromSState]
+sstate_relocation_image = core-image-sato-sdk
+sstate_rebuild_image = core-image-sato-sdk
--
1.8.3.1