summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py')
-rw-r--r--test/py/conftest.py39
-rw-r--r--test/py/tests/test_env.py2
-rw-r--r--test/py/tests/test_handoff.py2
3 files changed, 29 insertions, 14 deletions
diff --git a/test/py/conftest.py b/test/py/conftest.py
index bffee6b8a3a..472dd0545d3 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -83,6 +83,26 @@ def pytest_configure(config):
Returns:
Nothing.
"""
+ def parse_config(conf_file):
+ """Parse a config file, loading it into the ubconfig container
+
+ Args:
+ conf_file: Filename to load (within build_dir)
+
+ Raises
+ Exception if the file does not exist
+ """
+ dot_config = build_dir + '/' + conf_file
+ if not os.path.exists(dot_config):
+ raise Exception(conf_file + ' does not exist; ' +
+ 'try passing --build option?')
+
+ with open(dot_config, 'rt') as f:
+ ini_str = '[root]\n' + f.read()
+ ini_sio = io.StringIO(ini_str)
+ parser = configparser.RawConfigParser()
+ parser.read_file(ini_sio)
+ ubconfig.buildconfig.update(parser.items('root'))
global log
global console
@@ -157,18 +177,13 @@ def pytest_configure(config):
ubconfig.buildconfig = dict()
- for conf_file in ('.config', 'include/autoconf.mk'):
- dot_config = build_dir + '/' + conf_file
- if not os.path.exists(dot_config):
- raise Exception(conf_file + ' does not exist; ' +
- 'try passing --build option?')
-
- with open(dot_config, 'rt') as f:
- ini_str = '[root]\n' + f.read()
- ini_sio = io.StringIO(ini_str)
- parser = configparser.RawConfigParser()
- parser.read_file(ini_sio)
- ubconfig.buildconfig.update(parser.items('root'))
+ # buildman -k puts autoconf.mk in the rootdir, so handle this as well
+ # as the standard U-Boot build which leaves it in include/autoconf.mk
+ parse_config('.config')
+ if os.path.exists(build_dir + '/' + 'autoconf.mk'):
+ parse_config('autoconf.mk')
+ else:
+ parse_config('include/autoconf.mk')
ubconfig.test_py_dir = test_py_dir
ubconfig.source_dir = source_dir
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 9bdaef9373f..6ff38f1020b 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -49,7 +49,7 @@ class StateTestEnv(object):
for l in response.splitlines():
if not '=' in l:
continue
- (var, value) = l.strip().split('=', 1)
+ (var, value) = l.split('=', 1)
self.env[var] = value
def get_existent_var(self):
diff --git a/test/py/tests/test_handoff.py b/test/py/tests/test_handoff.py
index 0ee972298ca..038f03064a6 100644
--- a/test/py/tests/test_handoff.py
+++ b/test/py/tests/test_handoff.py
@@ -6,7 +6,7 @@ import pytest
# Magic number to check that SPL handoff is working
TEST_HANDOFF_MAGIC = 0x14f93c7b
-@pytest.mark.boardspec('sandbox')
+@pytest.mark.boardspec('sandbox_spl')
@pytest.mark.buildconfigspec('spl')
def test_handoff(u_boot_console):
"""Test that of-platdata can be generated and used in sandbox"""