[Calypso-commits] [calypso] 01/02: Robustify autopktest

Guido Guenther agx at moszumanska.debian.org
Sun Apr 10 12:38:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to annotated tag debian/1.5-2
in repository calypso.

commit 8ad4377acd77adad4411d24a88e38e5f5842203d
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sun Apr 10 12:06:17 2016 +0200

    Robustify autopktest
    
    Don't fork but rather put the daemon into background and dump the log on
    stdout in case of a test failure.
---
 debian/tests/caldav | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/debian/tests/caldav b/debian/tests/caldav
index c4d78b1..ba23c50 100755
--- a/debian/tests/caldav
+++ b/debian/tests/caldav
@@ -5,19 +5,28 @@ TESTS="\
     CalDAV/vtodos.xml \
 "
 
+CALYPSO_PID=
+DAEMON_LOG="${0}_daemon.log"
+
 set -e
 
 cleanup ()
 {
-   kill $(cat $WORKDIR/pid)
+   [ -z $CALYPSO_PID ] || kill $CALYPSO_PID
    rm --preserve-root -rf $WORKDIR
 }
 
+run_calypso ()
+{
+    # Run the server
+    ./calypso.py -g >$DAEMON_LOG 2>&1 &
+    CALYPSO_PID=$!
+    sleep 2
+}
+
 WORKDIR=$(mktemp -d)
 trap cleanup 0 INT QUIT ABRT PIPE TERM
 
-export CALYPSO_CONFIG=$WORKDIR/config
-
 # Initial calendars
 CALENDARS="\
            $WORKDIR/calendars/__uids__/user01/calendar/       \
@@ -30,7 +39,8 @@ for d in $CALENDARS; do
 done
 
 # config
-cat <<EOF > $WORKDIR/config
+export CALYPSO_CONFIG=$WORKDIR/config
+cat > $CALYPSO_CONFIG <<EOF
 [server]
 ssl=false
 
@@ -44,11 +54,13 @@ folder=$WORKDIR/
 EOF
 echo "user01:user01" > $WORKDIR/passwd
 
-# Run the server
-calypso -d -P $WORKDIR/pid
-sleep 2
+run_calypso
 
 # Run the tests
-testcaldav -s $PWD/debian/tests/serverinfo.xml $TESTS
+if ! testcaldav -s $PWD/debian/tests/serverinfo.xml $TESTS; then
+    echo "*** Tests failed, daemon log follows:"
+    cat $DAEMON_LOG
+    exit 1
+fi
 
 echo "run: OK"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/calypso/calypso.git



More information about the Calypso-commits mailing list