Skip to contentSkip to conversation

test: py: test_shell_run() with CONFIG_HUSH_PARSER=n

PATCH New Heinrich Schuchardt 2 participants 2 messages Aug 5, 2020 – Aug 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: py: test_shell_run() with CONFIG_HUSH_PARSER=n

The hush parser not enabled for some boards, e.g.
sipeed_maix_bitm_defconfig.

With CONFIG_HUSH_PARSER=n a double quotation mark is not interpreted as the beginning of a string. Use a single quotation mark instead.

Furthermore without the hush parser variables have to be referenced as ${varname}. Add the missing braces.

Fixes 8b86c609b860 ("test/py: add test of basic shell functionality")
---
 test/py/tests/test_shell_basics.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
test/py/tests/test_shell_basics.py +3 -3
index f54f7b7425..68a3f892f6 100644
@@ -34,11 +34,11 @@ def test_shell_semicolon_three(u_boot_console):
 def test_shell_run(u_boot_console):
     """Test the "run" shell command."""
 
-    u_boot_console.run_command('setenv foo "setenv monty 1; setenv python 2"')
+    u_boot_console.run_command('setenv foo \'setenv monty 1; setenv python 2\'')
     u_boot_console.run_command('run foo')
-    response = u_boot_console.run_command('echo $monty')
+    response = u_boot_console.run_command('echo ${monty}')
     assert response.strip() == '1'
-    response = u_boot_console.run_command('echo $python')
+    response = u_boot_console.run_command('echo ${python}')
     assert response.strip() == '2'
     u_boot_console.run_command('setenv foo')
     u_boot_console.run_command('setenv monty')

--
2.27.0

#1 lore raw

PATCH 1/1 test: py: test_shell_run() with CONFIG_HUSH_PARSER=n

Quoted 6 lines · Heinrich Schuchardt

The hush parser not enabled for some boards, e.g.
sipeed_maix_bitm_defconfig.

With CONFIG_HUSH_PARSER=n a double quotation mark is not interpreted as the beginning of a string. Use a single quotation mark instead.

Quoted 6 lines

Furthermore without the hush parser variables have to be referenced as ${varname}. Add the missing braces.

Fixes 8b86c609b860 ("test/py: add test of basic shell functionality")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200808/924e3247/attachment.sig>