create-write-persist.sh 801 Bytes
Newer Older
1 2
#!/bin/bash -x

3 4 5
set -e
set -o pipefail

6 7 8 9 10 11 12 13 14 15 16 17 18
if [ -z $srcdir ]; then
    echo srcdir variable not set.
    exit 1
fi
source $srcdir/tests/test-util.sh

# start 1 server with 2 second wait, 20s timeout
test_start_servers 1 2 20

sleep 1

#####################

19
# run test
20
run_to 10 tests/create-write-persist-test $svr1 1
21 22 23 24 25 26 27
if [ $? -ne 0 ]; then
    wait
    exit 1
fi

wait

28 29 30 31 32 33 34 35 36
# check that the underlying pool has the object we created
# XXX note this assumes pmem pools -- may want to write our
# own wrapper for this functionality at some point
num_objs=`pmempool info -ns $TMPBASE/svr-1.dat | grep "Number of objects" | head -n 1 | cut -d: -f2 | awk '{$1=$1};1'`
if [ $num_objs -ne 1 ]; then
    echo "Invalid number of objects in BAKE pool"
    exit 1
fi

37 38 39 40
echo cleaning up $TMPBASE
rm -rf $TMPBASE

exit 0