Merge pull request #224 from versity/auke/renameat2-test-sub-dir

Use T_D0/1 instead of T_M0 here.
This commit is contained in:
Zach Brown
2025-12-08 10:05:46 -08:00
committed by GitHub

View File

@@ -8,19 +8,19 @@ t_require_mounts 2
echo "=== renameat2 noreplace flag test" echo "=== renameat2 noreplace flag test"
# give each mount their own dir (lock group) to minimize create contention # give each mount their own dir (lock group) to minimize create contention
mkdir $T_M0/dir0 mkdir $T_D0/dir0
mkdir $T_M1/dir1 mkdir $T_D1/dir1
echo "=== run two asynchronous calls to renameat2 NOREPLACE" echo "=== run two asynchronous calls to renameat2 NOREPLACE"
for i in $(seq 0 100); do for i in $(seq 0 100); do
# prepare inputs in isolation # prepare inputs in isolation
touch "$T_M0/dir0/old0" touch "$T_D0/dir0/old0"
touch "$T_M1/dir1/old1" touch "$T_D1/dir1/old1"
# race doing noreplace renames, both can't succeed # race doing noreplace renames, both can't succeed
dumb_renameat2 -n "$T_M0/dir0/old0" "$T_M0/dir0/sharednew" 2> /dev/null & dumb_renameat2 -n "$T_D0/dir0/old0" "$T_D0/dir0/sharednew" 2> /dev/null &
pid0=$! pid0=$!
dumb_renameat2 -n "$T_M1/dir1/old1" "$T_M1/dir0/sharednew" 2> /dev/null & dumb_renameat2 -n "$T_D1/dir1/old1" "$T_D1/dir0/sharednew" 2> /dev/null &
pid1=$! pid1=$!
wait $pid0 wait $pid0
@@ -31,7 +31,7 @@ for i in $(seq 0 100); do
test "$rc0" == 0 -a "$rc1" == 0 && t_fail "both renames succeeded" test "$rc0" == 0 -a "$rc1" == 0 && t_fail "both renames succeeded"
# blow away possible files for either race outcome # blow away possible files for either race outcome
rm -f "$T_M0/dir0/old0" "$T_M1/dir1/old1" "$T_M0/dir0/sharednew" "$T_M1/dir1/sharednew" rm -f "$T_D0/dir0/old0" "$T_D1/dir1/old1" "$T_D0/dir0/sharednew" "$T_D1/dir1/sharednew"
done done
t_pass t_pass