Fix mkdir-rename-rmdir test script

The current script gets stuck in an infinite loop when the test
suite is started with 1 mount point. This is due to the advancement
part of the script in which it advances the ops for each mount.
The current while loop checks for when the op_mnt wraps by checking if
it equals 0. But the problem is we set each of the op_mnts to 0 during
the advancement, so when it wraps it still equates to 0, so it is an
infinite loop. Therefore, the fix is to check at the end of the loop
check if the last op's mount number wrapped. If so just break out.

Signed-off-by: Bryant Duffy-Ly <bduffyly@versity.com>
This commit is contained in:
Bryant Duffy-Ly
2021-10-13 15:13:19 -05:00
parent 66b8c5fbd7
commit 501953d69e

View File

@@ -23,9 +23,7 @@ else
NR_MNTS=$T_NR_MOUNTS
fi
# test until final op mount dir wraps
while [ ${op_mnt[$NR_OPS]} == 0 ]; do
while : ; do
# sequentially perform each op from its mount dir
for op in $(seq 0 $((NR_OPS - 1))); do
m=${op_mnt[$op]}
@@ -45,7 +43,7 @@ while [ ${op_mnt[$NR_OPS]} == 0 ]; do
# advance through mnt nrs for each op
i=0
while [ ${op_mnt[$NR_OPS]} == 0 ]; do
while [ $i -lt $NR_OPS ]; do
((op_mnt[$i]++))
if [ ${op_mnt[$i]} -ge $NR_MNTS ]; then
op_mnt[$i]=0
@@ -54,6 +52,9 @@ while [ ${op_mnt[$NR_OPS]} == 0 ]; do
break
fi
done
# done when the last op's mnt nr wrapped
[ $i -ge $NR_OPS ] && break
done
t_pass