]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-fs-util: skip part of test_chase_symlinks if machine-id is not initialized
authorNick Rosbrook <nick.rosbrook@canonical.com>
Mon, 12 Dec 2022 19:37:52 +0000 (14:37 -0500)
committerNick Rosbrook <nick.rosbrook@canonical.com>
Wed, 14 Dec 2022 18:58:12 +0000 (13:58 -0500)
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.

src/test/test-fs-util.c

index 16c6774a65928811fe2e4167525c18f78f35dd3f..69f630399021cc4cbcf2023cbe7bf4a818cd35d0 100644 (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;