summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-12-17 13:16:22 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-12-17 13:16:22 -0500
commit35d301262b69c895e749c21a80f2324c03c453a3 (patch)
tree5ef11503bad390986c37cbe5acf8261d502bc67a
parenta8295acf6e16b0bee3d05985d10ca064730fb803 (diff)
downloadbfs-35d301262b69c895e749c21a80f2324c03c453a3.tar.xz
tests/gnu: Add an -ignore_readdir_race test for removed directories
Link: https://savannah.gnu.org/bugs/index.php?45930
-rw-r--r--tests/gnu/ignore_readdir_race_rmdir.out2
-rw-r--r--tests/gnu/ignore_readdir_race_rmdir.sh5
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/gnu/ignore_readdir_race_rmdir.out b/tests/gnu/ignore_readdir_race_rmdir.out
new file mode 100644
index 0000000..ede8749
--- /dev/null
+++ b/tests/gnu/ignore_readdir_race_rmdir.out
@@ -0,0 +1,2 @@
+./bar
+./foo
diff --git a/tests/gnu/ignore_readdir_race_rmdir.sh b/tests/gnu/ignore_readdir_race_rmdir.sh
new file mode 100644
index 0000000..87f36a9
--- /dev/null
+++ b/tests/gnu/ignore_readdir_race_rmdir.sh
@@ -0,0 +1,5 @@
+cd "$TEST"
+"$XTOUCH" -p foo/ bar/
+
+# Check that -ignore_readdir_race suppresses errors from opendir()
+bfs_diff . -ignore_readdir_race -mindepth 1 -print -name foo -exec rmdir {} \;