summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2017-12-08 15:47:18 +0100
committerTom Rini <trini@konsulko.com>2017-12-12 21:33:38 -0500
commit040f5f1067d8d05002aef74bdacc97b745df7c57 (patch)
treee36495d47ac41559f83c9d687092ea03c21a0a8e /test
parentf03146480df0d45466b89218db1fd49ba39fc791 (diff)
test: py: Add an option to skip sleep test
Some QEMUs have a problem with time setup that's why sleep test is failing. Introduce env__sleep_accurate boardenv variable to have an option to skip sleep test. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_sleep.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
index 64e05713262..ccef24d7f7b 100644
--- a/test/py/tests/test_sleep.py
+++ b/test/py/tests/test_sleep.py
@@ -5,10 +5,23 @@
import pytest
import time
+"""
+Note: This test doesn't rely on boardenv_* configuration values but they can
+change test behavior.
+
+# Setup env__sleep_accurate to False if time is not accurate on your platform
+env__sleep_accurate = False
+
+"""
+
def test_sleep(u_boot_console):
"""Test the sleep command, and validate that it sleeps for approximately
the correct amount of 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':
pytest.skip('sleep command not supported')
# 3s isn't too long, but is enough to cross a few second boundaries.