tests: add a test for reverting reshapes

Only reverting reshapes that grow the array so far.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-07-02 16:19:52 +10:00
parent 5509dc44d8
commit aef14b9e49
2 changed files with 44 additions and 0 deletions

1
test
View File

@ -95,6 +95,7 @@ do_setup() {
eval dev$d=/dev/loop$d
eval file$d=$targetdir/mdtest$d
eval devlist=\"\$devlist \$dev$d\"
eval devlist$d=\"\$devlist\"
#" <-- add this quote to un-confuse vim syntax highlighting
done
path0=$dev6

43
tests/07revert-grow Normal file
View File

@ -0,0 +1,43 @@
set -e -x
# revert a reshape that is increasing the number of devices,
# raid5, raid6, and raid10
# RAID5
mdadm -CR --assume-clean $md0 -l5 -n4 -x1 $devlist4
check raid5
testdev $md0 3 $mdsize1 512
mdadm -G $md0 -n 5
sleep 3
mdadm -S $md0
mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=/tmp/md-backup
check wait
check raid5
testdev $md0 3 $mdsize1 512
mdadm -S $md0
# RAID6
mdadm -CR --assume-clean $md0 -l6 -n4 -x1 $devlist4
check raid6
testdev $md0 2 $mdsize1 512
mdadm -G $md0 -n 5
sleep 3
mdadm -S $md0
mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=/tmp/md-backup
check wait
check raid6
testdev $md0 2 $mdsize1 512
mdadm -S $md0
# RAID10
mdadm -CR --assume-clean $md0 -l10 -n4 -x1 $devlist4
check raid10
testdev $md0 2 $mdsize1 512
mdadm -G $md0 -n 5
sleep 3
mdadm -S $md0
strace -o /tmp/str ./mdadm -A $md0 --update=revert-reshape $devlist4
check wait
check raid10
testdev $md0 2 $mdsize1 512
mdadm -S $md0