#!/bin/bash

# Test object cache reclaim

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 `seq 0 2`; do
    _start_sheep $i "-w size=20"
done

_wait_for_sheep "3"

$COLLIE cluster format -c 2

$COLLIE vdi create test 40M

_random | $COLLIE vdi write test

# check cache size, should be 20 * 80%
nr=`ls $STORE/0/cache/7c2b25 | wc -l`
if [ $nr -gt 4 ]; then
    echo "reclaim failed"
fi
