test-fs-util: skip part of test_chase_symlinks if machine-id is not initialized

The part of test_chase_symlink in test-fs-util that calls
sd_id128_get_machine will fail if /etc/machine-id is empty, so skip this
block if the machine-id is not initialized.
This commit is contained in:
Nick Rosbrook
2022-12-14 13:58:12 -05:00
parent 415eb50570
commit 079fcdd04f
+1 -1
View File
@@ -315,7 +315,7 @@ TEST(chase_symlinks) {
assert_se(symlink("/usr/../etc/./machine-id", p) >= 0);
r = chase_symlinks(p, NULL, 0, NULL, &pfd);
if (r != -ENOENT) {
if (r != -ENOENT && sd_id128_get_machine(NULL) >= 0) {
_cleanup_close_ int fd = -1;
sd_id128_t a, b;