summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-07-09 16:35:38 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-07-09 16:35:38 -0400
commit2328d8dbb5a8c774afb99d363b6e98cd25ee304d (patch)
tree53822ecfebc872335e9b13f2fb255f0b2aa808d6 /tests.sh
parentf4eed3b771a987ef441fea49ababc356a2933086 (diff)
downloadbfs-2328d8dbb5a8c774afb99d363b6e98cd25ee304d.tar.xz
Handle ENOTDIR the same as ENOENT
For a/b/c, ENOTDIR is returned instead of ENOENT if a or b are not directories. Handle this uniformly when detecting broken symlinks, readdir races, etc.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index c8aeb63..b150046 100755
--- a/tests.sh
+++ b/tests.sh
@@ -74,6 +74,7 @@ function make_links() {
ln -s ../../d "$1/d/e/g"
ln -s d/e "$1/h"
ln -s q "$1/d/e/i"
+ ln -s b/c "$1/j"
}
make_links "$TMP/links"
@@ -299,6 +300,7 @@ gnu_tests=(
test_flag_double_dash
test_ignore_readdir_race
test_ignore_readdir_race_root
+ test_ignore_readdir_race_notdir
test_perm_222_slash
test_perm_644_slash
test_perm_symbolic_slash
@@ -797,6 +799,14 @@ function test_ignore_readdir_race_root() {
! $BFS basic/nonexistent -ignore_readdir_race 2>/dev/null
}
+function test_ignore_readdir_race_notdir() {
+ # Check -ignore_readdir_race handling when a directory is replaced with a file
+ rm -rf scratch/*
+ touchp scratch/foo/bar
+
+ $BFS scratch -mindepth 1 -ignore_readdir_race -execdir rm -r '{}' \; -execdir touch '{}' \;
+}
+
function test_perm_222() {
bfs_diff perms -perm 222
}