Last change
on this file since 4b740c2 was
bcdc24b,
checked in by Miklos Vajna <vmiklos@…>, at 2009-02-18T00:30:13Z
|
skyped: add logfile option
using this option messages are not lost when not running in foreground
mode
|
-
Property mode set to
100755
|
File size:
1.6 KB
|
Rev | Line | |
---|
[25a7eb8] | 1 | #!/bin/bash |
---|
| 2 | BITLBEE=$1 |
---|
| 3 | typeset -ix PORT=`echo $2 | egrep '^[0-9]{1,5}$'` |
---|
| 4 | SCRIPT=$3 |
---|
| 5 | shift 3 |
---|
| 6 | |
---|
| 7 | [ -n "$SCRIPT" -a -n "$BITLBEE" -a -e "$SCRIPT" -a "$PORT" -ne 0 ] || { echo Syntax: `basename "$0"` bitlbee-executable listening-port test-script test-script-args; exit 1; } |
---|
| 8 | |
---|
| 9 | # Create or empty test dir |
---|
| 10 | mkdir livetest 2>/dev/null || rm livetest/bitlbeetest*.xml bitlbeetest.pid 2>/dev/null |
---|
| 11 | |
---|
| 12 | # Run the bee |
---|
| 13 | echo Running bitlbee... |
---|
| 14 | $VALGRIND $BITLBEE -n -c bitlbee.conf -d livetest/ -D -P bitlbeetest.pid -p $PORT & sleep 2 |
---|
| 15 | |
---|
| 16 | # Check if it's really running |
---|
| 17 | kill -0 `cat bitlbeetest.pid 2>/dev/null ` 2>/dev/null || { echo Failed to run bitlbee daemon on port $PORT; exit 1; } |
---|
| 18 | |
---|
[fbd6c69] | 19 | # Set up skyped |
---|
| 20 | |
---|
| 21 | rm -rf etc |
---|
| 22 | mkdir etc |
---|
| 23 | cd etc |
---|
| 24 | cp ../../skyped.cnf . |
---|
| 25 | yes ""|openssl req -new -x509 -days 365 -nodes -config skyped.cnf -out skyped.cert.pem -keyout skyped.key.pem 2> openssl.log |
---|
| 26 | cd .. |
---|
| 27 | echo "[skyped]" > skyped.conf |
---|
| 28 | echo "username = $TEST_SKYPE_ID" >> skyped.conf |
---|
| 29 | echo "password = $(echo -n $TEST_SKYPE_PASSWORD|sha1sum|sed 's/ *-$//')" >> skyped.conf |
---|
| 30 | echo "cert = $(pwd)/etc/skyped.cert.pem" >> skyped.conf |
---|
| 31 | echo "key = $(pwd)/etc/skyped.key.pem" >> skyped.conf |
---|
| 32 | echo "port = 2727" >> skyped.conf |
---|
| 33 | |
---|
[25a7eb8] | 34 | # Run skyped |
---|
[bcdc24b] | 35 | python ../skyped.py -c skyped.conf -l skypedtest.log > skypedtest.pid |
---|
[25a7eb8] | 36 | sleep 2 |
---|
| 37 | |
---|
| 38 | # Run the test |
---|
| 39 | echo Running test script... |
---|
| 40 | "$SCRIPT" $* |
---|
| 41 | RET=$? |
---|
| 42 | |
---|
| 43 | # Kill skyped |
---|
| 44 | killall -TERM skype |
---|
| 45 | kill -TERM $(sed 's/.*: //' skypedtest.pid) |
---|
| 46 | |
---|
| 47 | # Kill bee |
---|
| 48 | echo Killing bitlbee... |
---|
| 49 | kill `cat bitlbeetest.pid` |
---|
| 50 | |
---|
| 51 | # Return test result |
---|
| 52 | [ $RET -eq 0 ] && echo Test passed |
---|
| 53 | [ $RET -ne 0 ] && echo Test failed |
---|
| 54 | [ $RET -eq 22 ] && echo '(timed out)' |
---|
| 55 | [ $RET -eq 66 ] && echo '(environment variables missing)' |
---|
| 56 | exit $RET |
---|
Note: See
TracBrowser
for help on using the repository browser.