diff mbox series

[1/1] test: do no assume hush parser in validate_empty()

Message ID 20200910100903.8453-1-xypron.glpk@gmx.de
State Accepted
Commit 185440ffc46f310b0f300c10804ba3cb0a7bf15a
Delegated to: Tom Rini
Headers show
Series [1/1] test: do no assume hush parser in validate_empty() | expand

Commit Message

Heinrich Schuchardt Sept. 10, 2020, 10:09 a.m. UTC
The environment variable test uses function validate_empty() to check that
a variable is not defined. If the hush parser is not enabled, we cannot
refer to a variable by $var_name but only by ${var_name}.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 test/py/tests/test_env.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.28.0

Comments

Stephen Warren Sept. 10, 2020, 3:13 p.m. UTC | #1
On 9/10/20 4:09 AM, Heinrich Schuchardt wrote:
> The environment variable test uses function validate_empty() to check that
> a variable is not defined. If the hush parser is not enabled, we cannot
> refer to a variable by $var_name but only by ${var_name}.

Acked-by: Stephen Warren <swarren@nvidia.com>
Tom Rini Sept. 14, 2020, 7:41 p.m. UTC | #2
On Thu, Sep 10, 2020 at 12:09:03PM +0200, Heinrich Schuchardt wrote:

> The environment variable test uses function validate_empty() to check that
> a variable is not defined. If the hush parser is not enabled, we cannot
> refer to a variable by $var_name but only by ${var_name}.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Acked-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 2ae8f25381..940279651d 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -151,7 +151,7 @@  def validate_empty(state_test_env, var):
         Nothing.
     """

-    response = state_test_env.u_boot_console.run_command('echo $%s' % var)
+    response = state_test_env.u_boot_console.run_command('echo ${%s}' % var)
     assert response == ''

 def validate_set(state_test_env, var, value):