summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2017-11-10 11:59:15 +0100
committerMichal Simek <michal.simek@xilinx.com>2017-12-18 09:32:07 +0100
commit3e229a83bd4190f99731992d3a56983f29313899 (patch)
tree2aec7c183d81b8814045625056ceabaf86bb9bca /test
parentec60a279ec6138d9d9f8e73b12625e0052ec4793 (diff)
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. Reported-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_env.py11
1 files changed, 10 insertions, 1 deletions
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):