Skip to content

Commit

Permalink
test-proc-cmdline: disable EFI-dependent tests when EFI is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
floppym committed Nov 25, 2019
1 parent 8c99d40 commit 382efa3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/test-proc-cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 382efa3

Please sign in to comment.