#!/bin/bash -ex PG_COUNT=1 PG_SIZE=1 PG_MINSIZE=1 SCHEME=replicated OSD_COUNT=1 . `dirname $0`/run_3osds.sh kill -9 $OSD1_PID offsets=$(build/src/disk_tool/vitastor-disk simple-offsets --format json ./testdata/bin/test_osd$i.bin $OFFSET_ARGS) opts=$(build/src/disk_tool/vitastor-disk simple-offsets --format options ./testdata/bin/test_osd$i.bin $OFFSET_ARGS) meta_format=$(echo $offsets | jq -r .meta_format) meta_offset=$(echo $offsets | jq -r .meta_offset) data_offset=$(echo $offsets | jq -r .data_offset) data_len=$((1024*1024*1024 - data_offset)) last_block=$((data_len/128/1024 - 1)) if [[ "$meta_format" = "3" ]]; then cat >>./testdata/meta.json <./testdata/meta1.json if ! jq -s -e '(.[0].entries | length) == 1 and .[0].entries[0].writes[0].location < '$((last_block*128*1024)) <./testdata/meta1.json; then format_error "Last block not moved" fi else cat >>./testdata/meta.json <./testdata/meta1.json if ! jq -s -e '(.[0].entries | length) == 1 and .[0].entries[0].block < '$last_block <./testdata/meta1.json; then format_error "Last block not moved" fi fi format_green OK