Last change
on this file since 50d453d was
25a7eb8,
checked in by Miklos Vajna <vmiklos@…>, at 2009-02-17T23:31:13Z
|
Initial testcase.
Code is based on ulim's automated live tests.
|
-
Property mode set to
100755
|
File size:
1.1 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 | |
---|
| 19 | # Run skyped |
---|
| 20 | python ../skyped.py -c ../skyped.conf > skypedtest.pid |
---|
| 21 | sleep 2 |
---|
| 22 | |
---|
| 23 | # Run the test |
---|
| 24 | echo Running test script... |
---|
| 25 | "$SCRIPT" $* |
---|
| 26 | RET=$? |
---|
| 27 | |
---|
| 28 | # Kill skyped |
---|
| 29 | killall -TERM skype |
---|
| 30 | kill -TERM $(sed 's/.*: //' skypedtest.pid) |
---|
| 31 | |
---|
| 32 | # Kill bee |
---|
| 33 | echo Killing bitlbee... |
---|
| 34 | kill `cat bitlbeetest.pid` |
---|
| 35 | |
---|
| 36 | # Return test result |
---|
| 37 | [ $RET -eq 0 ] && echo Test passed |
---|
| 38 | [ $RET -ne 0 ] && echo Test failed |
---|
| 39 | [ $RET -eq 22 ] && echo '(timed out)' |
---|
| 40 | [ $RET -eq 66 ] && echo '(environment variables missing)' |
---|
| 41 | exit $RET |
---|
Note: See
TracBrowser
for help on using the repository browser.