Now that we reserve space for migration buffer devices are a little bit smaller so we need to allow for that in the test suite. Also add a 'udevadm settle' - it seems to help Signed-off-by: NeilBrown <neilb@suse.de>
84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
imsm_check() {
|
|
case $1 in
|
|
container )
|
|
grep -s " blocks super external:imsm" /proc/mdstat > /dev/null || {
|
|
echo >&2 "ERROR correctly formed container not found"; cat /proc/mdstat; exit 1;}
|
|
;;
|
|
member )
|
|
member=$2
|
|
num_disks=$3
|
|
level=$4
|
|
size=$5
|
|
offset=$6
|
|
err=0
|
|
|
|
eval `stat -L -c "let major=0x%t; let minor=0x%T;" $member`
|
|
sysfs=/sys/dev/block/${major}:${minor}
|
|
if [ ! -f ${sysfs}/md/array_state ]; then
|
|
echo "member array $member not found" >&2
|
|
cat /proc/mdstat >&2
|
|
exit 1
|
|
fi
|
|
for i in `seq 0 $((num_disks-1))`
|
|
do
|
|
_offset=`cat ${sysfs}/md/rd${i}/offset`
|
|
if [ $offset -ne $((_offset/2)) ]; then
|
|
echo "offset mismatch expected $offset got $_offset" >&2
|
|
err=$((err+1))
|
|
fi
|
|
_size=`cat ${sysfs}/md/rd${i}/size`
|
|
if [ $size -ne $_size ]; then
|
|
echo "offset mismatch expected $size got $_size" >&2
|
|
err=$((err+1))
|
|
fi
|
|
done
|
|
|
|
if [ $err -gt 0 ]; then
|
|
echo "$member failed check" >&2
|
|
cat /proc/mdstat >&2
|
|
mdadm -E /dev/loop0 >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
* ) echo >&2 ERROR unknown check $1 ; exit 1;
|
|
esac
|
|
}
|
|
|
|
export IMSM_DEVNAME_AS_SERIAL=1
|
|
export IMSM_NO_PLATFORM=1
|
|
container=/dev/md/container
|
|
member0=/dev/md/vol0
|
|
member1=/dev/md/vol1
|
|
member2=/dev/md/vol2
|
|
member3=/dev/md/vol3
|
|
member4=/dev/md/vol4
|
|
|
|
|
|
# create raid arrays with varying degress of overlap
|
|
mdadm -CR $container -e imsm -n 6 $dev0 $dev1 $dev2 $dev3 $dev4 $dev5
|
|
imsm_check container 6
|
|
|
|
size=1910
|
|
level=1
|
|
num_disks=2
|
|
mdadm -CR $member0 $dev0 $dev1 -n $num_disks -l $level -z $size
|
|
mdadm -CR $member1 $dev1 $dev2 -n $num_disks -l $level -z $size
|
|
mdadm -CR $member2 $dev2 $dev3 -n $num_disks -l $level -z $size
|
|
mdadm -CR $member3 $dev3 $dev4 -n $num_disks -l $level -z $size
|
|
mdadm -CR $member4 $dev4 $dev5 -n $num_disks -l $level -z $size
|
|
|
|
udevadm settle
|
|
|
|
offset=0
|
|
imsm_check member $member0 $num_disks $level $size $offset
|
|
offset=$((offset+size+2048))
|
|
imsm_check member $member1 $num_disks $level $size $offset
|
|
offset=$((offset+size+2048))
|
|
imsm_check member $member2 $num_disks $level $size $offset
|
|
# at this point there should be more freespace at the start of the disk
|
|
# than the end
|
|
offset=0
|
|
imsm_check member $member3 $num_disks $level $size $offset
|
|
offset=$((offset+size+2048))
|
|
imsm_check member $member4 $num_disks $level $size $offset
|