From 470589cbd9ca3e73d8c01ac3a96cbc065179dcc5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 27 May 2024 13:39:42 -0400 Subject: bfstd: Treat ELOOP like ENOENT GNU findutils just made the same change, so looping symlinks will be considered broken rather than a hard error. Link: https://savannah.gnu.org/bugs/?51926 --- tests/bfs/xtype_depth.sh | 9 ++++++++- tests/gnu/L_loops_continue.out | 1 + tests/gnu/ignore_readdir_race_loop.out | 12 ++++++++++++ tests/gnu/ignore_readdir_race_loop.sh | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/gnu/ignore_readdir_race_loop.out create mode 100644 tests/gnu/ignore_readdir_race_loop.sh (limited to 'tests') diff --git a/tests/bfs/xtype_depth.sh b/tests/bfs/xtype_depth.sh index 02c8173..93c4fb7 100644 --- a/tests/bfs/xtype_depth.sh +++ b/tests/bfs/xtype_depth.sh @@ -1,2 +1,9 @@ +cd "$TEST" +"$XTOUCH" -p foo/bar +ln -s foo/bar baz + +chmod a-rx foo +defer chmod +rx foo + # Make sure -xtype is considered side-effecting for facts_when_impure -! invoke_bfs loops -xtype l -depth 100 +! invoke_bfs . -xtype l -depth 100 diff --git a/tests/gnu/L_loops_continue.out b/tests/gnu/L_loops_continue.out index a514555..faf33d3 100644 --- a/tests/gnu/L_loops_continue.out +++ b/tests/gnu/L_loops_continue.out @@ -4,6 +4,7 @@ loops/deeply loops/deeply/nested loops/deeply/nested/dir loops/file +loops/loop loops/notdir loops/skip loops/skip/dir diff --git a/tests/gnu/ignore_readdir_race_loop.out b/tests/gnu/ignore_readdir_race_loop.out new file mode 100644 index 0000000..faf33d3 --- /dev/null +++ b/tests/gnu/ignore_readdir_race_loop.out @@ -0,0 +1,12 @@ +loops +loops/broken +loops/deeply +loops/deeply/nested +loops/deeply/nested/dir +loops/file +loops/loop +loops/notdir +loops/skip +loops/skip/dir +loops/skip/loop +loops/symlink diff --git a/tests/gnu/ignore_readdir_race_loop.sh b/tests/gnu/ignore_readdir_race_loop.sh new file mode 100644 index 0000000..3329169 --- /dev/null +++ b/tests/gnu/ignore_readdir_race_loop.sh @@ -0,0 +1,2 @@ +# Make sure -ignore_readdir_race doesn't suppress ELOOP from an actual filesystem loop +! bfs_diff -L loops -ignore_readdir_race -- cgit v1.2.3