imip-agent

Changeset

861:2f6b754ee91c
2015-10-17 Paul Boddie raw files shortlog changelog graph Added a test of re-adding cancelled recurrences.
tests/templates/event-add-person-recurring-rescheduled-instance.txt (file) tests/test_person_invitation_refresh.sh (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/templates/event-add-person-recurring-rescheduled-instance.txt	Sat Oct 17 01:06:38 2015 +0200
     1.3 @@ -0,0 +1,36 @@
     1.4 +Content-Type: multipart/alternative; boundary="===============0047278175=="
     1.5 +MIME-Version: 1.0
     1.6 +From: paul.boddie@example.com
     1.7 +To: vincent.vole@example.com
     1.8 +Subject: Invitation!
     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. It adds a previously-cancelled instance.
    1.16 +
    1.17 +--===============0047278175==
    1.18 +MIME-Version: 1.0
    1.19 +Content-Transfer-Encoding: 7bit
    1.20 +Content-Type: text/calendar; charset="us-ascii"; method="ADD"
    1.21 +
    1.22 +BEGIN:VCALENDAR
    1.23 +PRODID:-//imip-agent/test//EN
    1.24 +METHOD:ADD
    1.25 +VERSION:2.0
    1.26 +BEGIN:VEVENT
    1.27 +ORGANIZER:mailto:paul.boddie@example.com
    1.28 +ATTENDEE;RSVP=TRUE:mailto:vincent.vole@example.com
    1.29 +ATTENDEE;RSVP=TRUE:mailto:paul.boddie@example.com
    1.30 +DTSTAMP:20141009T182500Z
    1.31 +DTSTART;TZID=Europe/Oslo:20141010T100000
    1.32 +DTEND;TZID=Europe/Oslo:20141010T110000
    1.33 +SUMMARY:Recurring event
    1.34 +UID:event8@example.com
    1.35 +SEQUENCE:2
    1.36 +END:VEVENT
    1.37 +END:VCALENDAR
    1.38 +
    1.39 +--===============0047278175==--
     2.1 --- a/tests/test_person_invitation_refresh.sh	Sat Oct 17 01:06:09 2015 +0200
     2.2 +++ b/tests/test_person_invitation_refresh.sh	Sat Oct 17 01:06:38 2015 +0200
     2.3 @@ -38,6 +38,7 @@
     2.4  mkdir -p "$PREFS/$USER"
     2.5  echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
     2.6  echo 'share' > "$PREFS/$USER/freebusy_sharing"
     2.7 +echo 'add' > "$PREFS/$USER/add_method_response"
     2.8  
     2.9  mkdir -p "$PREFS/$SENDER"
    2.10  echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
    2.11 @@ -121,11 +122,28 @@
    2.12  && echo "Success" \
    2.13  || echo "Failed"
    2.14  
    2.15 +# Process the resulting message.
    2.16 +
    2.17 +  "$PERSON_SCRIPT" $ARGS < out6.tmp 2>> $ERROR \
    2.18 +| "$SHOWMAIL" \
    2.19 +> out6a.tmp
    2.20 +
    2.21 +   [ -e "$STORE/$USER/objects/event8@example.com" ] \
    2.22 +&& [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \
    2.23 +&& echo "Success" \
    2.24 +|| echo "Failed"
    2.25 +
    2.26  # Cancel a recurrence. Both the original and rescheduled recurrences should be
    2.27  # absent from the free/busy collection.
    2.28  
    2.29  "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-rescheduled-instance.txt" 2>> $ERROR
    2.30  
    2.31 +   [ -e "$STORE/$SENDER/objects/event8@example.com" ] \
    2.32 +&& ! [ -e "$STORE/$SENDER/recurrences/event8@example.com/20141010T080000Z" ] \
    2.33 +&& [ -e "$STORE/$SENDER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \
    2.34 +&& echo "Success" \
    2.35 +|| echo "Failed"
    2.36 +
    2.37     ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \
    2.38  && ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \
    2.39  && echo "Success" \
    2.40 @@ -135,11 +153,61 @@
    2.41  # The additional recurrence should now be absent.
    2.42  
    2.43    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-refresh-person-recurring.txt" 2>> $ERROR \
    2.44 +| tee out7r.tmp \
    2.45  | "$SHOWMAIL" \
    2.46  > out7.tmp
    2.47  
    2.48     grep -q 'METHOD:REQUEST' out7.tmp \
    2.49 -&& ! grep -q 'RECURRENCE-ID' out7.tmp \
    2.50 -&& [ `grep 'BEGIN:VEVENT' out7.tmp | wc -l` = '1' ] \
    2.51 +&& grep -q 'METHOD:CANCEL' out7.tmp \
    2.52 +&& [ `grep 'BEGIN:VEVENT' out7.tmp | wc -l` = '2' ] \
    2.53 +&& echo "Success" \
    2.54 +|| echo "Failed"
    2.55 +
    2.56 +# Process the resulting message.
    2.57 +
    2.58 +  "$PERSON_SCRIPT" $ARGS < out7r.tmp 2>> $ERROR \
    2.59 +| "$SHOWMAIL" \
    2.60 +> out7a.tmp
    2.61 +
    2.62 +   [ -e "$STORE/$USER/objects/event8@example.com" ] \
    2.63 +&& ! [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \
    2.64 +&& [ -e "$STORE/$USER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \
    2.65 +&& echo "Success" \
    2.66 +|| echo "Failed"
    2.67 +
    2.68 +# Re-add the cancelled instance.
    2.69 +
    2.70 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring-rescheduled-instance.txt" 2>> $ERROR
    2.71 +
    2.72 +   grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \
    2.73 +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \
    2.74  && echo "Success" \
    2.75  || echo "Failed"
    2.76 +
    2.77 +  "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring-rescheduled-instance.txt" 2>> $ERROR \
    2.78 +| "$SHOWMAIL" \
    2.79 +> out8.tmp
    2.80 +
    2.81 +   [ -e "$STORE/$USER/objects/event8@example.com" ] \
    2.82 +&& [ -e "$STORE/$USER/recurrences/event8@example.com/20141010T080000Z" ] \
    2.83 +&& ! [ -e "$STORE/$USER/cancellations/recurrences/event8@example.com/20141010T080000Z" ] \
    2.84 +&& echo "Success" \
    2.85 +|| echo "Failed"
    2.86 +
    2.87 +   ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBFILE" \
    2.88 +&& echo "Success" \
    2.89 +|| echo "Failed"
    2.90 +
    2.91 +   grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBOTHERFILE" \
    2.92 +&& echo "Success" \
    2.93 +|| echo "Failed"
    2.94 +
    2.95 +# Test acceptance and registration in the outgoing handler.
    2.96 +
    2.97 +  "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20141010T080000Z" 2>> $ERROR \
    2.98 +| tee out9.tmp \
    2.99 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
   2.100 +
   2.101 +   grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBFILE" \
   2.102 +&& echo "Success" \
   2.103 +|| echo "Failed"