1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/bin/bash
# Test disk error handling
. ./common
for i in `seq 0 9`; do
_start_sheep $i
done
_wait_for_sheep 10
_cluster_format -c 6
_vdi_create test 40M
for i in `seq 0 10`; do
echo $i | $DOG vdi write test $((i * 4 * 1024 * 1024)) 512
done
for i in 0 1 2 3 4; do
$DOG vdi read test -p 700$i | md5sum
$DOG cluster info -p 700$i | _filter_cluster_info
done
# remove obj directory to occur EIO
_safe_remove $STORE/4/obj
for i in `seq 0 10`; do
echo $(($i + 100)) | $DOG vdi write test $((i * 4 * 1024 * 1024)) 512
done
for i in 0 1 2 3 4; do
$DOG vdi read test -p 700$i | md5sum
$DOG cluster info -p 700$i | _filter_cluster_info
done
# check whether sheep 4 can receive confchg event
_kill_sheep 3
for i in `seq 0 10`; do
echo $(($i + 200)) | $DOG vdi write test $((i * 4 * 1024 * 1024)) 512
done
for i in 0 1 2 4; do
$DOG vdi read test -p 700$i | md5sum
$DOG cluster info -p 700$i | _filter_cluster_info
done
# check whether sheep 4 can receive notify event
_vdi_create test2 20M
for i in 0 1 2 4; do
_vdi_list -p 700$i
done
# check whether we can write to a gateway after EIO
_safe_remove $STORE/0/obj
echo hello | $DOG vdi write test 0 512
|