From 040f5f1067d8d05002aef74bdacc97b745df7c57 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 8 Dec 2017 15:47:18 +0100 Subject: [PATCH] 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 Reviewed-by: Tom Rini Reviewed-by: Stephen Warren --- test/py/tests/test_sleep.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py index 64e0571..ccef24d 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.