imip-agent

Changeset

591:393a052ac1a7
2015-05-21 Paul Boddie raw files shortlog changelog graph Added a test of event spoofing for person recipients.
tests/templates/event-request-person-spoofed.txt (file) tests/test_person_invitation.sh (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/templates/event-request-person-spoofed.txt	Thu May 21 19:23:47 2015 +0200
     1.3 @@ -0,0 +1,34 @@
     1.4 +Content-Type: multipart/alternative; boundary="===============0047278175=="
     1.5 +MIME-Version: 1.0
     1.6 +From: harvey.horse@example.com
     1.7 +To: vincent.vole@example.com
     1.8 +Subject: Spoofed request
     1.9 +
    1.10 +--===============0047278175==
    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 an event.
    1.16 +--===============0047278175==
    1.17 +MIME-Version: 1.0
    1.18 +Content-Transfer-Encoding: 7bit
    1.19 +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST"
    1.20 +
    1.21 +BEGIN:VCALENDAR
    1.22 +PRODID:-//MoinMessage/test_itip_event.py//EN
    1.23 +METHOD:REQUEST
    1.24 +VERSION:2.0
    1.25 +BEGIN:VEVENT
    1.26 +ORGANIZER:mailto:paul.boddie@example.com
    1.27 +ATTENDEE;ROLE=CHAIR:mailto:paul.boddie@example.com
    1.28 +ATTENDEE;RSVP=TRUE:mailto:vincent.vole@example.com
    1.29 +DTSTAMP:20150125T000000Z
    1.30 +DTSTART;TZID=Europe/Oslo:20150124T090000
    1.31 +DTEND;TZID=Europe/Oslo:20150124T100000
    1.32 +SUMMARY:Spoof test
    1.33 +UID:spoof2@example.com
    1.34 +END:VEVENT
    1.35 +END:VCALENDAR
    1.36 +
    1.37 +--===============0047278175==--
     2.1 --- a/tests/test_person_invitation.sh	Thu May 21 18:57:28 2015 +0200
     2.2 +++ b/tests/test_person_invitation.sh	Thu May 21 19:23:47 2015 +0200
     2.3 @@ -126,3 +126,19 @@
     2.4     ! grep -q "event6@example.com" "$FBOTHERFILE" \
     2.5  && echo "Success" \
     2.6  || echo "Failed"
     2.7 +
     2.8 +  "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-spoofed.txt" 2> /dev/null \
     2.9 +| "$SHOWMAIL" \
    2.10 +> out8.tmp
    2.11 +
    2.12 +   ! grep -q 'METHOD:REPLY' out8.tmp \
    2.13 +&& echo "Success" \
    2.14 +|| echo "Failed"
    2.15 +
    2.16 +   ! grep -q "spoof2@example.com" "$FBFILE" \
    2.17 +&& echo "Success" \
    2.18 +|| echo "Failed"
    2.19 +
    2.20 +   ! grep -q "spoof2@example.com" "$FBOTHERFILE" \
    2.21 +&& echo "Success" \
    2.22 +|| echo "Failed"