diff --git a/tests/common.sh b/tests/common.sh index 9b89c9e8..dd3e349c 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -65,7 +65,7 @@ start_etcd() --max-txn-ops=100000 --auto-compaction-retention=10 --auto-compaction-mode=revision &>./testdata/etcd$i.log & eval ETCD${i}_PID=$! else - node mon/mon-main.js $MON_PARAMS --antietcd_port $((ETCD_PORT+2*i-2)) --etcd_address $ETCD_URL --etcd_prefix "/vitastor" --verbose 1 >>./testdata/mon$i.log 2>&1 & + node mon/mon-main.js $MON_PARAMS --antietcd_port $((ETCD_PORT+2*i-2)) --verbose 1 >>./testdata/mon$i.log 2>&1 & eval ETCD${i}_PID=$! fi } @@ -108,12 +108,20 @@ wait_condition() done } +VITASTOR_CFG='"etcd_address":"'$ETCD_URL'"' +echo "{$VITASTOR_CFG}" > ./testdata/vitastor.conf +VITASTOR_CFG=./testdata/vitastor.conf +VITASTOR_CLI="build/src/cmd/vitastor-cli --config_path $VITASTOR_CFG" +# Preload build/src/client/libfio_vitastor.so so libasan detects all symbols +VITASTOR_FIO="env LD_PRELOAD=build/src/client/libfio_vitastor.so fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -conf $VITASTOR_CFG" +OSD_ARGS="$OSD_ARGS --config_path $VITASTOR_CFG" +MON_PARAMS="$MON_PARAMS --config_path $VITASTOR_CFG" + if [[ -n "$ANTIETCD" ]]; then ETCDCTL="node mon/node_modules/.bin/anticli -e $ETCD_URL" MON_PARAMS="--use_antietcd 1 --antietcd_data_dir ./testdata --antietcd_persist_interval 500 $MON_PARAMS" else ETCDCTL="${ETCD}ctl --endpoints=$ETCD_URL --dial-timeout=5s --command-timeout=10s" - MON_PARAMS="$MON_PARAMS" start_etcd_cluster fi diff --git a/tests/run_3osds.sh b/tests/run_3osds.sh index f3dc5362..a223dc9e 100644 --- a/tests/run_3osds.sh +++ b/tests/run_3osds.sh @@ -23,7 +23,7 @@ if [[ -n "$ANTIETCD" ]]; then start_etcd $i done else - node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" --verbose 1 >>./testdata/mon.log 2>&1 & + node mon/mon-main.js $MON_PARAMS --verbose 1 >>./testdata/mon.log 2>&1 & MON_PID=$! fi wait_etcd @@ -40,7 +40,7 @@ start_osd_on() { local i=$1 local dev=$2 - build/src/osd/vitastor-osd --osd_num $i --bind_address $ETCD_IP $NO_SAME $OSD_ARGS --etcd_address $ETCD_URL \ + build/src/osd/vitastor-osd --osd_num $i --bind_address $ETCD_IP $NO_SAME $OSD_ARGS \ $(build/src/disk_tool/vitastor-disk simple-offsets --format options $OFFSET_ARGS $dev $OFFSET_ARGS 2>/dev/null) \ >>./testdata/osd$i.log 2>&1 & eval OSD${i}_PID=$! diff --git a/tests/test_add_osd.sh b/tests/test_add_osd.sh index 5a1d298c..8b0cab3e 100755 --- a/tests/test_add_osd.sh +++ b/tests/test_add_osd.sh @@ -4,9 +4,8 @@ PG_COUNT=2048 GLOBAL_CONFIG=',"osd_out_time":1' . `dirname $0`/run_3osds.sh -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/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 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -end_fsync=1 \ + -rw=write -pool=1 -inode=1 -size=128M -cluster_log_level=10 start_osd 4 @@ -30,7 +29,7 @@ wait_finish_rebalance 60 sleep 1 kill -9 $OSD4_PID sleep 1 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm-osd --force 4 +$VITASTOR_CLI rm-osd --force 4 sleep 2 diff --git a/tests/test_cas.sh b/tests/test_cas.sh index ccc12395..39a88e48 100755 --- a/tests/test_cas.sh +++ b/tests/test_cas.sh @@ -2,6 +2,6 @@ . `dirname $0`/run_3osds.sh -build/src/test/test_cas --pool_id 1 --inode_id 1 --etcd_address $ETCD_URL +build/src/test/test_cas --pool_id 1 --inode_id 1 --config_path $VITASTOR_CFG format_green OK diff --git a/tests/test_change_pg_count.sh b/tests/test_change_pg_count.sh index 6ebc323b..247971f5 100755 --- a/tests/test_change_pg_count.sh +++ b/tests/test_change_pg_count.sh @@ -7,9 +7,8 @@ PG_COUNT=16 NOBJ=$(((128*8+PG_DATA_SIZE-1)/PG_DATA_SIZE)) -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -pool=1 -inode=2 -size=128M -cluster_log_level=10 try_change() { diff --git a/tests/test_change_pg_count_online.sh b/tests/test_change_pg_count_online.sh index e6d4f085..7b607b01 100755 --- a/tests/test_change_pg_count_online.sh +++ b/tests/test_change_pg_count_online.sh @@ -6,13 +6,10 @@ GLOBAL_CONFIG=',"client_retry_interval":1000' . `dirname $0`/run_3osds.sh -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=128M +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write -pool=1 -inode=2 -size=128M -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -rw=randrw \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=128M -loops=100 -cluster_log_level=3 -runtime=60 &>./testdata/fio.log & +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 -rw=randrw -pool=1 -inode=2 -size=128M -loops=100 \ + -cluster_log_level=3 -runtime=60 &>./testdata/fio.log & FIO_PID=$! try_change() diff --git a/tests/test_checksum.sh b/tests/test_checksum.sh index 8a3d8418..aea55962 100755 --- a/tests/test_checksum.sh +++ b/tests/test_checksum.sh @@ -11,9 +11,8 @@ IMG_SIZE=128 $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}' # Write -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 \ - -mirror_file=./testdata/bin/mirror.bin -end_fsync=1 -rw=write -etcd=$ETCD_URL -image=testimg -runtime=10 +$VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 \ + -mirror_file=./testdata/bin/mirror.bin -end_fsync=1 -rw=write -image=testimg -runtime=10 # Intentionally corrupt OSD data and restart it kill $OSD1_PID @@ -29,7 +28,7 @@ wait_up 10 # Read everything back qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg" \ -O raw ./testdata/bin/read.bin diff ./testdata/bin/read.bin ./testdata/bin/mirror.bin diff --git a/tests/test_create_halfhost.sh b/tests/test_create_halfhost.sh index c37b9057..210a7c8c 100755 --- a/tests/test_create_halfhost.sh +++ b/tests/test_create_halfhost.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd @@ -28,8 +28,8 @@ $ETCDCTL put /vitastor/osd/stats/3 '{"host":"host2","size":1073741824,"time":"'$ $ETCDCTL put /vitastor/osd/stats/4 '{"host":"host2","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/5 '{"host":"host3","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/6 '{"host":"host3","size":1073741824,"time":"'$TIME'"}' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL osd-tree +$VITASTOR_CLI osd-tree # check that it doesn't fail -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool --ec 2+1 -n 32 +$VITASTOR_CLI create-pool testpool --ec 2+1 -n 32 format_green OK diff --git a/tests/test_create_nomaxid.sh b/tests/test_create_nomaxid.sh index 03a85f07..7c52cbcc 100755 --- a/tests/test_create_nomaxid.sh +++ b/tests/test_create_nomaxid.sh @@ -6,7 +6,7 @@ $ETCDCTL put /vitastor/config/inode/1/120 '{"name":"testimg","size":'$((1024*1024*1024))'}' -build/src/cmd/vitastor-cli create --etcd_address $ETCD_URL -s 1G testimg2 +$VITASTOR_CLI create -s 1G testimg2 t=$($ETCDCTL get --print-value-only /vitastor/config/inode/1/121 | jq -r .name) if [[ "$t" != "testimg2" ]]; then diff --git a/tests/test_dd.sh b/tests/test_dd.sh index 87346b98..4804a87b 100755 --- a/tests/test_dd.sh +++ b/tests/test_dd.sh @@ -4,17 +4,17 @@ # pipe in - pipe out dd if=/dev/urandom of=./testdata/testfile bs=1M count=128 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd oimg=testimg iodepth=4 bs=1M count=128 < ./testdata/testfile -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testimg iodepth=4 bs=1M count=128 > ./testdata/testfile1 +$VITASTOR_CLI dd oimg=testimg iodepth=4 bs=1M count=128 < ./testdata/testfile +$VITASTOR_CLI dd iimg=testimg iodepth=4 bs=1M count=128 > ./testdata/testfile1 diff ./testdata/testfile ./testdata/testfile1 rm ./testdata/testfile1 # snapshot dd if=/dev/urandom of=./testdata/over bs=1M count=4 dd if=./testdata/over of=./testdata/testfile bs=1M seek=17 conv=notrunc -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testimg@snap1 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iodepth=4 if=./testdata/over oimg=testimg bs=1M seek=17 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iodepth=4 iimg=testimg of=./testdata/testfile1 +$VITASTOR_CLI snap-create testimg@snap1 +$VITASTOR_CLI dd iodepth=4 if=./testdata/over oimg=testimg bs=1M seek=17 +$VITASTOR_CLI dd iodepth=4 iimg=testimg of=./testdata/testfile1 diff ./testdata/testfile ./testdata/testfile1 format_green OK diff --git a/tests/test_degraded.sh b/tests/test_degraded.sh index f070e021..3590410c 100755 --- a/tests/test_degraded.sh +++ b/tests/test_degraded.sh @@ -15,9 +15,8 @@ for i in $(seq 1 $OSD_COUNT); do done wait_up 120 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -rw=randwrite -loops=1000 \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=256M -cluster_log_level=10 -runtime=5 & +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 -rw=randwrite -loops=1000 \ + -pool=1 -inode=2 -size=256M -cluster_log_level=10 -runtime=5 & FIO_PID=$! sleep 15 diff --git a/tests/test_enospc.sh b/tests/test_enospc.sh index 138d28cb..16f0ec00 100755 --- a/tests/test_enospc.sh +++ b/tests/test_enospc.sh @@ -5,23 +5,21 @@ GLOBAL_CONFIG=',"client_retry_enospc":false' . `dirname $0`/run_3osds.sh -export LD_PRELOAD="build/src/client/libfio_vitastor.so" - # Should fail with ENOSPC -if fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 \ - -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=500M -cluster_log_level=10; then +if $VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 \ + -rw=write -pool=1 -inode=1 -size=500M -cluster_log_level=10; then format_error "Should get ENOSPC, but didn't" fi # Should fail with ENOSPC too (the idea is to try to overwrite first objects to check their rollback) -if fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=32 \ - -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=500M -cluster_log_level=10; then +if $VITASTOR_FIO -bs=1M -direct=1 -iodepth=32 \ + -rw=write -pool=1 -inode=1 -size=500M -cluster_log_level=10; then format_error "Should get ENOSPC, but didn't" fi # Should complete OK -if ! fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=100M -cluster_log_level=10 -number_ios=4096; then +if ! $VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 \ + -rw=randwrite -pool=1 -inode=1 -size=100M -cluster_log_level=10 -number_ios=4096; then format_error "Should do random writes over ENOSPC correctly, but got an error" fi diff --git a/tests/test_etcd_fail.sh b/tests/test_etcd_fail.sh index 725132db..64619c4e 100755 --- a/tests/test_etcd_fail.sh +++ b/tests/test_etcd_fail.sh @@ -5,9 +5,8 @@ ETCD_COUNT=5 . `dirname $0`/run_3osds.sh -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=randwrite \ - -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=randwrite \ + -pool=1 -inode=1 -size=128M -cluster_log_level=10 kill_etcds() { @@ -26,8 +25,7 @@ kill_etcds() kill_etcds & -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=1 -rw=randwrite \ - -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10 -runtime=30 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=1 -rw=randwrite \ + -pool=1 -inode=1 -size=128M -cluster_log_level=10 -runtime=30 format_green OK diff --git a/tests/test_failure_domain.sh b/tests/test_failure_domain.sh index 457f11f6..912c819f 100755 --- a/tests/test_failure_domain.sh +++ b/tests/test_failure_domain.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd @@ -17,13 +17,13 @@ $ETCDCTL put /vitastor/osd/stats/5 '{"host":"host3","size":1073741824,"time":"'$ $ETCDCTL put /vitastor/osd/stats/6 '{"host":"host3","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/7 '{"host":"host4","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/8 '{"host":"host4","size":1073741824,"time":"'$TIME'"}' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool --ec 3+2 -n 32 --failure_domain rack --force +$VITASTOR_CLI create-pool testpool --ec 3+2 -n 32 --failure_domain rack --force $ETCDCTL get --print-value-only /vitastor/config/pools | jq -s -e '. == [{"1": {"failure_domain": "rack", "name": "testpool", "parity_chunks": 2, "pg_count": 32, "pg_minsize": 4, "pg_size": 5, "scheme": "ec"}}]' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL modify-pool testpool --ec 3+3 --failure_domain host +$VITASTOR_CLI modify-pool testpool --ec 3+3 --failure_domain host $ETCDCTL get --print-value-only /vitastor/config/pools | jq -s -e '. == [{"1": {"failure_domain": "host", "name": "testpool", "parity_chunks": 3, "pg_count": 32, "pg_minsize": 4, "pg_size": 6, "scheme": "ec"}}]' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm-pool testpool +$VITASTOR_CLI rm-pool testpool $ETCDCTL get --print-value-only /vitastor/config/pools | jq -s -e '. == [{}]' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool -s 2 -n 4 --failure_domain rack --force +$VITASTOR_CLI create-pool testpool -s 2 -n 4 --failure_domain rack --force $ETCDCTL get --print-value-only /vitastor/config/pools | jq -s -e '. == [{"1":{"name":"testpool","scheme":"replicated","pg_size":2,"pg_minsize":1,"pg_count":4,"failure_domain":"rack"}}]' sleep 2 @@ -32,9 +32,9 @@ $ETCDCTL get --prefix /vitastor/pg/config --print-value-only | \ jq -s -e '([ .[0].items["1"] | .[].osd_set | map_values(. | tonumber) | select((.[0] <= 4) != (.[1] <= 4)) ] | length) == 4' # test pool with size 1 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool size1pool -s 1 -n 1 --force +$VITASTOR_CLI create-pool size1pool -s 1 -n 1 --force wait_condition 10 "$ETCDCTL get --prefix /vitastor/pg/config --print-value-only | jq -s -e '.[0].items["'"'"2"'"'"]'" -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL modify-pool size1pool -s 2 --force +$VITASTOR_CLI modify-pool size1pool -s 2 --force format_green OK diff --git a/tests/test_heal.sh b/tests/test_heal.sh index 84731fee..7d0cdb72 100755 --- a/tests/test_heal.sh +++ b/tests/test_heal.sh @@ -18,9 +18,8 @@ IMG_SIZE=960 $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}' -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -mirror_file=./testdata/bin/mirror.bin -etcd=$ETCD_URL -image=testimg -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -mirror_file=./testdata/bin/mirror.bin -image=testimg -cluster_log_level=10 kill_osds() { @@ -51,12 +50,11 @@ kill_osds() kill_osds & -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bsrange=4k-128k -blockalign=4k -direct=1 -iodepth=32 -fsync=256 -rw=randrw \ - -serialize_overlap=1 -randrepeat=0 -refill_buffers=1 -mirror_file=./testdata/bin/mirror.bin -etcd=$ETCD_URL -image=testimg -loops=10 -runtime=120 +$VITASTOR_FIO -bsrange=4k-128k -blockalign=4k -direct=1 -iodepth=32 -fsync=256 -rw=randrw \ + -serialize_overlap=1 -randrepeat=0 -refill_buffers=1 -mirror_file=./testdata/bin/mirror.bin -image=testimg -loops=10 -runtime=120 qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg" \ -O raw ./testdata/bin/read.bin if ! diff -q ./testdata/bin/read.bin ./testdata/bin/mirror.bin; then diff --git a/tests/test_interrupted_rebalance.sh b/tests/test_interrupted_rebalance.sh index f6b9bfdd..8993f8ec 100755 --- a/tests/test_interrupted_rebalance.sh +++ b/tests/test_interrupted_rebalance.sh @@ -6,9 +6,8 @@ PG_COUNT=32 IMG_SIZE=960 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=16 -fsync=16 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=${IMG_SIZE}M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=16 -fsync=16 -rw=write \ + -pool=1 -inode=2 -size=${IMG_SIZE}M -cluster_log_level=10 try_reweight 1 0 diff --git a/tests/test_kv_stress.sh b/tests/test_kv_stress.sh index efc06aa8..10a6b752 100755 --- a/tests/test_kv_stress.sh +++ b/tests/test_kv_stress.sh @@ -3,6 +3,6 @@ PG_COUNT=16 . `dirname $0`/run_3osds.sh -build/src/kv/vitastor-kv-stress --etcd_address $ETCD_URL --pool_id 1 --inode_id 1 --runtime 30 +build/src/kv/vitastor-kv-stress --config_path $VITASTOR_CFG --pool_id 1 --inode_id 1 --runtime 30 format_green OK diff --git a/tests/test_level_placement.sh b/tests/test_level_placement.sh index 2de292c3..82959feb 100755 --- a/tests/test_level_placement.sh +++ b/tests/test_level_placement.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd @@ -29,7 +29,7 @@ $ETCDCTL put /vitastor/osd/stats/13 '{"host":"host7","size":1073741824,"time":"' $ETCDCTL put /vitastor/osd/stats/14 '{"host":"host7","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/15 '{"host":"host8","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/16 '{"host":"host8","size":1073741824,"time":"'$TIME'"}' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool --failure_domain host --level_placement rack=112233 --ec 4+2 -n 32 +$VITASTOR_CLI create-pool testpool --failure_domain host --level_placement rack=112233 --ec 4+2 -n 32 sleep 2 $ETCDCTL get --prefix /vitastor/pg/config --print-value-only | \ jq -s -e '([ .[0].items["1"] | .[].osd_set | map_values(. | tonumber) | select( diff --git a/tests/test_move_reappear.sh b/tests/test_move_reappear.sh index a5f7841b..03baaf19 100755 --- a/tests/test_move_reappear.sh +++ b/tests/test_move_reappear.sh @@ -10,7 +10,7 @@ OSD_ARGS="$OSD_ARGS" for i in $(seq 1 $OSD_COUNT); do dd if=/dev/zero of=./testdata/bin/test_osd$i.bin bs=1024 count=1 seek=$((OSD_SIZE*1024-1)) build/src/osd/vitastor-osd --log_level 10 --osd_num $i --bind_address 127.0.0.1 --etcd_stats_interval 5 $OSD_ARGS \ - --etcd_address $ETCD_URL $(build/src/disk_tool/vitastor-disk simple-offsets --format options ./testdata/bin/test_osd$i.bin $OFFSET_ARGS 2>/dev/null) >>./testdata/osd$i.log 2>&1 & + $(build/src/disk_tool/vitastor-disk simple-offsets --format options ./testdata/bin/test_osd$i.bin $OFFSET_ARGS 2>/dev/null) >>./testdata/osd$i.log 2>&1 & eval OSD${i}_PID=$! done @@ -27,9 +27,8 @@ for i in {1..30}; do fi done -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=32M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -pool=1 -inode=2 -size=32M -cluster_log_level=10 $ETCDCTL put /vitastor/pg/config '{"items":{"1":{"1":{"osd_set":[1,0],"primary":0}}}}' @@ -57,9 +56,8 @@ for i in {1..30}; do done # Sync so all moved objects are removed from OSD 1 (they aren't removed without a sync) -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=1 -number_ios=2 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=32M -cluster_log_level=10 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=1 -number_ios=2 -rw=write \ + -pool=1 -inode=2 -size=32M -cluster_log_level=10 $ETCDCTL put /vitastor/pg/config '{"items":{"1":{"1":{"osd_set":[4,5],"primary":0}}}}' diff --git a/tests/test_nfs.sh b/tests/test_nfs.sh index 9be24213..90f84e55 100755 --- a/tests/test_nfs.sh +++ b/tests/test_nfs.sh @@ -5,9 +5,9 @@ IMMEDIATE_COMMIT=1 PG_COUNT=16 . `dirname $0`/run_3osds.sh -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 10G fsmeta -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL modify-pool --used-for-app fs:fsmeta testpool -build/src/nfs/vitastor-nfs start --fs fsmeta --etcd_address $ETCD_URL --portmap 0 --port 2050 --foreground 1 --trace 1 >>./testdata/nfs.log 2>&1 & +$VITASTOR_CLI create -s 10G fsmeta +$VITASTOR_CLI modify-pool --used-for-app fs:fsmeta testpool +build/src/nfs/vitastor-nfs --config_path $VITASTOR_CFG start --fs fsmeta --portmap 0 --port 2050 --foreground 1 --trace 1 >>./testdata/nfs.log 2>&1 & NFS_PID=$! mkdir -p testdata/nfs @@ -175,22 +175,22 @@ format_green "rename over existing file ok" # check listing and removal of a bad direntry sudo umount ./testdata/nfs/ -build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta set d11/settings.jsonLGNmGn '{"ino": 123}' +build/src/kv/vitastor-kv --config_path $VITASTOR_CFG fsmeta set d11/settings.jsonLGNmGn '{"ino": 123}' sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp ls -l ./testdata/nfs ls -l ./testdata/nfs/settings.jsonLGNmGn sudo rm ./testdata/nfs/settings.jsonLGNmGn -build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)' +build/src/kv/vitastor-kv --config_path $VITASTOR_CFG fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)' ls -l ./testdata/nfs # repeat with ino=0 sudo umount ./testdata/nfs/ -build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta set d11/settings.jsonLGNmGn '{"ino": 0}' +build/src/kv/vitastor-kv --config_path $VITASTOR_CFG fsmeta set d11/settings.jsonLGNmGn '{"ino": 0}' sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp ls -l ./testdata/nfs ls -l ./testdata/nfs/settings.jsonLGNmGn sudo rm ./testdata/nfs/settings.jsonLGNmGn -build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)' +build/src/kv/vitastor-kv --config_path $VITASTOR_CFG fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)' ls -l ./testdata/nfs format_green OK diff --git a/tests/test_nfs_unaligned_append.sh b/tests/test_nfs_unaligned_append.sh index 79ee70df..6c4d2de2 100755 --- a/tests/test_nfs_unaligned_append.sh +++ b/tests/test_nfs_unaligned_append.sh @@ -5,9 +5,9 @@ IMMEDIATE_COMMIT=1 PG_COUNT=16 . `dirname $0`/run_3osds.sh -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 10G fsmeta -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL modify-pool --used-for-app fs:fsmeta testpool -build/src/nfs/vitastor-nfs start --fs fsmeta --etcd_address $ETCD_URL --portmap 0 --port 2050 --foreground 1 --trace 1 >>./testdata/nfs.log 2>&1 & +$VITASTOR_CLI create -s 10G fsmeta +$VITASTOR_CLI modify-pool --used-for-app fs:fsmeta testpool +build/src/nfs/vitastor-nfs --config_path $VITASTOR_CFG start --fs fsmeta --portmap 0 --port 2050 --foreground 1 --trace 1 >>./testdata/nfs.log 2>&1 & NFS_PID=$! mkdir -p testdata/nfs @@ -16,16 +16,16 @@ MNT=$(pwd)/testdata/nfs trap "sudo umount -f $MNT"' || true; kill -9 $(jobs -p)' EXIT # big file -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd if=/dev/urandom of=./testdata/ref_data.bin bs=1M count=32 seek=1024B -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd if=./testdata/ref_data.bin of=$MNT/testfile oflag=direct bs=1M iodepth=4 seek=1024B skip=1024B +$VITASTOR_CLI dd if=/dev/urandom of=./testdata/ref_data.bin bs=1M count=32 seek=1024B +$VITASTOR_CLI dd if=./testdata/ref_data.bin of=$MNT/testfile oflag=direct bs=1M iodepth=4 seek=1024B skip=1024B cp $MNT/testfile ./testdata/nfs_data.bin if ! diff -q ./testdata/ref_data.bin $MNT/testfile; then format_error 'Data lost during parallel unaligned writes to VitastorFS' fi # small shared file -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd if=/dev/urandom of=./testdata/ref_small.bin bs=10 count=500 seek=15B -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd if=./testdata/ref_small.bin of=$MNT/smallfile oflag=direct bs=10 iodepth=4 seek=15B skip=15B +$VITASTOR_CLI dd if=/dev/urandom of=./testdata/ref_small.bin bs=10 count=500 seek=15B +$VITASTOR_CLI dd if=./testdata/ref_small.bin of=$MNT/smallfile oflag=direct bs=10 iodepth=4 seek=15B skip=15B cp $MNT/smallfile ./testdata/nfs_small.bin if ! diff -q ./testdata/ref_small.bin $MNT/smallfile; then format_error 'Data lost during parallel unaligned writes to a small file in VitastorFS' diff --git a/tests/test_osd_tags.sh b/tests/test_osd_tags.sh index 6def3332..72f44c71 100755 --- a/tests/test_osd_tags.sh +++ b/tests/test_osd_tags.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd diff --git a/tests/test_parity_change.sh b/tests/test_parity_change.sh index 0453c291..1da4b332 100755 --- a/tests/test_parity_change.sh +++ b/tests/test_parity_change.sh @@ -39,9 +39,7 @@ try_change() fi } -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 \ - -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 +$VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 -rw=write -pool=1 -inode=1 -size=128M -runtime=10 PG_SIZE=7 POOLCFG='"name":"testpool","failure_domain":"osd","scheme":"ec","parity_chunks":'$((PG_SIZE-PG_DATA_SIZE)) diff --git a/tests/test_rebalance_verify.sh b/tests/test_rebalance_verify.sh index c0c553d7..8b507dd7 100755 --- a/tests/test_rebalance_verify.sh +++ b/tests/test_rebalance_verify.sh @@ -10,7 +10,7 @@ IMG_SIZE=256 $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}' -NBD_DEV=$(sudo build/src/client/vitastor-nbd map --nbd_timeout 180 --etcd_address $ETCD_URL --image testimg --logfile ./testdata/nbd.log &) +NBD_DEV=$(sudo build/src/client/vitastor-nbd map --nbd_timeout 180 --config_path $VITASTOR_CFG --image testimg --logfile ./testdata/nbd.log &) trap "sudo build/src/client/vitastor-nbd unmap $NBD_DEV"' || true; kill -9 $(jobs -p)' EXIT diff --git a/tests/test_resize.sh b/tests/test_resize.sh index fd6c1b62..fde7b379 100755 --- a/tests/test_resize.sh +++ b/tests/test_resize.sh @@ -5,16 +5,14 @@ PG_COUNT=${PG_COUNT:-32} . `dirname $0`/run_3osds.sh check_qemu -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=4 \ - -rw=write -etcd=$ETCD_URL -end_fsync=1 -pool=1 -inode=1 -size=256M -runtime=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=4 \ + -rw=write -end_fsync=1 -pool=1 -inode=1 -size=256M -runtime=10 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=32 \ - -rw=randwrite -etcd=$ETCD_URL -end_fsync=1 -pool=1 -inode=1 -size=256M -runtime=10 -number_ios=1024 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=32 \ + -rw=randwrite -end_fsync=1 -pool=1 -inode=1 -size=256M -runtime=10 -number_ios=1024 qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=1:size=$((256*1024*1024))" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=1:size=$((256*1024*1024))" \ -O raw ./testdata/bin/before.bin for i in $(seq 1 $OSD_COUNT); do @@ -72,7 +70,7 @@ done $ETCDCTL del --prefix /vitastor/osd/state/ for i in $(seq 1 $OSD_COUNT); do - build/src/osd/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS --etcd_address $ETCD_URL \ + build/src/osd/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS \ --meta_format $meta_format \ --data_device ./testdata/bin/test_osd$i.bin \ --meta_offset 0 \ @@ -82,7 +80,7 @@ for i in $(seq 1 $OSD_COUNT); do done qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=1:size=$((256*1024*1024))" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=1:size=$((256*1024*1024))" \ -O raw ./testdata/bin/after.bin if ! cmp ./testdata/bin/before.bin ./testdata/bin/after.bin; then diff --git a/tests/test_reweight_half.sh b/tests/test_reweight_half.sh index 6c007f06..a9b14265 100755 --- a/tests/test_reweight_half.sh +++ b/tests/test_reweight_half.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd @@ -11,7 +11,7 @@ $ETCDCTL put /vitastor/osd/stats/1 '{"host":"host1","size":1073741824,"time":"'$ $ETCDCTL put /vitastor/osd/stats/2 '{"host":"host1","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/3 '{"host":"host2","size":1073741824,"time":"'$TIME'"}' $ETCDCTL put /vitastor/osd/stats/4 '{"host":"host2","size":1073741824,"time":"'$TIME'"}' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool -s 2 -n 16 --force +$VITASTOR_CLI create-pool testpool -s 2 -n 16 --force sleep 2 @@ -25,7 +25,7 @@ $ETCDCTL get /vitastor/pg/config --print-value-only | \ $ETCDCTL get /vitastor/pg/config --print-value-only | \ jq -s -e '([ .[0].items["1"] | .[].osd_set | map_values(. | tonumber) | select(.[0] == 4 or .[1] == 4) ] | length) == 8' -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL modify-osd --reweight 0.5 3 +$VITASTOR_CLI modify-osd --reweight 0.5 3 sleep 2 diff --git a/tests/test_rm.sh b/tests/test_rm.sh index e8facef9..5f05f0be 100755 --- a/tests/test_rm.sh +++ b/tests/test_rm.sh @@ -3,12 +3,11 @@ PG_COUNT=16 . `dirname $0`/run_3osds.sh -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 \ - -end_fsync=1 -fsync=1 -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 \ + -end_fsync=1 -fsync=1 -rw=write -pool=1 -inode=1 -size=128M -cluster_log_level=10 $ETCDCTL get --prefix '/vitastor/pg/state' -build/src/cmd/vitastor-cli rm-data --etcd_address $ETCD_URL --pool 1 --inode 1 +$VITASTOR_CLI rm-data --pool 1 --inode 1 format_green OK diff --git a/tests/test_rm_degraded.sh b/tests/test_rm_degraded.sh index 6c24f767..724153d7 100755 --- a/tests/test_rm_degraded.sh +++ b/tests/test_rm_degraded.sh @@ -5,20 +5,19 @@ PG_COUNT=16 PG_MINSIZE=2 . `dirname $0`/run_3osds.sh -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 128M testimg +$VITASTOR_CLI create -s 128M testimg -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 \ - -end_fsync=1 -fsync=1 -rw=write -etcd=$ETCD_URL -image=testimg -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 \ + -end_fsync=1 -fsync=1 -rw=write -image=testimg -size=128M -cluster_log_level=10 kill -9 $OSD3_PID $ETCDCTL del /vitastor/osd/state/3 -if build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm testimg --log_level 10 ; then +if $VITASTOR_CLI rm testimg --log_level 10 ; then format_error "Delete should not be successful with inactive OSDs" fi -if ! ( build/src/cmd/vitastor-cli --etcd_address $ETCD_URL ls | grep testimg | grep DEL ) ; then +if ! ( $VITASTOR_CLI ls | grep testimg | grep DEL ) ; then format_error "Image should be marked as partially deleted" fi @@ -27,17 +26,16 @@ sleep 5 # Now do the same but without del /vitastor/osd/state -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 \ - -end_fsync=1 -fsync=1 -rw=write -etcd=$ETCD_URL -image=testimg -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 \ + -end_fsync=1 -fsync=1 -rw=write -image=testimg -size=128M -cluster_log_level=10 kill -9 $OSD3_PID -if build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm testimg --log_level 10 ; then +if $VITASTOR_CLI rm testimg --log_level 10 ; then format_error "Delete should not be successful with inactive OSDs" fi -if ! ( build/src/cmd/vitastor-cli --etcd_address $ETCD_URL ls | grep testimg | grep DEL ) ; then +if ! ( $VITASTOR_CLI ls | grep testimg | grep DEL ) ; then format_error "Image should be marked as partially deleted" fi diff --git a/tests/test_root_node.sh b/tests/test_root_node.sh index c215aaff..5392511a 100755 --- a/tests/test_root_node.sh +++ b/tests/test_root_node.sh @@ -2,7 +2,7 @@ . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd diff --git a/tests/test_scrub.sh b/tests/test_scrub.sh index defdbd35..c4694d20 100755 --- a/tests/test_scrub.sh +++ b/tests/test_scrub.sh @@ -20,9 +20,8 @@ check_qemu $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}' # Write -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 \ - -mirror_file=./testdata/bin/mirror.bin -end_fsync=1 -rw=write -etcd=$ETCD_URL -image=testimg +$VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 \ + -mirror_file=./testdata/bin/mirror.bin -end_fsync=1 -rw=write -image=testimg sleep 1 @@ -55,23 +54,23 @@ wait_condition 300 "$ETCDCTL get --prefix /vitastor/pg/history/ --print-value-on if [[ ($SCHEME = replicated && $PG_SIZE < 3) || ($SCHEME != replicated && $((PG_SIZE-PG_DATA_SIZE)) < 2) ]]; then # Check that objects are marked as inconsistent if 2 replicas or EC/XOR 2+1 - build/src/cmd/vitastor-cli describe --etcd_address $ETCD_URL --json &>./testdata/describe.log - build/src/cmd/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '[ .[] | select(.inconsistent) ] | length == '$((IMG_SIZE * 8 * PG_SIZE / (SCHEME = replicated ? 1 : PG_DATA_SIZE))) + $VITASTOR_CLI describe --json &>./testdata/describe.log + $VITASTOR_CLI describe --json | jq -e '[ .[] | select(.inconsistent) ] | length == '$((IMG_SIZE * 8 * PG_SIZE / (SCHEME = replicated ? 1 : PG_DATA_SIZE))) # Fix objects using vitastor-cli fix - build/src/cmd/vitastor-cli describe --etcd_address $ETCD_URL --json | \ + $VITASTOR_CLI describe --json | \ jq -s '[ .[0][] | select(.inconsistent and .osd_num == '$ZERO_OSD') ]' | \ - build/src/cmd/vitastor-cli fix --etcd_address $ETCD_URL --bad_osds $ZERO_OSD + $VITASTOR_CLI fix --bad_osds $ZERO_OSD elif [[ ($SCHEME = replicated && $PG_SIZE > 2) || ($SCHEME != replicated && $((PG_SIZE-PG_DATA_SIZE)) > 1) ]]; then # Check that everything heals wait_finish_rebalance 300 - build/src/cmd/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '. | length == 0' + $VITASTOR_CLI describe --json | jq -e '. | length == 0' fi # Read everything back qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg" \ -O raw ./testdata/bin/read.bin diff ./testdata/bin/read.bin ./testdata/bin/mirror.bin diff --git a/tests/test_snapshot.sh b/tests/test_snapshot.sh index fef1ed84..0e8f5e1d 100755 --- a/tests/test_snapshot.sh +++ b/tests/test_snapshot.sh @@ -7,43 +7,39 @@ check_qemu $ETCDCTL put /vitastor/config/inode/1/2 '{"name":"testimg","size":'$((32*1024*1024))'}' -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -pool=1 -inode=2 -size=32M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -pool=1 -inode=2 -size=32M -cluster_log_level=10 $ETCDCTL put /vitastor/config/inode/1/2 '{"name":"testimg@0","size":'$((32*1024*1024))'}' $ETCDCTL put /vitastor/config/inode/1/3 '{"parent_id":2,"name":"testimg","size":'$((32*1024*1024))'}' -# Preload build/src/client/libfio_vitastor.so so libasan detects all symbols -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=32 -buffer_pattern=0xdeadface \ - -rw=randwrite -etcd=$ETCD_URL -image=testimg -number_ios=1024 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=32 -buffer_pattern=0xdeadface \ + -rw=randwrite -image=testimg -number_ios=1024 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -rw=read -etcd=$ETCD_URL -pool=1 -inode=3 -size=32M +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -rw=read -pool=1 -inode=3 -size=32M qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=2:size=$((32*1024*1024)):skip-parents=1" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=2:size=$((32*1024*1024)):skip-parents=1" \ -O qcow2 ./testdata/layer0.qcow2 qemu-img create -f qcow2 ./testdata/empty.qcow2 32M qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=3:size=$((32*1024*1024)):skip-parents=1" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=3:size=$((32*1024*1024)):skip-parents=1" \ -O qcow2 -o 'cluster_size=4k,backing_fmt=qcow2' -B empty.qcow2 ./testdata/layer1.qcow2 qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=3:size=$((32*1024*1024))" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=3:size=$((32*1024*1024))" \ -O raw ./testdata/bin/merged.bin qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg@0" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg@0" \ -O raw ./testdata/bin/layer0.bin $ETCDCTL put /vitastor/config/inode/1/3 '{"name":"testimg","size":'$((32*1024*1024))'}' qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg" \ -O raw ./testdata/bin/layer1.bin node tests/merge.js ./testdata/bin/layer0.bin ./testdata/bin/layer1.bin ./testdata/bin/check.bin @@ -54,10 +50,10 @@ cmp ./testdata/bin/merged.bin ./testdata/bin/check.bin $ETCDCTL put /vitastor/config/inode/1/3 '{"parent_id":2,"name":"testimg","size":'$((32*1024*1024))'}' -build/src/cmd/vitastor-cli rm --etcd_address $ETCD_URL testimg@0 +$VITASTOR_CLI rm testimg@0 qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testimg" \ -O raw ./testdata/bin/merged-by-tool.bin cmp ./testdata/bin/merged.bin ./testdata/bin/merged-by-tool.bin diff --git a/tests/test_snapshot_chain.sh b/tests/test_snapshot_chain.sh index 744c949e..4ae95455 100755 --- a/tests/test_snapshot_chain.sh +++ b/tests/test_snapshot_chain.sh @@ -5,43 +5,41 @@ check_qemu # Test multiple snapshots -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 32M testchain +$VITASTOR_CLI create -s 32M testchain -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin for i in {1..10}; do # Create a snapshot - build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@$i + $VITASTOR_CLI snap-create testchain@$i # Check that the new snapshot is see-through qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/check.bin cmp ./testdata/bin/check.bin ./testdata/bin/mirror.bin # Write something to it - LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=32 -rw=randwrite \ + $VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=32 -rw=randwrite \ -randrepeat=$((i <= 2)) -buffer_pattern=0x$((10+i))$((10+i))$((10+i))$((10+i)) \ - -etcd=$ETCD_URL -image=testchain -number_ios=1024 -mirror_file=./testdata/bin/mirror.bin + -image=testchain -number_ios=1024 -mirror_file=./testdata/bin/mirror.bin # Check the new content qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/layer1.bin cmp ./testdata/bin/layer1.bin ./testdata/bin/mirror.bin done -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm testchain@1 testchain@9 +$VITASTOR_CLI rm testchain@1 testchain@9 # Check the final image qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/layer1.bin cmp ./testdata/bin/layer1.bin ./testdata/bin/mirror.bin # Check the last remaining snapshot qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain@10" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain@10" \ -O raw ./testdata/bin/layer0.bin cmp ./testdata/bin/layer0.bin ./testdata/bin/check.bin diff --git a/tests/test_snapshot_down.sh b/tests/test_snapshot_down.sh index 9a5e6af3..d20420d4 100755 --- a/tests/test_snapshot_down.sh +++ b/tests/test_snapshot_down.sh @@ -5,32 +5,30 @@ check_qemu # Test merge to child (without "inverse rename" optimisation) -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 128M testchain +$VITASTOR_CLI create -s 128M testchain -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin # Create a snapshot -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@0 +$VITASTOR_CLI snap-create testchain@0 # Write something to it -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ -fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 -rw=randwrite \ - -randrepeat=0 -etcd=$ETCD_URL -image=testchain -number_ios=8 -mirror_file=./testdata/bin/mirror.bin +$VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 -rw=randwrite \ + -randrepeat=0 -image=testchain -number_ios=8 -mirror_file=./testdata/bin/mirror.bin # Check the new content qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/layer1.bin cmp ./testdata/bin/layer1.bin ./testdata/bin/mirror.bin # Merge -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL rm testchain@0 +$VITASTOR_CLI rm testchain@0 # Check the final image qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/layer1.bin cmp ./testdata/bin/layer1.bin ./testdata/bin/mirror.bin diff --git a/tests/test_snapshot_pool2.sh b/tests/test_snapshot_pool2.sh index 15e7e402..48c82a5f 100755 --- a/tests/test_snapshot_pool2.sh +++ b/tests/test_snapshot_pool2.sh @@ -5,46 +5,43 @@ check_qemu # snapshot in another pool -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create-pool testpool2 -s 3 -n 4 --failure_domain osd +$VITASTOR_CLI create-pool testpool2 -s 3 -n 4 --failure_domain osd wait_pool_up 30 2 3 4 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 128M testchain -p testpool +$VITASTOR_CLI create -s 128M testchain -p testpool -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=1M -direct=1 -iodepth=4 -fsync=1 -rw=write \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 +$VITASTOR_FIO -bs=1M -direct=1 -iodepth=4 -fsync=1 -rw=write \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@snap1 -p testpool2 +$VITASTOR_CLI snap-create testchain@snap1 -p testpool2 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 # Read from the first snapshot -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 --log_level 10 +$VITASTOR_CLI dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 --log_level 10 cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin # Create a second snapshot - there was a bug where snapshotted reads from another pool # were working only when the image and the snapshot were modified in the same revision # (i.e. there was only one snapshot) -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@snap2 -p testpool2 +$VITASTOR_CLI snap-create testchain@snap2 -p testpool2 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin -randrepeat=0 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 --log_level 10 +$VITASTOR_CLI dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 --log_level 10 cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=32k iodepth=4 conv=nosparse +$VITASTOR_CLI dd iimg=testchain of=./testdata/bin/res.bin bs=32k iodepth=4 conv=nosparse cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/res.bin cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin diff --git a/tests/test_snapshot_read_bitmap.sh b/tests/test_snapshot_read_bitmap.sh index 863ade5e..032514f6 100755 --- a/tests/test_snapshot_read_bitmap.sh +++ b/tests/test_snapshot_read_bitmap.sh @@ -4,34 +4,32 @@ SCHEME=${SCHEME:-ec} . `dirname $0`/run_3osds.sh check_qemu -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL create -s 128M testchain +$VITASTOR_CLI create -s 128M testchain dd if=/dev/zero of=./testdata/bin/mirror.bin bs=4k seek=$(((128*1024-4)/4)) count=1 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=32k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd -number_ios=1024 +$VITASTOR_FIO -bs=32k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd -number_ios=1024 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@snap1 +$VITASTOR_CLI snap-create testchain@snap1 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ - -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ + -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd # Now read from the snapshot dd if=/dev/zero of=./testdata/bin/res.bin bs=4k seek=$(((128*1024-4)/4)) count=1 -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=$((PG_DATA_SIZE*128))k iodepth=4 --log_level 10 +$VITASTOR_CLI dd iimg=testchain of=./testdata/bin/res.bin bs=$((PG_DATA_SIZE*128))k iodepth=4 --log_level 10 cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=$((PG_DATA_SIZE*128))k iodepth=4 conv=nosparse +$VITASTOR_CLI dd iimg=testchain of=./testdata/bin/res.bin bs=$((PG_DATA_SIZE*128))k iodepth=4 conv=nosparse cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin qemu-img convert -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testchain" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \ -O raw ./testdata/bin/res.bin cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin diff --git a/tests/test_splitbrain.sh b/tests/test_splitbrain.sh index c30e8843..0b845c8a 100755 --- a/tests/test_splitbrain.sh +++ b/tests/test_splitbrain.sh @@ -15,14 +15,13 @@ sleep 2 # Write -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=1 \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 -number_ios=100 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=1 \ + -rw=randwrite -pool=1 -inode=1 -size=128M -runtime=10 -number_ios=100 # Kill OSD 2, start OSD 1 kill $OSD2_PID -build/src/osd/vitastor-osd --osd_num 1 --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS --etcd_address $ETCD_URL \ +build/src/osd/vitastor-osd --osd_num 1 --bind_address 127.0.0.1 $NO_SAME $OSD_ARGS \ $(build/src/disk_tool/vitastor-disk simple-offsets --format options --device ./testdata/bin/test_osd2.bin $OFFSET_ARGS 2>/dev/null) >>./testdata/osd2.log 2>&1 & sleep 2 diff --git a/tests/test_vm_cont.sh b/tests/test_vm_cont.sh index be97a092..785ecb9c 100755 --- a/tests/test_vm_cont.sh +++ b/tests/test_vm_cont.sh @@ -3,7 +3,7 @@ export KEEP_DATA=1 . `dirname $0`/common.sh -node mon/mon-main.js $MON_PARAMS --etcd_address $ETCD_URL --etcd_prefix "/vitastor" --verbose 1 >>./testdata/mon.log 2>&1 & +node mon/mon-main.js $MON_PARAMS --verbose 1 >>./testdata/mon.log 2>&1 & MON_PID=$! wait_etcd @@ -15,7 +15,7 @@ OSD_COUNT=3 OSD_ARGS="$OSD_ARGS" OFFSET_ARGS="$OFFSET_ARGS" for i in $(seq 1 $OSD_COUNT); do - build/src/osd/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $OSD_ARGS --etcd_address $ETCD_URL \ + build/src/osd/vitastor-osd --osd_num $i --bind_address 127.0.0.1 $OSD_ARGS \ $(build/src/disk_tool/vitastor-disk simple-offsets --format options ./testdata/bin/test_osd$i.bin $OFFSET_ARGS 2>/dev/null) >>./testdata/osd$i.log 2>&1 & eval OSD${i}_PID=$! done @@ -32,7 +32,7 @@ if ! cmp build/src/client/block-vitastor.so /usr/lib/x86_64-linux-gnu/qemu/block fi qemu-system-x86_64 -enable-kvm -m 1024 \ - -drive 'file=vitastor:etcd_host=127.0.0.1\:'$ETCD_PORT'/v3:image=debian9',format=raw,if=none,id=drive-virtio-disk0,cache=none \ + -drive 'file=vitastor:config_path=$VITASTOR_CFG:image=debian9',format=raw,if=none,id=drive-virtio-disk0,cache=none \ -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=off,physical_block_size=4096,logical_block_size=512 \ -vnc 0.0.0.0:0 diff --git a/tests/test_vm_start.sh b/tests/test_vm_start.sh index a5b0dec3..88c44d71 100755 --- a/tests/test_vm_start.sh +++ b/tests/test_vm_start.sh @@ -9,13 +9,13 @@ $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"debian9","size":'$((2048*1024* qemu-img convert -S 4096 -p \ -f raw ~/debian9-kvm.raw \ - -O raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=debian9" + -O raw "vitastor:config_path=$VITASTOR_CFG:image=debian9" $ETCDCTL put /vitastor/config/inode/1/1 '{"name":"debian9@0","size":'$((2048*1024*1024))'}' $ETCDCTL put /vitastor/config/inode/1/2 '{"parent_id":1,"name":"debian9","size":'$((2048*1024*1024))'}' qemu-system-x86_64 -enable-kvm -m 1024 \ - -drive 'file=vitastor:etcd_host=127.0.0.1\:'$ETCD_PORT'/v3:image=debian9',format=raw,if=none,id=drive-virtio-disk0,cache=none \ + -drive 'file=vitastor:config_path=$VITASTOR_CFG:image=debian9',format=raw,if=none,id=drive-virtio-disk0,cache=none \ -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=off,physical_block_size=4096,logical_block_size=512 \ -vnc 0.0.0.0:0 diff --git a/tests/test_write.sh b/tests/test_write.sh index c82a0b26..36f0e715 100755 --- a/tests/test_write.sh +++ b/tests/test_write.sh @@ -10,43 +10,39 @@ check_qemu echo Small sequential writes -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -numjobs=1 -iodepth=16 \ - -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 +$VITASTOR_FIO -bs=4k -direct=1 -numjobs=1 -iodepth=16 \ + -rw=write -pool=1 -inode=1 -size=128M -runtime=10 # Random writes without immediate_commit were stalling OSDs echo 68k random writes -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=68k -direct=1 -numjobs=16 -iodepth=4 \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 +$VITASTOR_FIO -bs=68k -direct=1 -numjobs=16 -iodepth=4 \ + -rw=randwrite -pool=1 -inode=1 -size=128M -runtime=10 # A lot of parallel syncs was crashing the primary OSD at some point echo T64Q1 writes with fsync -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -numjobs=64 -iodepth=1 -fsync=1 \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -number_ios=100 +$VITASTOR_FIO -bs=4k -direct=1 -numjobs=64 -iodepth=1 -fsync=1 \ + -rw=randwrite -pool=1 -inode=1 -size=128M -number_ios=100 echo Linear write -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \ + -pool=1 -inode=1 -size=128M -cluster_log_level=10 echo T1Q1 writes with fsync=32 -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=32 -buffer_pattern=0xdeadface \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -number_ios=1024 +$VITASTOR_FIO -bs=4k -direct=1 -iodepth=1 -fsync=32 -buffer_pattern=0xdeadface \ + -rw=randwrite -pool=1 -inode=1 -size=128M -number_ios=1024 qemu-img convert -S 4096 -p \ - -f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=1:size=$((128*1024*1024))" \ + -f raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=1:size=$((128*1024*1024))" \ -O raw ./testdata/bin/read.bin qemu-img convert -S 4096 -p \ -f raw ./testdata/bin/read.bin \ - -O raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:pool=1:inode=1:size=$((128*1024*1024))" + -O raw "vitastor:config_path=$VITASTOR_CFG:pool=1:inode=1:size=$((128*1024*1024))" format_green OK diff --git a/tests/test_write_no_same.sh b/tests/test_write_no_same.sh index f7e58393..22c55b7e 100755 --- a/tests/test_write_no_same.sh +++ b/tests/test_write_no_same.sh @@ -11,7 +11,6 @@ GLOBAL_CONF='{"immediate_commit":"all"}' # Test basic write -LD_PRELOAD="build/src/client/libfio_vitastor.so" \ - fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -rw=write -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -cluster_log_level=10 +$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -rw=write -pool=1 -inode=1 -size=128M -cluster_log_level=10 format_green OK