run-test.sh 645 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
timeout_sec=${2:-60}
9

10 11
source test-util.sh

12
TEST_DIR=`$MKTEMP -d ./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 ${timeout_sec} $CFG_FILE $CON_FILE
19

20
export HEPNOS_CONFIG_FILE=$CON_FILE
21

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

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

wait

# cleanup
rm -rf $TEST_DIR
exit 0