]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-proc-cmdline: disable EFI-dependent tests when EFI is disabled
authorMike Gilbert <floppym@gentoo.org>
Mon, 25 Nov 2019 01:24:44 +0000 (20:24 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 25 Nov 2019 07:37:09 +0000 (08:37 +0100)
Fixes: https://github.com/systemd/systemd/issues/14116
src/test/test-proc-cmdline.c

index 3231e4a3e69e7e69b02d913c35cc1018c74e0d1f..bdcd1fc4c7ce63e01d28eb60add07fde49ab249b 100644 (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) {