test-load-fragment: simplify machine-id check
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "all-units.h"
|
||||
#include "alloc-util.h"
|
||||
#include "capability-util.h"
|
||||
@@ -518,7 +520,7 @@ TEST(install_printf, .sd_booted = true) {
|
||||
|
||||
_cleanup_free_ char *mid = NULL, *bid = NULL, *host = NULL, *gid = NULL, *group = NULL, *uid = NULL, *user = NULL;
|
||||
|
||||
if (access("/etc/machine-id", F_OK) >= 0)
|
||||
if (sd_id128_get_machine(NULL) >= 0)
|
||||
assert_se(specifier_machine_id('m', NULL, NULL, NULL, &mid) >= 0 && mid);
|
||||
if (sd_booted() > 0)
|
||||
assert_se(specifier_boot_id('b', NULL, NULL, NULL, &bid) >= 0 && bid);
|
||||
|
||||
Reference in New Issue
Block a user