#!/bin/bash

# Test vdi setattr/getattr

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 2; do
    _start_sheep $i
done

_wait_for_sheep 2

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

echo -n value > $STORE/tmp.dat

echo "key shouldn't be found"
$COLLIE vdi getattr test key

$COLLIE vdi setattr test key value
$COLLIE vdi getattr test key | diff - $STORE/tmp.dat

$COLLIE vdi setattr test key value -d

echo "key shouldn't be found"
$COLLIE vdi getattr test key

status=0
