55 lines
1.8 KiB
Bash
Executable File
55 lines
1.8 KiB
Bash
Executable File
#!/bin/bash -ex
|
|
|
|
# Kill OSDs while writing
|
|
|
|
PG_SIZE=${PG_SIZE:-3}
|
|
if [[ "$SCHEME" = "ec" ]]; then
|
|
PG_DATA_SIZE=${PG_DATA_SIZE:-2}
|
|
PG_MINSIZE=${PG_MINSIZE:-3}
|
|
fi
|
|
OSD_COUNT=7
|
|
PG_COUNT=32
|
|
. `dirname $0`/run_3osds.sh
|
|
check_qemu
|
|
|
|
IMG_SIZE=128
|
|
|
|
$ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}'
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \
|
|
-mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -cluster_log_level=10
|
|
|
|
kill_osds()
|
|
{
|
|
for i in {1..60}; do
|
|
sleep 5
|
|
K=$((1 + RANDOM % OSD_COUNT))
|
|
eval "kill -9 \$OSD${K}_PID"
|
|
$ETCDCTL del /vitastor/osd/state/$K
|
|
start_osd $K
|
|
done
|
|
}
|
|
|
|
kill_osds &
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=512k -direct=1 -iodepth=8 -fsync=256 -rw=write \
|
|
-refill_buffers=1 -mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -loops=1000 -runtime=120 &>/dev/null &
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=512k -direct=1 -iodepth=8 -fsync=256 -rw=write \
|
|
-refill_buffers=1 -mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -loops=1000 -runtime=120 &>/dev/null &
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=512k -direct=1 -iodepth=8 -fsync=256 -rw=write \
|
|
-refill_buffers=1 -mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -loops=1000 -runtime=120
|
|
|
|
qemu-img convert -S 4096 -p \
|
|
-f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \
|
|
-O raw ./testdata/read.bin
|
|
|
|
diff ./testdata/read.bin ./testdata/mirror.bin
|
|
|
|
format_green OK
|