From fc1a3bfedf7d6cca27a8460b419482b8b0959e27 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 18 Dec 2019 11:37:21 -0700 Subject: test_env: don't strip() printenv results get_env() was originally written to strip() the output of printenv to isolate the test from any whitespace changes in printenv's output. However, this throws away any whitespace in the variable value, which can cause issues when test code expects to see that whitespace. In fact, printenv never adds any whitespace at all, so there's no need to strip. The strip causes a practical problem for test_env_echo_exists() if state_test_env.get_existent_var() happens to choose a U-Boot variable that contains trailing whitespace. This is true for variable boot_targets. With Python 2, get_existent_var() never returned boot_targets so this issue never caused a practical problem. With Python 3, get_existent_var does sometimes return boot_targets, no doubt due to Python 3's different dict hash key order implementation, about 0.5-2% of the time, so this test appears intermittent. With the strip removed, this intermittency is solved, since the test passes for all possible U-Boot variables. Signed-off-by: Stephen Warren --- test/py/tests/test_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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): -- cgit v1.2.3 From 1785bf54af07152421ab83794ecf420c111597e4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 27 Dec 2019 07:46:30 -0700 Subject: test: Fix the boardspec for the SPL handoff test This test currently does not run because it specifies the sandbox board instead of sandbox_spl. Fix it. Signed-off-by: Simon Glass --- test/py/tests/test_handoff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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""" -- cgit v1.2.3