877 B
877 B
Test Case: Broken Symlink
Test ID: TC040-symlink-broken
Objective
Verify readlink(2) succeeds for a deterministic broken link while following
the target fails with exact ENOENT.
Fixture
Use images/inline.erofs and source/inline/brokenlink. Evidence asserts
symlink mode, layout 2, and target length 29.
Procedure
test -L "$mnt/brokenlink"
readlink /tmp/repo22-g1/source/inline/brokenlink > /tmp/tc040-source-target
readlink "$mnt/brokenlink" > /tmp/tc040-mount-target
cmp /tmp/tc040-source-target /tmp/tc040-mount-target
./read_probe expect-error "$mnt/brokenlink" 2
./read_probe expect-error "$mnt/brokenlink" 2
Expected Results
- Both
readlinktargets equal/nonexistent/repo22-g1-target. - Both follow attempts return errno 2 (
ENOENT), while the symlink itself remains visible; no kernel error or cleanup failure occurs.