
On Tue, Sep 26, 2023 at 05:08:35PM +0530, Love Kumar wrote:
Execute "time <sleep cmd>", and validate that it gives the approximately the correct amount of command execution time.
Signed-off-by: Love Kumar love.kumar@amd.com
test/py/tests/test_sleep.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py index 392af29db224..388f544d07df 100644 --- a/test/py/tests/test_sleep.py +++ b/test/py/tests/test_sleep.py @@ -41,3 +41,23 @@ def test_sleep(u_boot_console): if not u_boot_console.config.gdbserver: # margin is hopefully enough to account for any system overhead. assert elapsed < (sleep_time + sleep_margin)
+def test_time(u_boot_console):
- """Test the time command, and validate that it gives approximately the
- correct amount of command execution time."""
- sleep_skip = u_boot_console.config.env.get("env__sleep_accurate", True)
- if not sleep_skip:
pytest.skip("sleep is not accurate")
- if u_boot_console.config.buildconfig.get("config_cmd_misc", "n") != "y":
We should use @pytest.mark.buildconfigspec('cmd_misc') on the function def itself.