clustermd_tests: add test case to test manage_re-add against cluster-raid1

02r1_Manage_re-add:
2 active disk in array, set 1 disk 'fail' and 'remove' it from array,
then re-add the disk back to array and triggers recovery.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Zhilong Liu 2018-02-02 14:10:58 +08:00 committed by Jes Sorensen
parent ffa22ea2f3
commit 05f1959b19
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#!/bin/bash
mdadm -CR $md0 -l1 -b clustered -n2 $dev0 $dev1 --assume-clean
ssh $NODE2 mdadm -A $md0 $dev0 $dev1
check all nosync
check all raid1
check all bitmap
check all state UU
check all dmesg
mdadm --manage $md0 --fail $dev0 --remove $dev0
mdadm --manage $md0 --re-add $dev0
check $NODE1 recovery
check all wait
check all state UU
check all dmesg
stop_md all $md0
exit 0