]> git.ipfire.org Git - thirdparty/mdadm.git/blame - tests/19repair-does-not-destroy
tests: add test that DDF marks missing devices as failed on assembly.
[thirdparty/mdadm.git] / tests / 19repair-does-not-destroy
CommitLineData
696e95a1
RB
1number_of_disks=7
2chunksize_in_kib=512
3array_data_size_in_kib=$[chunksize_in_kib*(number_of_disks-2)*number_of_disks]
4array_data_size_in_b=$[array_data_size_in_kib*1024]
5devs="$dev0 $dev1 $dev2 $dev3 $dev4 $dev5 $dev6"
6
7dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$array_data_size_in_kib
8mdadm -CR $md0 -l6 -n$number_of_disks -c $chunksize_in_kib $devs
9dd if=/tmp/RandFile of=$md0 bs=1024 count=$array_data_size_in_kib
10blockdev --flushbufs $md0; sync
11check wait
12blockdev --flushbufs $devs; sync
13echo 3 > /proc/sys/vm/drop_caches
14$dir/raid6check $md0 repair 1 2 3 > /dev/null # D D
15$dir/raid6check $md0 repair 8 2 5 > /dev/null # D P
16$dir/raid6check $md0 repair 15 4 6 > /dev/null # D Q
17$dir/raid6check $md0 repair 22 5 6 > /dev/null # P Q
18$dir/raid6check $md0 repair 3 4 0 > /dev/null # Q D
19$dir/raid6check $md0 repair 3 3 1 > /dev/null # P D
20$dir/raid6check $md0 repair 6 4 5 > /dev/null # D<D
21$dir/raid6check $md0 repair 13 5 4 > /dev/null # D>D
22blockdev --flushbufs $devs; sync
23echo 3 > /proc/sys/vm/drop_caches
24$dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" && { echo errors detected; exit 2; }
25cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo should not mess up correct stripe ; exit 2; }
26
27mdadm -S $md0
28udevadm settle
29blockdev --flushbufs $md0 $devs; sync