[U-Boot] [PATCH v2] test/py: Setup variables based on HUSH selection

From: Stephen Warren swarren@nvidia.com
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 ---
Changes in v2: - code taken from v1 review from Stephen
Stephen: it is your code that's why I have added your SoB line. Tests are passing for hush and !hush cases
Signed-off-by: Michal Simek michal.simek@xilinx.com --- 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 b7f960c755fe..f8694017b42a 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):

On 11/30/2017 09:25 AM, Michal Simek wrote:
From: Stephen Warren swarren@nvidia.com
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
Changes in v2:
- code taken from v1 review from Stephen
Stephen: it is your code that's why I have added your SoB line. Tests are passing for hush and !hush cases
Looks good, thanks.
participants (2)
-
Michal Simek
-
Stephen Warren