forked from vitalif/vitastor
Enable vitastor-cli fix in test
parent
6ca20aa194
commit
25fcedf6e7
|
@ -7,7 +7,7 @@ fi
|
||||||
|
|
||||||
format_error()
|
format_error()
|
||||||
{
|
{
|
||||||
echo $(echo -n -e "\033[1;31m")"$1"$(echo -n -e "\033[m")
|
echo $(echo -n -e "\033[1;31m")"$0 $1"$(echo -n -e "\033[m")
|
||||||
$ETCDCTL get --prefix /vitastor > ./testdata/etcd-dump.txt
|
$ETCDCTL get --prefix /vitastor > ./testdata/etcd-dump.txt
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,14 +44,16 @@ if [[ ($SCHEME = replicated && $PG_SIZE < 3) || ($SCHEME != replicated && $((PG_
|
||||||
# Check that objects are marked as inconsistent if 2 replicas or EC/XOR 2+1
|
# Check that objects are marked as inconsistent if 2 replicas or EC/XOR 2+1
|
||||||
build/src/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '[ .[] | select(.inconsistent) ] | length == '$((IMG_SIZE * 8 * PG_SIZE / (SCHEME = replicated ? 1 : PG_DATA_SIZE)))
|
build/src/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '[ .[] | select(.inconsistent) ] | length == '$((IMG_SIZE * 8 * PG_SIZE / (SCHEME = replicated ? 1 : PG_DATA_SIZE)))
|
||||||
|
|
||||||
# Fix objects
|
# Fix objects using vitastor-cli fix
|
||||||
|
build/src/vitastor-cli describe --etcd_address $ETCD_URL --json | \
|
||||||
# Read everything back
|
jq -s '[ .[0][] | select(.inconsistent and .osd_num == '$ZERO_OSD') ]' | \
|
||||||
|
build/src/vitastor-cli fix --etcd_address $ETCD_URL --bad_osds $ZERO_OSD
|
||||||
elif [[ ($SCHEME = replicated && $PG_SIZE > 2) || ($SCHEME != replicated && $((PG_SIZE-PG_DATA_SIZE)) > 1) ]]; then
|
elif [[ ($SCHEME = replicated && $PG_SIZE > 2) || ($SCHEME != replicated && $((PG_SIZE-PG_DATA_SIZE)) > 1) ]]; then
|
||||||
# Check that everything heals
|
# Check that everything heals
|
||||||
wait_finish_rebalance 60
|
wait_finish_rebalance 60
|
||||||
|
|
||||||
build/src/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '. | length == 0'
|
build/src/vitastor-cli describe --etcd_address $ETCD_URL --json | jq -e '. | length == 0'
|
||||||
|
fi
|
||||||
|
|
||||||
# Read everything back
|
# Read everything back
|
||||||
qemu-img convert -S 4096 -p \
|
qemu-img convert -S 4096 -p \
|
||||||
|
@ -59,6 +61,5 @@ elif [[ ($SCHEME = replicated && $PG_SIZE > 2) || ($SCHEME != replicated && $((P
|
||||||
-O raw ./testdata/read.bin
|
-O raw ./testdata/read.bin
|
||||||
|
|
||||||
diff ./testdata/read.bin ./testdata/mirror.bin
|
diff ./testdata/read.bin ./testdata/mirror.bin
|
||||||
fi
|
|
||||||
|
|
||||||
format_green OK
|
format_green OK
|
||||||
|
|
Loading…
Reference in New Issue