From: Daan De Meyer Date: Sat, 6 May 2023 09:34:34 +0000 (+0200) Subject: test-journal-verify: Use a more thorough machine ID check X-Git-Tag: v254-rc1~532 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0287dc1d77915ba43a5a28576561b7e8f0fa75c;p=thirdparty%2Fsystemd.git test-journal-verify: Use a more thorough machine ID check Let's not only check if the file exists but also check if it contains a valid machine ID. --- diff --git a/src/journal/test-journal-verify.c b/src/journal/test-journal-verify.c index f15071d81d3..97cc0b15145 100644 --- a/src/journal/test-journal-verify.c +++ b/src/journal/test-journal-verify.c @@ -80,8 +80,8 @@ static int run_test(const char *verification_key, ssize_t max_iterations) { assert_se(m != NULL); /* managed_journal_file_open requires a valid machine id */ - if (access("/etc/machine-id", F_OK) != 0) - return log_tests_skipped("/etc/machine-id not found"); + if (sd_id128_get_machine(NULL) < 0) + return log_tests_skipped("No valid machine ID found"); test_setup_logging(LOG_DEBUG);