1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/templates/fb-publish-again.txt Sun Aug 02 00:11:39 2015 +0200
1.3 @@ -0,0 +1,33 @@
1.4 +Content-Type: multipart/alternative; boundary="===============0945993647=="
1.5 +MIME-Version: 1.0
1.6 +From: resource-room-confroom@example.com
1.7 +To: paul.boddie@example.com
1.8 +Subject: Availability
1.9 +
1.10 +--===============0945993647==
1.11 +Content-Type: text/plain; charset="us-ascii"
1.12 +MIME-Version: 1.0
1.13 +Content-Transfer-Encoding: 7bit
1.14 +
1.15 +This message contains a free/busy object.
1.16 +--===============0945993647==
1.17 +Content-Type: text/calendar; charset="us-ascii"; method="PUBLISH"
1.18 +MIME-Version: 1.0
1.19 +Content-Transfer-Encoding: 7bit
1.20 +
1.21 +BEGIN:VCALENDAR
1.22 +PRODID:-//imip-agent/test//EN
1.23 +METHOD:PUBLISH
1.24 +VERSION:2.0
1.25 +BEGIN:VFREEBUSY
1.26 +ORGANIZER:mailto:resource-room-confroom@example.com
1.27 +ATTENDEE:mailto:paul.boddie@example.com
1.28 +UID:mailto:resource-room-confroom@example.com
1.29 +DTSTAMP:20141001T173916Z
1.30 +DTSTART:20140401T080000Z
1.31 +DTEND:20140401T100000Z
1.32 +FREEBUSY;FBTYPE=BUSY:20140401T083000Z/20140401T100000Z
1.33 +END:VFREEBUSY
1.34 +END:VCALENDAR
1.35 +
1.36 +--===============0945993647==--
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tests/templates/fb-publish.txt Sun Aug 02 00:11:39 2015 +0200
2.3 @@ -0,0 +1,32 @@
2.4 +Content-Type: multipart/alternative; boundary="===============0945993647=="
2.5 +MIME-Version: 1.0
2.6 +From: resource-room-confroom@example.com
2.7 +To: paul.boddie@example.com
2.8 +Subject: Availability
2.9 +
2.10 +--===============0945993647==
2.11 +Content-Type: text/plain; charset="us-ascii"
2.12 +MIME-Version: 1.0
2.13 +Content-Transfer-Encoding: 7bit
2.14 +
2.15 +This message contains a free/busy object.
2.16 +--===============0945993647==
2.17 +Content-Type: text/calendar; charset="us-ascii"; method="PUBLISH"
2.18 +MIME-Version: 1.0
2.19 +Content-Transfer-Encoding: 7bit
2.20 +
2.21 +BEGIN:VCALENDAR
2.22 +PRODID:-//imip-agent/test//EN
2.23 +METHOD:PUBLISH
2.24 +VERSION:2.0
2.25 +BEGIN:VFREEBUSY
2.26 +ORGANIZER:mailto:resource-room-confroom@example.com
2.27 +ATTENDEE:mailto:paul.boddie@example.com
2.28 +UID:mailto:resource-room-confroom@example.com
2.29 +DTSTAMP:20140301T163916Z
2.30 +FREEBUSY;FBTYPE=BUSY:20140401T070000Z/20140401T080000Z
2.31 +FREEBUSY;FBTYPE=BUSY:20140401T080000Z/20140401T100000Z
2.32 +END:VFREEBUSY
2.33 +END:VCALENDAR
2.34 +
2.35 +--===============0945993647==--
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tests/test_freebusy_publishing.sh Sun Aug 02 00:11:39 2015 +0200
3.3 @@ -0,0 +1,44 @@
3.4 +#!/bin/sh
3.5 +
3.6 +THIS_DIR=`dirname $0`
3.7 +
3.8 +TEMPLATES="$THIS_DIR/templates"
3.9 +PERSON_SCRIPT="$THIS_DIR/../imip_person.py"
3.10 +SHOWMAIL="$THIS_DIR/../tools/showmail.py"
3.11 +STORE=/tmp/store
3.12 +STATIC=/tmp/static
3.13 +ARGS="-S $STORE -P $STATIC -d"
3.14 +USER="mailto:paul.boddie@example.com"
3.15 +SENDER="mailto:resource-room-confroom@example.com"
3.16 +FBFILE="$STORE/$USER/freebusy"
3.17 +FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER"
3.18 +TAB=`printf '\t'`
3.19 +
3.20 +PYTHONPATH="$THIS_DIR/.."
3.21 +export PYTHONPATH
3.22 +
3.23 +ERROR=err.tmp
3.24 +
3.25 +rm -r $STORE
3.26 +rm -r $STATIC
3.27 +rm $ERROR
3.28 +rm out*.tmp
3.29 +
3.30 + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-publish.txt" 2>> $ERROR \
3.31 +| "$SHOWMAIL" \
3.32 +> out0.tmp
3.33 +
3.34 + grep -q "^20140401T070000Z${TAB}20140401T080000Z" "$FBOTHERFILE" \
3.35 +&& grep -q "^20140401T080000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
3.36 +&& echo "Success" \
3.37 +|| echo "Failed"
3.38 +
3.39 + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-publish-again.txt" 2>> $ERROR \
3.40 +| "$SHOWMAIL" \
3.41 +> out0.tmp
3.42 +
3.43 + grep -q "^20140401T070000Z${TAB}20140401T080000Z" "$FBOTHERFILE" \
3.44 +&& ! grep -q "^20140401T080000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
3.45 +&& grep -q "^20140401T083000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
3.46 +&& echo "Success" \
3.47 +|| echo "Failed"