From 8820f8d05bbaf1713c4f5904e2a8326e19fd711b Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 10 Nov 2017 11:59:15 +0100 Subject: [PATCH] UPSTREAM: test/py: Setup variables based on HUSH selection After adding our small zynq uboot which has hush parser off same variable tests start to failed. Use quotes only when hush is enabled. Change-Id: I9aee385346129dee480aa04aa68f420aa172aaa7 Reported-by: Michal Simek Signed-off-by: Stephen Warren Signed-off-by: Kever Yang (cherry picked from commit 3e229a83bd4190f99731992d3a56983f29313899) --- test/py/tests/test_env.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py index b7f960c755..f8694017b4 100644 --- a/test/py/tests/test_env.py +++ b/test/py/tests/test_env.py @@ -125,7 +125,16 @@ def set_var(state_test_env, var, value): Nothing. """ - state_test_env.u_boot_console.run_command('setenv %s "%s"' % (var, value)) + bc = state_test_env.u_boot_console.config.buildconfig + if bc.get('config_hush_parser', None): + quote = '"' + else: + quote = '' + if ' ' in value: + pytest.skip('Space in variable value on non-Hush shell') + + state_test_env.u_boot_console.run_command( + 'setenv %s %s%s%s' % (var, quote, value, quote)) state_test_env.env[var] = value def validate_empty(state_test_env, var):