diff options
author | Nick Rosbrook <nick.rosbrook@canonical.com> | 2022-12-13 18:22:37 +0100 |
---|---|---|
committer | Nick Rosbrook <nick.rosbrook@canonical.com> | 2022-12-14 19:58:12 +0100 |
commit | a635b6279cf35abad3abe169780ec899df9396df (patch) | |
tree | 4c3deaa1b0ace4eebcfe29b5934573ddf4ddfa30 | |
parent | test-fs-util: skip part of test_chase_symlinks if machine-id is not initialized (diff) | |
download | systemd-a635b6279cf35abad3abe169780ec899df9396df.tar.xz systemd-a635b6279cf35abad3abe169780ec899df9396df.zip |
test-unit-name: simplify machine-id check
-rw-r--r-- | src/test/test-unit-name.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index 98fffc7c87..c6428e844f 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -3,6 +3,8 @@ #include <stdio.h> #include <stdlib.h> +#include "sd-id128.h" + #include "alloc-util.h" #include "all-units.h" #include "glob-util.h" @@ -261,7 +263,7 @@ TEST_RET(unit_printf, .sd_booted = true) { assert_se(short_hostname); assert_se(specifier_pretty_hostname('q', NULL, NULL, NULL, &pretty_hostname) == 0); assert_se(pretty_hostname); - if (access("/etc/machine-id", F_OK) >= 0) { + if (sd_id128_get_machine(NULL) >= 0) { assert_se(specifier_machine_id('m', NULL, NULL, NULL, &machine_id) >= 0); assert_se(machine_id); } |