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
|
#!/bin/bash
# Test sockfd connection
. ./common
trap "_uninit; exit \$status" 0 1 2 3 15
_uninit()
{
for i in `seq 1 7`; do
_cleanup_machine_simulation $i
done
}
_need_to_be_root
for i in `seq 0 9`; do
_start_sheep $i
done
_wait_for_sheep 10
_cluster_format -c 6
_vdi_create test 40M
_random | $DOG vdi write test &
sleep 2
# Test write timeout
for i in `seq 1 4`; do
_simulate_machine_down $i
done
# wait for dog to finish
wait
_wait_for_sheep_recovery 0
$DOG vdi read test | md5sum > $STORE/csum.1
for i in `seq 0 9`; do
$DOG vdi object -i $i test
done
for i in 10 11 12; do
_start_sheep $i
done
_wait_for_sheep_recovery 0
# Test read timeout
$DOG vdi read test | md5sum > $STORE/csum.2 &
for i in `seq 5 7`; do
_simulate_machine_down $i
done
wait
diff -u $STORE/csum.1 $STORE/csum.2
status=0
|