# HG changeset patch # User Paul Boddie # Date 1432229027 -7200 # Node ID 393a052ac1a724b0ab00f488efb410a114cc90d0 # Parent bfcdebf855d755e23420c90c5a38d153afc30032 Added a test of event spoofing for person recipients. diff -r bfcdebf855d7 -r 393a052ac1a7 tests/templates/event-request-person-spoofed.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-request-person-spoofed.txt Thu May 21 19:23:47 2015 +0200 @@ -0,0 +1,34 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: harvey.horse@example.com +To: vincent.vole@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:vincent.vole@example.com +DTSTAMP:20150125T000000Z +DTSTART;TZID=Europe/Oslo:20150124T090000 +DTEND;TZID=Europe/Oslo:20150124T100000 +SUMMARY:Spoof test +UID:spoof2@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r bfcdebf855d7 -r 393a052ac1a7 tests/test_person_invitation.sh --- a/tests/test_person_invitation.sh Thu May 21 18:57:28 2015 +0200 +++ b/tests/test_person_invitation.sh Thu May 21 19:23:47 2015 +0200 @@ -126,3 +126,19 @@ ! grep -q "event6@example.com" "$FBOTHERFILE" \ && echo "Success" \ || echo "Failed" + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-spoofed.txt" 2> /dev/null \ +| "$SHOWMAIL" \ +> out8.tmp + + ! grep -q 'METHOD:REPLY' out8.tmp \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "spoof2@example.com" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "spoof2@example.com" "$FBOTHERFILE" \ +&& echo "Success" \ +|| echo "Failed"