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
|
#!/bin/bash
# Test disk full handling
. ./common
_need_to_be_root
_make_device 0 $((1024 ** 3))
_make_device 1 $((1024 ** 3))
_make_device 2 $((20 * 1024 ** 2))
_make_device 3 $((20 * 1024 ** 2))
# create log files of sheep 2 and 3 on other places
touch $STORE/0/sheep2.log $STORE/0/sheep3.log
ln -s $STORE/0/sheep2.log $STORE/2/sheep.log
ln -s $STORE/0/sheep3.log $STORE/3/sheep.log
for i in `seq 0 3`; do
_start_sheep $i
done
_wait_for_sheep 4
_cluster_format
# create two VDIs before there are enough spaces
$DOG vdi create test0 100M
$DOG vdi create test1 100M
# make sheep 0 and 1 disk full
dd if=/dev/zero of=$STORE/2/zero > /dev/null 2>&1
dd if=/dev/zero of=$STORE/3/zero > /dev/null 2>&1
# test data write against disk-full cluster
for i in `seq 0 10`; do
echo $i | $DOG vdi write test0 $((i * 4 * 1024 * 1024)) 512 -p 7000
echo $i | $DOG vdi write test1 $((i * 4 * 1024 * 1024)) 512 -p 7002
done
# test vdi creation against disk-full cluster
$DOG vdi create test2 100M -p 7000
$DOG vdi create test3 100M -p 7002
for i in `seq 0 3`; do
$DOG node list -p 700$i
done
_node_info
ls $STORE/*/obj/* | _filter_store | sort
|