forked from vitalif/vitastor
Allow to override OSD devices in tests
parent
1a4ceb420d
commit
9a427dd70a
|
@ -7,6 +7,7 @@ PG_COUNT=${PG_COUNT:-1}
|
||||||
# OSD_COUNT
|
# OSD_COUNT
|
||||||
SCHEME=${SCHEME:-replicated}
|
SCHEME=${SCHEME:-replicated}
|
||||||
# OSD_ARGS
|
# OSD_ARGS
|
||||||
|
# OFFSET_ARGS
|
||||||
# PG_SIZE
|
# PG_SIZE
|
||||||
# PG_MINSIZE
|
# PG_MINSIZE
|
||||||
|
|
||||||
|
@ -24,17 +25,31 @@ else
|
||||||
$ETCDCTL put /vitastor/config/global '{"recovery_queue_depth":1,"osd_out_time":1}'
|
$ETCDCTL put /vitastor/config/global '{"recovery_queue_depth":1,"osd_out_time":1}'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
start_osd()
|
start_osd_on()
|
||||||
{
|
{
|
||||||
local i=$1
|
local i=$1
|
||||||
|
local dev=$2
|
||||||
build/src/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS --etcd_address $ETCD_URL \
|
build/src/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS --etcd_address $ETCD_URL \
|
||||||
$(build/src/vitastor-disk simple-offsets --format options ./testdata/test_osd$i.bin $OFFSET_ARGS 2>/dev/null) \
|
$(build/src/vitastor-disk simple-offsets --format options $OFFSET_ARGS $dev $OFFSET_ARGS 2>/dev/null) \
|
||||||
>>./testdata/osd$i.log 2>&1 &
|
>>./testdata/osd$i.log 2>&1 &
|
||||||
eval OSD${i}_PID=$!
|
eval OSD${i}_PID=$!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ! type -t osd_dev; then
|
||||||
|
osd_dev()
|
||||||
|
{
|
||||||
|
local i=$1
|
||||||
|
[[ -f ./testdata/test_osd$i.bin ]] || dd if=/dev/zero of=./testdata/test_osd$i.bin bs=1024 count=1 seek=$((OSD_SIZE*1024-1))
|
||||||
|
echo ./testdata/test_osd$i.bin
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
start_osd()
|
||||||
|
{
|
||||||
|
start_osd_on $1 $(osd_dev $1)
|
||||||
|
}
|
||||||
|
|
||||||
for i in $(seq 1 $OSD_COUNT); do
|
for i in $(seq 1 $OSD_COUNT); do
|
||||||
dd if=/dev/zero of=./testdata/test_osd$i.bin bs=1024 count=1 seek=$((OSD_SIZE*1024-1))
|
|
||||||
start_osd $i
|
start_osd $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -85,7 +100,7 @@ wait_up()
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $OSD_COUNT -gt 0 ]]; then
|
if [[ $OSD_COUNT -gt 0 ]]; then
|
||||||
wait_up 60
|
wait_up 120
|
||||||
fi
|
fi
|
||||||
|
|
||||||
try_reweight()
|
try_reweight()
|
||||||
|
|
|
@ -8,10 +8,7 @@ LD_PRELOAD="build/src/libfio_vitastor.so" \
|
||||||
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -end_fsync=1 \
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -end_fsync=1 \
|
||||||
-rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10
|
-rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10
|
||||||
|
|
||||||
for i in 4; do
|
start_osd 4
|
||||||
dd if=/dev/zero of=./testdata/test_osd$i.bin bs=1024 count=1 seek=$((OSD_SIZE*1024-1))
|
|
||||||
start_osd $i
|
|
||||||
done
|
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue