[U-Boot] [PATCH] test: py: Add cmd_echo dependency

Michal Simek michal.simek at xilinx.com
Fri May 12 07:31:52 UTC 2017


There is missing dependency on echo command. Mark tests which requires
echo.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 test/py/tests/test_env.py          | 8 ++++++++
 test/py/tests/test_shell_basics.py | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 035dbf5cac4c..b7a76b31c304 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -157,6 +157,7 @@ def validate_set(state_test_env, var, value):
     response = state_test_env.u_boot_console.run_command('printenv %s' % var)
     assert response == ('%s=%s' % (var, value))
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_echo_exists(state_test_env):
     """Test echoing a variable that exists."""
 
@@ -164,12 +165,14 @@ def test_env_echo_exists(state_test_env):
     value = state_test_env.env[var]
     validate_set(state_test_env, var, value)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_echo_non_existent(state_test_env):
     """Test echoing a variable that doesn't exist."""
 
     var = state_test_env.set_var
     validate_empty(state_test_env, var)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_printenv_non_existent(state_test_env):
     """Test printenv error message for non-existant variables."""
 
@@ -179,6 +182,7 @@ def test_env_printenv_non_existent(state_test_env):
         response = c.run_command('printenv %s' % var)
     assert(response == '## Error: "%s" not defined' % var)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_unset_non_existent(state_test_env):
     """Test unsetting a nonexistent variable."""
 
@@ -186,6 +190,7 @@ def test_env_unset_non_existent(state_test_env):
     unset_var(state_test_env, var)
     validate_empty(state_test_env, var)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_set_non_existent(state_test_env):
     """Test set a non-existant variable."""
 
@@ -194,6 +199,7 @@ def test_env_set_non_existent(state_test_env):
     set_var(state_test_env, var, value)
     validate_set(state_test_env, var, value)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_set_existing(state_test_env):
     """Test setting an existant variable."""
 
@@ -202,6 +208,7 @@ def test_env_set_existing(state_test_env):
     set_var(state_test_env, var, value)
     validate_set(state_test_env, var, value)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_unset_existing(state_test_env):
     """Test unsetting a variable."""
 
@@ -209,6 +216,7 @@ def test_env_unset_existing(state_test_env):
     unset_var(state_test_env, var)
     validate_empty(state_test_env, var)
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_env_expansion_spaces(state_test_env):
     """Test expanding a variable that contains a space in its value."""
 
diff --git a/test/py/tests/test_shell_basics.py b/test/py/tests/test_shell_basics.py
index 702e5e27e002..f0def2759020 100644
--- a/test/py/tests/test_shell_basics.py
+++ b/test/py/tests/test_shell_basics.py
@@ -3,13 +3,16 @@
 # SPDX-License-Identifier: GPL-2.0
 
 # Test basic shell functionality, such as commands separate by semi-colons.
+import pytest
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_shell_execute(u_boot_console):
     """Test any shell command."""
 
     response = u_boot_console.run_command('echo hello')
     assert response.strip() == 'hello'
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_shell_semicolon_two(u_boot_console):
     """Test two shell commands separate by a semi-colon."""
 
@@ -28,6 +31,7 @@ def test_shell_semicolon_three(u_boot_console):
     assert response.strip() == '123'
     u_boot_console.run_command('setenv list')
 
+ at pytest.mark.buildconfigspec('cmd_echo')
 def test_shell_run(u_boot_console):
     """Test the "run" shell command."""
 
-- 
1.9.1



More information about the U-Boot mailing list