Changeset dc3f9ef for skype/t


Ignore:
Timestamp:
2011-01-03T20:44:01Z (14 years ago)
Author:
Philippe Crama <pcfeb0009@…>
Branches:
master
Children:
6f5ab2a
Parents:
51f0c2b
Message:

Add TUNNELED_MODE and TUNNEL_SCRIPT environment variables

When TUNNELED_MODE=yes, TUNNEL_SCRIPT (when set) is used to establish a
tunnel. This allows to run skyped.py on a differnt host than the skype.c
bitlbee plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/t/livetest-bitlbee.sh

    r51f0c2b rdc3f9ef  
    1818kill -0 `cat bitlbeetest.pid 2>/dev/null ` 2>/dev/null || { echo Failed to run bitlbee daemon on port $PORT; exit 1; }
    1919
    20 # Set up skyped
     20if [ -z "$TUNNELED_MODE" ]; then
     21        # Set up skyped
    2122
    22 rm -rf etc
    23 mkdir etc
    24 cd etc
    25 cp ../../skyped.cnf .
    26 cp ~/.skyped/skyped.cert.pem .
    27 cp ~/.skyped/skyped.key.pem .
    28 cd ..
    29 echo "[skyped]" > skyped.conf
    30 echo "username = $TEST_SKYPE_ID" >> skyped.conf
    31 echo "password = $(echo -n $TEST_SKYPE_PASSWORD|sha1sum|sed 's/ *-$//')" >> skyped.conf
    32 # we use ~ here to test that resolve that syntax works
    33 echo "cert = $(pwd|sed "s|$HOME|~|")/etc/skyped.cert.pem" >> skyped.conf
    34 echo "key = $(pwd|sed "s|$HOME|~|")/etc/skyped.key.pem" >> skyped.conf
    35 echo "port = 2727" >> skyped.conf
     23        rm -rf etc
     24        mkdir etc
     25        cd etc
     26        cp ../../skyped.cnf .
     27        cp ~/.skyped/skyped.cert.pem .
     28        cp ~/.skyped/skyped.key.pem .
     29        cd ..
     30        echo "[skyped]" > skyped.conf
     31        echo "username = $TEST_SKYPE_ID" >> skyped.conf
     32        SHA1=`which sha1sum`
     33        if [ -z "$SHA1" ]; then
     34                SHA1=`which sha1`
     35        fi
     36        if [ -z "$SHA1" ]; then
     37                echo Test failed
     38                echo "(Can't compute password for skyped.conf)"
     39                exit 77
     40        fi
     41        echo "password = $(echo -n $TEST_SKYPE_PASSWORD|$SHA1|sed 's/ *-$//')" >> skyped.conf
     42        # we use ~ here to test that resolve that syntax works
     43        echo "cert = $(pwd|sed "s|$HOME|~|")/etc/skyped.cert.pem" >> skyped.conf
     44        echo "key = $(pwd|sed "s|$HOME|~|")/etc/skyped.key.pem" >> skyped.conf
     45        echo "port = 2727" >> skyped.conf
    3646
    37 # Run skyped
    38 python ../skyped.py -c skyped.conf -l skypedtest.log > skypedtest.pid
    39 sleep 2
     47        # Run skyped
     48        python ../skyped.py -c skyped.conf -l skypedtest.log > skypedtest.pid
     49        sleep 2
     50fi
     51
     52if [ "$TUNNELED_MODE" = "yes" ]; then
     53        rm -f tunnel.pid
     54        if [ -n "$TUNNEL_SCRIPT" ]; then
     55                $TUNNEL_SCRIPT &
     56                echo $! > tunnel.pid
     57                sleep 5
     58        fi
     59fi
    4060
    4161# Run the test
     
    4464RET=$?
    4565
    46 # Kill skyped
    47 killall -TERM skype
    48 kill -TERM $(sed 's/.*: //' skypedtest.pid)
     66if [ -z "$TUNNELED_MODE" ]; then
     67        # skyped runs on another host: no means to kill it
     68        # Kill skyped
     69        killall -TERM skype
     70        kill -TERM $(sed 's/.*: //' skypedtest.pid)
     71fi
     72
     73if [ "$TUNNELED_MODE" = "yes" ]; then
     74        if [ -n "$TUNNEL_SCRIPT" ]; then
     75                cat tunnel.pid >> /tmp/tunnel.pid
     76                kill `cat tunnel.pid`
     77                rm -f tunnel.pid
     78        fi
     79fi
    4980
    5081# Kill bee
    5182echo Killing bitlbee...
    5283kill `cat bitlbeetest.pid`
     84
     85if [ "$TUNNELED_MODE" = "yes" ]; then
     86        # give the skyped a chance to timeout
     87        sleep 30
     88fi
    5389
    5490# Return test result
Note: See TracChangeset for help on using the changeset viewer.