# HG changeset patch # User Paul Boddie # Date 1445036798 -7200 # Node ID 2f6b754ee91c08b7b8857513cdcc1f74162349f7 # Parent b596e4414b77a7f8600dd8639ac81d15cb55e8bb Added a test of re-adding cancelled recurrences. diff -r b596e4414b77 -r 2f6b754ee91c tests/templates/event-add-person-recurring-rescheduled-instance.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-add-person-recurring-rescheduled-instance.txt Sat Oct 17 01:06:38 2015 +0200 @@ -0,0 +1,36 @@ +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. It adds a previously-cancelled instance. + +--===============0047278175== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/calendar; charset="us-ascii"; method="ADD" + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:ADD +VERSION:2.0 +BEGIN:VEVENT +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE;RSVP=TRUE:mailto:vincent.vole@example.com +ATTENDEE;RSVP=TRUE:mailto:paul.boddie@example.com +DTSTAMP:20141009T182500Z +DTSTART;TZID=Europe/Oslo:20141010T100000 +DTEND;TZID=Europe/Oslo:20141010T110000 +SUMMARY:Recurring event +UID:event8@example.com +SEQUENCE:2 +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r b596e4414b77 -r 2f6b754ee91c tests/test_person_invitation_refresh.sh --- a/tests/test_person_invitation_refresh.sh Sat Oct 17 01:06:09 2015 +0200 +++ b/tests/test_person_invitation_refresh.sh Sat Oct 17 01:06:38 2015 +0200 @@ -38,6 +38,7 @@ mkdir -p "$PREFS/$USER" echo 'Europe/Oslo' > "$PREFS/$USER/TZID" echo 'share' > "$PREFS/$USER/freebusy_sharing" +echo 'add' > "$PREFS/$USER/add_method_response" mkdir -p "$PREFS/$SENDER" echo 'Europe/Oslo' > "$PREFS/$USER/TZID" @@ -121,11 +122,28 @@ && echo "Success" \ || echo "Failed" +# Process the resulting message. + + "$PERSON_SCRIPT" $ARGS < out6.tmp 2>> $ERROR \ +| "$SHOWMAIL" \ +> out6a.tmp + + [ -e "$STORE/$USER/objects/event8@example.com" ] \ +&& [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \ +&& echo "Success" \ +|| echo "Failed" + # Cancel a recurrence. Both the original and rescheduled recurrences should be # absent from the free/busy collection. "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-rescheduled-instance.txt" 2>> $ERROR + [ -e "$STORE/$SENDER/objects/event8@example.com" ] \ +&& ! [ -e "$STORE/$SENDER/recurrences/event8@example.com/20141010T080000Z" ] \ +&& [ -e "$STORE/$SENDER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \ +&& echo "Success" \ +|| echo "Failed" + ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \ && ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \ && echo "Success" \ @@ -135,11 +153,61 @@ # The additional recurrence should now be absent. "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-refresh-person-recurring.txt" 2>> $ERROR \ +| tee out7r.tmp \ | "$SHOWMAIL" \ > out7.tmp grep -q 'METHOD:REQUEST' out7.tmp \ -&& ! grep -q 'RECURRENCE-ID' out7.tmp \ -&& [ `grep 'BEGIN:VEVENT' out7.tmp | wc -l` = '1' ] \ +&& grep -q 'METHOD:CANCEL' out7.tmp \ +&& [ `grep 'BEGIN:VEVENT' out7.tmp | wc -l` = '2' ] \ +&& echo "Success" \ +|| echo "Failed" + +# Process the resulting message. + + "$PERSON_SCRIPT" $ARGS < out7r.tmp 2>> $ERROR \ +| "$SHOWMAIL" \ +> out7a.tmp + + [ -e "$STORE/$USER/objects/event8@example.com" ] \ +&& ! [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \ +&& [ -e "$STORE/$USER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \ +&& echo "Success" \ +|| echo "Failed" + +# Re-add the cancelled instance. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring-rescheduled-instance.txt" 2>> $ERROR + + grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \ +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \ && echo "Success" \ || echo "Failed" + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring-rescheduled-instance.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out8.tmp + + [ -e "$STORE/$USER/objects/event8@example.com" ] \ +&& [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \ +&& ! [ -e "$STORE/$USER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \ +&& echo "Success" \ +|| echo "Failed" + + ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBOTHERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test acceptance and registration in the outgoing handler. + + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20141010T080000Z" 2>> $ERROR \ +| tee out9.tmp \ +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR + + grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed"