# HG changeset patch # User Paul Boddie # Date 1431967347 -7200 # Node ID d0a189c102e822cd19dee8becb160987c8ecaf5f # Parent d3b23bece6a59381d3f57039e4610331a57cb168 Added unconstrained free/busy retrieval and an event spoofing test. diff -r d3b23bece6a5 -r d0a189c102e8 tests/templates/event-request-spoofed.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-request-spoofed.txt Mon May 18 18:42:27 2015 +0200 @@ -0,0 +1,34 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: vincent.vole@example.com +To: resource-room-confroom@example.com +Subject: Spoofed request + +--===============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:-//MoinMessage/test_itip_event.py//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 +DTSTAMP:20150125T000000Z +DTSTART;TZID=Europe/Oslo:20150124T090000 +DTEND;TZID=Europe/Oslo:20150124T100000 +SUMMARY:Spoof test +UID:spoof@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r d3b23bece6a5 -r d0a189c102e8 tests/templates/fb-request-all.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/fb-request-all.txt Mon May 18 18:42:27 2015 +0200 @@ -0,0 +1,29 @@ +Content-Type: multipart/alternative; boundary="===============0945993647==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: resource-room-confroom@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-room-confroom@example.com +DTSTAMP:20141125T164400Z +UID:fb2@example.com +END:VFREEBUSY +END:VCALENDAR + +--===============0945993647==-- diff -r d3b23bece6a5 -r d0a189c102e8 tests/test_resource_invitation.sh --- a/tests/test_resource_invitation.sh Mon May 18 18:40:56 2015 +0200 +++ b/tests/test_resource_invitation.sh Mon May 18 18:42:27 2015 +0200 @@ -12,6 +12,15 @@ 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 @@ -69,3 +78,15 @@ && grep -q -v 'FREEBUSY' out6.tmp \ && echo "Success" \ || echo "Failed" + + $RESOURCE_SCRIPT $ARGS < $TEMPLATES/event-request-spoofed.txt 2> /dev/null \ +| $SHOWMAIL + + $RESOURCE_SCRIPT $ARGS < $TEMPLATES/fb-request-all.txt 2> /dev/null \ +| $SHOWMAIL \ +> out7.tmp + + grep -q 'METHOD:REPLY' out7.tmp \ +&& grep -q -v '^FREEBUSY' out7.tmp \ +&& echo "Success" \ +|| echo "Failed"