# HG changeset patch # User Paul Boddie # Date 1432046374 -7200 # Node ID db4ab6e0c035fa7bbc972e5dcb344e97e6130386 # Parent 7e0b6c9a6673e11b3bc492949599598185a6999c Added tests of multiple attendee invitation and single attendee uninvitation. diff -r 7e0b6c9a6673 -r db4ab6e0c035 tests/templates/event-cancel-multiple-attendee.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-cancel-multiple-attendee.txt Tue May 19 16:39:34 2015 +0200 @@ -0,0 +1,33 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: resource-room-confroom@example.com +Subject: Invitation! + +--===============0047278175== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +This message contains an event. +--===============0047278175== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/calendar; charset="us-ascii"; method="CANCEL" + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:CANCEL +VERSION:2.0 +BEGIN:VEVENT +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE;RSVP=TRUE:mailto:resource-room-confroom@example.com +DTSTAMP:20141125T004600Z +DTSTART;TZID=Europe/Oslo:20141126T160000 +DTEND;TZID=Europe/Oslo:20141126T170000 +SUMMARY:Test drive +UID:event5@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 7e0b6c9a6673 -r db4ab6e0c035 tests/templates/event-request-multiple.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-request-multiple.txt Tue May 19 16:39:34 2015 +0200 @@ -0,0 +1,35 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: resource-room-confroom@example.com, resource-car-porsche911@example.com +Subject: Invitation! + +--===============0047278175== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +This message contains an event. +--===============0047278175== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST" + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:REQUEST +VERSION:2.0 +BEGIN:VEVENT +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE;ROLE=CHAIR:mailto:paul.boddie@example.com +ATTENDEE;RSVP=TRUE:mailto:resource-room-confroom@example.com +ATTENDEE;RSVP=TRUE:mailto:resource-car-porsche911@example.com +DTSTAMP:20141125T004600Z +DTSTART;TZID=Europe/Oslo:20141126T160000 +DTEND;TZID=Europe/Oslo:20141126T170000 +SUMMARY:Test drive +UID:event5@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 7e0b6c9a6673 -r db4ab6e0c035 tests/templates/fb-request-car.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/fb-request-car.txt Tue May 19 16:39:34 2015 +0200 @@ -0,0 +1,31 @@ +Content-Type: multipart/alternative; boundary="===============0945993647==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: resource-car-porsche911@example.com + +--===============0945993647== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +This message contains a free/busy request. +--===============0945993647== +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:REQUEST +VERSION:2.0 +BEGIN:VFREEBUSY +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE:mailto:resource-car-porsche911@example.com +DTSTAMP:20141125T164400Z +DTSTART:20141126T150000Z +DTEND:20141126T180000Z +UID:fb1@example.com +END:VFREEBUSY +END:VCALENDAR + +--===============0945993647==-- diff -r 7e0b6c9a6673 -r db4ab6e0c035 tests/test_multiple_invitation.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_multiple_invitation.sh Tue May 19 16:39:34 2015 +0200 @@ -0,0 +1,88 @@ +#!/bin/sh + +THIS_DIR=`dirname $0` + +TEMPLATES=$THIS_DIR/templates +RESOURCE_SCRIPT=$THIS_DIR/../imip_resource.py +SHOWMAIL=$THIS_DIR/../tools/showmail.py +STORE=/tmp/store +STATIC=/tmp/static +ARGS="-S $STORE -P $STATIC -d" + +rm -r $STORE +rm -r $STATIC + + $RESOURCE_SCRIPT $ARGS < $TEMPLATES/fb-request-all.txt 2> /dev/null \ +| $SHOWMAIL \ +> out0.tmp + + grep -q 'METHOD:REPLY' out0.tmp \ +&& grep -q -v '^FREEBUSY' out0.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS < $TEMPLATES/fb-request.txt 2> /dev/null \ +| $SHOWMAIL \ +> out1.tmp + + grep -q 'METHOD:REPLY' out1.tmp \ +&& grep -q -v '^FREEBUSY' out1.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS -o 'resource-room-confroom@example.com' < $TEMPLATES/event-request-multiple.txt 2> /dev/null \ +| $SHOWMAIL \ +> out2.tmp + + grep -q 'METHOD:REPLY' out2.tmp \ +&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS -o 'resource-car-porsche911@example.com' < $TEMPLATES/event-request-multiple.txt 2> /dev/null \ +| $SHOWMAIL \ +> out3.tmp + + grep -q 'METHOD:REPLY' out3.tmp \ +&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out3.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS -o 'resource-room-confroom@example.com' < $TEMPLATES/fb-request.txt 2> /dev/null \ +| $SHOWMAIL \ +> out4.tmp + + grep -q 'METHOD:REPLY' out4.tmp \ +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out4.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS -o 'resource-car-porsche911@example.com' < $TEMPLATES/fb-request-car.txt 2> /dev/null \ +| $SHOWMAIL \ +> out5.tmp + + grep -q 'METHOD:REPLY' out5.tmp \ +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out5.tmp \ +&& echo "Success" \ +|| echo "Failed" + +$RESOURCE_SCRIPT $ARGS < $TEMPLATES/event-cancel-multiple-attendee.txt 2> /dev/null +echo "Cancel..." + + $RESOURCE_SCRIPT $ARGS -o 'resource-room-confroom@example.com' < $TEMPLATES/fb-request.txt 2> /dev/null \ +| $SHOWMAIL \ +> out6.tmp + + grep -q 'METHOD:REPLY' out6.tmp \ +&& grep -q -v 'FREEBUSY' out6.tmp \ +&& echo "Success" \ +|| echo "Failed" + + $RESOURCE_SCRIPT $ARGS -o 'resource-car-porsche911@example.com' < $TEMPLATES/fb-request-car.txt 2> /dev/null \ +| $SHOWMAIL \ +> out7.tmp + + grep -q 'METHOD:REPLY' out7.tmp \ +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out7.tmp \ +&& echo "Success" \ +|| echo "Failed"