Last change
on this file since 7666c87 was
7cc2c1e,
checked in by Miklos Vajna <vmiklos@…>, at 2010-04-12T15:37:33Z
|
skyped: use os.path.expanduser for file paths in config
Requested-by: ilf <ilf@…>
|
-
Property mode set to
100755
|
File size:
1.7 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 |
---|
[7cc2c1e] | 30 | # we use ~ here to test that resolve that syntax works |
---|
| 31 | echo "cert = $(pwd|sed "s|$HOME|~|")/etc/skyped.cert.pem" >> skyped.conf |
---|
| 32 | echo "key = $(pwd|sed "s|$HOME|~|")/etc/skyped.key.pem" >> skyped.conf |
---|
[fbd6c69] | 33 | echo "port = 2727" >> skyped.conf |
---|
| 34 | |
---|
[25a7eb8] | 35 | # Run skyped |
---|
[bcdc24b] | 36 | python ../skyped.py -c skyped.conf -l skypedtest.log > skypedtest.pid |
---|
[25a7eb8] | 37 | sleep 2 |
---|
| 38 | |
---|
| 39 | # Run the test |
---|
| 40 | echo Running test script... |
---|
| 41 | "$SCRIPT" $* |
---|
| 42 | RET=$? |
---|
| 43 | |
---|
| 44 | # Kill skyped |
---|
| 45 | killall -TERM skype |
---|
| 46 | kill -TERM $(sed 's/.*: //' skypedtest.pid) |
---|
| 47 | |
---|
| 48 | # Kill bee |
---|
| 49 | echo Killing bitlbee... |
---|
| 50 | kill `cat bitlbeetest.pid` |
---|
| 51 | |
---|
| 52 | # Return test result |
---|
| 53 | [ $RET -eq 0 ] && echo Test passed |
---|
| 54 | [ $RET -ne 0 ] && echo Test failed |
---|
| 55 | [ $RET -eq 22 ] && echo '(timed out)' |
---|
| 56 | [ $RET -eq 66 ] && echo '(environment variables missing)' |
---|
| 57 | exit $RET |
---|
Note: See
TracBrowser
for help on using the repository browser.