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

source $srcdir/tests/test-util.sh

function test_start_proxy_servers ()
{
    bake_svr_addr=${1}
8 9 10 11
    opts=${2}
    nservers=${3:-4}
    startwait=${4:-15}
    maxtime=${5:-120}
12 13 14 15

    # start daemons
    for i in `seq $nservers`
    do
16
        run_to ${maxtime} tests/proxy/proxy-server-daemon $opts -f $TMPBASE/proxy-svr-1.addr na+sm $bake_svr_addr &
17 18 19 20 21 22 23 24 25 26 27 28 29 30
        if [ $? -ne 0 ]; then
            # TODO: this doesn't actually work; can't check return code of
            # something executing in background.  We have to rely on the
            # return codes of the actual client side tests to tell if
            # everything started properly
            exit 1
        fi
    done

    # wait for servers to start
    sleep ${startwait}

    proxy_svr1=`cat $TMPBASE/proxy-svr-1.addr`
}