run-test.sh 657 Bytes
Newer Older
1 2 3 4 5 6 7
#!/bin/bash -x

if [ -z "$MKTEMP" ] ; then
    echo expected MKTEMP variable defined to its respective command
    exit 1
fi

8 9
timeout_sec=${2:-10}

10 11
source test-util.sh

Matthieu Dorier's avatar
Matthieu Dorier committed
12
TEST_DIR=`$MKTEMP -d /tmp/hepnos-XXXXXX`
13 14 15 16
CON_FILE=$TEST_DIR/connection.yaml
cp config.yaml $TEST_DIR/config.yaml
CFG_FILE=$TEST_DIR/config.yaml
sed -i -e "s|XXX|${TEST_DIR}/database|g" $CFG_FILE
17

18
hepnos_test_start_servers 2 2 20 $CFG_FILE $CON_FILE
19

20
export HEPNOS_CONFIG_FILE=$CON_FILE
21 22

# run a connect test client
23
run_to ${timeout_sec} $1 $CON_FILE $1.xml
24 25 26 27 28 29 30 31 32 33 34
if [ $? -ne 0 ]; then
    wait
    exit 1
fi

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

wait

# cleanup
rm -rf $TEST_DIR
35
rm -rf /dev/shm/hepnos.*.dat
36
exit 0