#!/bin/bash

# Test partial vdi read and write

seq=`basename $0`
echo "QA output created by $seq"

here=`pwd`
tmp=/tmp/$$
status=1        # failure is the default!

# get standard environment, filters and checks
. ./common.rc
. ./common.filter

_cleanup

for i in 0 1 2; do
    _start_sheep $i
done

_wait_for_sheep 3

$COLLIE cluster format -c 2
$COLLIE vdi create test 4M

for i in `seq 0 7`; do
    echo $i | $COLLIE vdi write test $(($i * 1536 + 512)) 512
done

for i in `seq 0 7`; do
    $COLLIE vdi read test $(($i * 1536 + 512)) 512 | md5sum
done

$COLLIE vdi read test | md5sum
