test-proc-cmdline: disable EFI-dependent tests when EFI is disabled

Fixes: https://github.com/systemd/systemd/issues/14116
This commit is contained in:
Mike Gilbert 2019-11-24 20:24:44 -05:00 committed by Zbigniew Jędrzejewski-Szmek
parent 9e94246cad
commit e05b7c0955

View file

@ -173,6 +173,7 @@ static void test_proc_cmdline_get_bool(void) {
assert_se(putenv((char*) "SYSTEMD_PROC_CMDLINE=") == 0);
assert_se(putenv((char*) "SYSTEMD_EFI_OPTIONS=foo_bar bar-waldo=1 x_y-z=0 quux=miep\nda=yes\nthe=1") == 0);
#if ENABLE_EFI
assert_se(proc_cmdline_get_bool("", &value) == -EINVAL);
assert_se(proc_cmdline_get_bool("abc", &value) == 0 && value == false);
assert_se(proc_cmdline_get_bool("foo_bar", &value) > 0 && value == true);
@ -186,6 +187,7 @@ static void test_proc_cmdline_get_bool(void) {
assert_se(proc_cmdline_get_bool("quux", &value) == -EINVAL && value == false);
assert_se(proc_cmdline_get_bool("da", &value) > 0 && value == true);
assert_se(proc_cmdline_get_bool("the", &value) > 0 && value == true);
#endif
}
static void test_proc_cmdline_get_key_many(void) {