]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-sleep.c
test-sleep: add more logging, show secure boot mode
[thirdparty/systemd.git] / src / test / test-sleep.c
index 014b1aa7a2f0eea88d54564cb61b9748159408c5..8b4fa82640b443f660c149609fbd843c72f69828 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "efivars.h"
 #include "errno-util.h"
 #include "fd-util.h"
 #include "log.h"
@@ -20,7 +21,7 @@ static void test_parse_sleep_config(void) {
         _cleanup_(free_sleep_configp) SleepConfig *sleep_config = NULL;
         log_info("/* %s */", __func__);
 
-        assert(parse_sleep_config(&sleep_config) == 0);
+        assert_se(parse_sleep_config(&sleep_config) == 0);
 
         _cleanup_free_ char *sum, *sus, *him, *his, *hym, *hys;
 
@@ -84,7 +85,9 @@ static void test_sleep(void) {
 
         log_info("/* %s */", __func__);
 
-        log_info("/= configuration =/");
+        printf("Secure boot: %sd\n", enable_disable(is_efi_secure_boot()));
+
+        log_info("/= individual sleep modes =/");
         log_info("Standby configured: %s", yes_no(can_sleep_state(standby) > 0));
         log_info("Suspend configured: %s", yes_no(can_sleep_state(mem) > 0));
         log_info("Hibernate configured: %s", yes_no(can_sleep_state(disk) > 0));
@@ -94,7 +97,7 @@ static void test_sleep(void) {
         log_info("Hibernate+Shutdown configured: %s", yes_no(can_sleep_disk(shutdown) > 0));
         log_info("Freeze configured: %s", yes_no(can_sleep_state(freeze) > 0));
 
-        log_info("/= running system =/");
+        log_info("/= high-level sleep verbs =/");
         r = can_sleep("suspend");
         log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
         r = can_sleep("hibernate");