]> git.sur5r.net Git - u-boot/commitdiff
test/py: Setup variables based on HUSH selection
authorStephen Warren <swarren@nvidia.com>
Fri, 10 Nov 2017 10:59:15 +0000 (11:59 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 18 Dec 2017 08:32:07 +0000 (09:32 +0100)
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>
test/py/tests/test_env.py

index b7f960c755fe1d3ab581960f3156371be0cc97b8..f8694017b42a091c4c94bfed9713bfe28405d881 100644 (file)
@@ -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):