# HG changeset patch # User Paul Boddie # Date 1438816597 -7200 # Node ID c46fb5cff8f12a04a2121f869ac9c01d5672fd97 # Parent 55c47d34d4d9ed5b496c529fe82d36421677d971 Introduced tests sensitive to the user's time zone in order to verify the interpretation of time periods with and without explicit time zone information. diff -r 55c47d34d4d9 -r c46fb5cff8f1 tests/templates/event-cancel-recurring-day.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-cancel-recurring-day.txt Thu Aug 06 01:16:37 2015 +0200 @@ -0,0 +1,36 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: resource-room-confroom@example.com +Subject: Cancellation! + +Cancel the event for resource-room-confroom and paul.boddie. + +--===============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 +ATTENDEE;RSVP=TRUE:mailto:paul.boddie@example.com +DTSTAMP:20141009T182400Z +DTSTART;TZID=Europe/Oslo:20141010 +DTEND;TZID=Europe/Oslo:20141011 +SUMMARY:Recurring event +UID:event4@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 55c47d34d4d9 -r c46fb5cff8f1 tests/templates/event-request-person-recurring-day-floating.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-request-person-recurring-day-floating.txt Thu Aug 06 01:16:37 2015 +0200 @@ -0,0 +1,34 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: vincent.vole@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;RSVP=TRUE:mailto:vincent.vole@example.com +DTSTAMP:20141009T182400Z +DTSTART:20141010 +DTEND:20141011 +RRULE:FREQ=MONTHLY;BYDAY=2FR;COUNT=3 +SUMMARY:Recurring event +UID:event12@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 55c47d34d4d9 -r c46fb5cff8f1 tests/test_multiple_invitation.sh --- a/tests/test_multiple_invitation.sh Thu Aug 06 01:14:20 2015 +0200 +++ b/tests/test_multiple_invitation.sh Thu Aug 06 01:16:37 2015 +0200 @@ -9,7 +9,8 @@ STATIC=/tmp/static PREFS=/tmp/prefs ARGS="-S $STORE -P $STATIC -p $PREFS -d" -USER="mailto:resource-room-confroom@example.com" +ROOM="mailto:resource-room-confroom@example.com" +CAR="mailto:resource-car-porsche911@example.com" ERROR=err.tmp rm -r $STORE @@ -18,9 +19,13 @@ rm $ERROR rm out*.tmp -mkdir -p "$PREFS/$USER" -echo 'Europe/Oslo' > "$PREFS/$USER/TZID" -echo 'share' > "$PREFS/$USER/freebusy_sharing" +mkdir -p "$PREFS/$ROOM" +echo 'Europe/Oslo' > "$PREFS/$ROOM/TZID" +echo 'share' > "$PREFS/$ROOM/freebusy_sharing" + +mkdir -p "$PREFS/$CAR" +echo 'Europe/Mariehamn' > "$PREFS/$CAR/TZID" +echo 'share' > "$PREFS/$CAR/freebusy_sharing" "$RESOURCE_SCRIPT" $ARGS < $TEMPLATES/fb-request-all.txt 2>> $ERROR \ | "$SHOWMAIL" \ diff -r 55c47d34d4d9 -r c46fb5cff8f1 tests/test_outgoing_invitation.sh --- a/tests/test_outgoing_invitation.sh Thu Aug 06 01:14:20 2015 +0200 +++ b/tests/test_outgoing_invitation.sh Thu Aug 06 01:16:37 2015 +0200 @@ -77,3 +77,44 @@ && grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \ && echo "Success" \ || echo "Failed" + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-day.txt" 2>> $ERROR +cp "$FBFILE" out8.tmp + + ! grep -q '^2' "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Switch time zones. + +echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID" + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR +cp "$FBFILE" out9.tmp + + [ `cat "$FBFILE" | wc -l` = '3' ] \ +&& grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR +cp "$FBFILE" out10.tmp + + ! grep -q '^2' "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-day.txt" 2>> $ERROR +cp "$FBFILE" out11.tmp + + [ `cat "$FBFILE" | wc -l` = '3' ] \ +&& grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-day.txt" 2>> $ERROR +cp "$FBFILE" out12.tmp + + ! grep -q '^2' "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" diff -r 55c47d34d4d9 -r c46fb5cff8f1 tests/test_person_invitation_recurring.sh --- a/tests/test_person_invitation_recurring.sh Thu Aug 06 01:14:20 2015 +0200 +++ b/tests/test_person_invitation_recurring.sh Thu Aug 06 01:16:37 2015 +0200 @@ -140,3 +140,71 @@ ! grep -q "event8@example.com" "$FBOTHERFILE" \ && echo "Success" \ || echo "Failed" + +# Switch time zones. + +echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID" + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out7.tmp + + ! grep -q 'METHOD:REPLY' out7.tmp \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBOTHERFILE" \ +&& echo "Success" \ +|| echo "Failed" + + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" \ +| tee out8.tmp \ +| "$OUTGOING_SCRIPT" $ARGS + + grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out9.tmp + + ! grep -q 'METHOD:REPLY' out9.tmp \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "event8@example.com" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "event8@example.com" "$FBOTHERFILE" \ +&& echo "Success" \ +|| echo "Failed" + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out10.tmp + + ! grep -q 'METHOD:REPLY' out10.tmp \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "^20141211T220000Z${TAB}20141212T220000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + grep -q "^20141211T220000Z${TAB}20141212T220000Z" "$FBOTHERFILE" \ +&& echo "Success" \ +|| echo "Failed" + + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event12@example.com" \ +| tee out11.tmp \ +| "$OUTGOING_SCRIPT" $ARGS + + grep -q "^20141211T220000Z${TAB}20141212T220000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed"