aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/log/log_test.c7
-rw-r--r--test/py/tests/test_log.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/test/log/log_test.c b/test/log/log_test.c
index fdee5e6757..6a60ff6be3 100644
--- a/test/log/log_test.c
+++ b/test/log/log_test.c
@@ -196,6 +196,13 @@ static int log_test(int testnum)
log_io("level %d\n", LOGL_DEBUG_IO);
break;
}
+ case 11:
+ log_err("default\n");
+ ret = log_device_set_enable(LOG_GET_DRIVER(console), false);
+ log_err("disabled\n");
+ ret = log_device_set_enable(LOG_GET_DRIVER(console), true);
+ log_err("enabled\n");
+ break;
}
return 0;
diff --git a/test/py/tests/test_log.py b/test/py/tests/test_log.py
index ddc28f19ee..275f9382d2 100644
--- a/test/py/tests/test_log.py
+++ b/test/py/tests/test_log.py
@@ -92,6 +92,13 @@ def test_log(u_boot_console):
for i in range(7):
assert 'log_test() level %d' % i == next(lines)
+ def test11():
+ """Test use of log_device_set_enable()"""
+ lines = run_test(11)
+ assert 'log_test() default'
+ # disabled should not be displayed
+ assert 'log_test() enabled'
+
# TODO(sjg@chromium.org): Consider structuring this as separate tests
cons = u_boot_console
test0()
@@ -105,6 +112,7 @@ def test_log(u_boot_console):
test8()
test9()
test10()
+ test11()
@pytest.mark.buildconfigspec('cmd_log')
def test_log_format(u_boot_console):