generic/388: randomly recover via read-only mounts
[xfstests-dev.git] / tests / generic / 388
index 451a6be204094ba8e82c737535511406e535fd0d..2f97f2666e0564fe52d8c6f5e1bcac358cc6e4bf 100755 (executable)
@@ -66,8 +66,14 @@ for i in $(seq 1 $((50 * TIME_FACTOR)) ); do
                ps -e | grep fsstress > /dev/null 2>&1
        done
 
-       # quit if mount fails so we don't shutdown the host fs
-       _scratch_cycle_mount || _fail "cycle mount failed"
+       # Toggle between rw and ro mounts for recovery. Quit if any mount
+       # attempt fails so we don't shutdown the host fs.
+       if [ $((RANDOM % 2)) -eq 0 ]; then
+               _scratch_cycle_mount || _fail "cycle mount failed"
+       else
+               _scratch_cycle_mount "ro" || _fail "cycle ro mount failed"
+               _scratch_cycle_mount || _fail "cycle rw mount failed"
+       fi
 done
 
 # success, all done