#!/bin/bash

# Test vdi repair functionality with the condition nr_zones < inode->nr_copies

. ./common

for i in `seq 0 1`; do
    _start_sheep $i "-z 0"
done

_start_sheep 2 "-z 1"

_wait_for_sheep 3

$DOG node list

# 3 copies, 2 zones
_cluster_format

$DOG vdi create test 12M
_vdi_list

echo "original data" | $DOG vdi write test

$DOG cluster shutdown

rm $STORE/1/obj/007c2b2500000000

for i in `seq 0 1`; do
    _start_sheep $i "-z 0"
done

_start_sheep 2 "-z 1"

_wait_for_sheep 3

$DOG vdi check test

$DOG vdi read test 0 14
