summaryrefslogtreecommitdiffstats
path: root/src/test/test-fs-util.c
diff options
context:
space:
mode:
authorLudwig Nussel <ludwig.nussel@suse.de>2023-01-09 17:58:57 +0100
committerLudwig Nussel <ludwig.nussel@suse.de>2023-01-19 14:11:12 +0100
commit1132fd73b32a06c6349f20c0cfb235cc854a1a3a (patch)
tree9fd3b9cbd81c6d04b84b4d78de089d8d691bfafb /src/test/test-fs-util.c
parenttest: update Ubuntu CI docs (diff)
downloadsystemd-1132fd73b32a06c6349f20c0cfb235cc854a1a3a.tar.xz
systemd-1132fd73b32a06c6349f20c0cfb235cc854a1a3a.zip
chase-symlinks: new chase_symlinks_and_unlink()
Diffstat (limited to 'src/test/test-fs-util.c')
-rw-r--r--src/test/test-fs-util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c
index 38299ce729..668a44733b 100644
--- a/src/test/test-fs-util.c
+++ b/src/test/test-fs-util.c
@@ -330,6 +330,13 @@ TEST(chase_symlinks) {
assert_se(sd_id128_equal(a, b));
}
+ assert_se(lstat(p, &st) >= 0);
+ r = chase_symlinks_and_unlink(p, NULL, 0, 0, &result);
+ assert_se(path_equal(result, p));
+ result = mfree(result);
+ assert_se(r == 0);
+ assert_se(lstat(p, &st) == -1 && errno == ENOENT);
+
/* Test CHASE_NOFOLLOW */
p = strjoina(temp, "/target");