diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-05-29 16:08:47 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-03 21:15:09 +0200 |
commit | 4a6a2092d34bb7f4c39aa9073cc3a749107df948 (patch) | |
tree | 8ae02a9e028d5bfe01af8b7459c133c2ed5517c3 /src/test/test-sleep.c | |
parent | Merge pull request #12708 from yuwata/test-network-networkctl-tests (diff) | |
download | systemd-4a6a2092d34bb7f4c39aa9073cc3a749107df948.tar.xz systemd-4a6a2092d34bb7f4c39aa9073cc3a749107df948.zip |
test-sleep: also print parsed modes and states
This allows the parser to be verified against on-disk config.
Diffstat (limited to 'src/test/test-sleep.c')
-rw-r--r-- | src/test/test-sleep.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c index a0830bc899..2a23bf2384 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -20,6 +20,25 @@ static void test_parse_sleep_config(void) { log_info("/* %s */", __func__); assert(parse_sleep_config(&sleep_config) == 0); + + _cleanup_free_ char *sum, *sus, *him, *his, *hym, *hys; + + sum = strv_join(sleep_config->suspend_modes, ", "); + sus = strv_join(sleep_config->suspend_states, ", "); + him = strv_join(sleep_config->hibernate_modes, ", "); + his = strv_join(sleep_config->hibernate_states, ", "); + hym = strv_join(sleep_config->hybrid_modes, ", "); + hys = strv_join(sleep_config->hybrid_states, ", "); + log_debug(" allow_suspend: %u", sleep_config->allow_suspend); + log_debug(" allow_hibernate: %u", sleep_config->allow_hibernate); + log_debug(" allow_s2h: %u", sleep_config->allow_s2h); + log_debug(" allow_hybrid_sleep: %u", sleep_config->allow_hybrid_sleep); + log_debug(" suspend modes: %s", sum); + log_debug(" states: %s", sus); + log_debug(" hibernate modes: %s", him); + log_debug(" states: %s", his); + log_debug(" hybrid modes: %s", hym); + log_debug(" states: %s", hys); } static int test_fiemap(const char *path) { @@ -88,7 +107,7 @@ static void test_sleep(void) { int main(int argc, char* argv[]) { int i, r = 0, k; - test_setup_logging(LOG_INFO); + test_setup_logging(LOG_DEBUG); if (getuid() != 0) log_warning("This program is unlikely to work for unprivileged users"); |