# HG changeset patch # User Paul Boddie # Date 1441401950 -7200 # Node ID 4b4475ea6b6a5a83f29cc0ec2afa80431dae861a # Parent fad0c1540cf8ffd984bd6337603223c5e871b7ad Added outgoing handler tests for the sender. diff -r fad0c1540cf8 -r 4b4475ea6b6a tests/test_person_invitation_recurring.sh --- a/tests/test_person_invitation_recurring.sh Fri Sep 04 00:26:36 2015 +0200 +++ b/tests/test_person_invitation_recurring.sh Fri Sep 04 23:25:50 2015 +0200 @@ -13,6 +13,7 @@ SENDER="mailto:paul.boddie@example.com" FBFILE="$STORE/$USER/freebusy" FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER" +FBSENDERFILE="$STORE/$SENDER/freebusy" TAB=`printf '\t'` OUTGOING_SCRIPT="$THIS_DIR/../imip_person_outgoing.py" @@ -38,6 +39,11 @@ echo 'Europe/Oslo' > "$PREFS/$USER/TZID" echo 'share' > "$PREFS/$USER/freebusy_sharing" +mkdir -p "$PREFS/$SENDER" +echo 'Europe/Oslo' > "$PREFS/$USER/TZID" + +# Test free/busy responses. + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out0.tmp @@ -56,6 +62,16 @@ && echo "Success" \ || echo "Failed" +# Publish an event, testing registration in the outgoing handler. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR + + grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test registration in the incoming handler for the recipient. + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out2.tmp @@ -72,6 +88,8 @@ && echo "Success" \ || echo "Failed" +# Test acceptance and registration in the outgoing handler. + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \ | tee out3.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR @@ -80,6 +98,17 @@ && echo "Success" \ || echo "Failed" +# Test recurrence cancellation in the outgoing handler. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR + + [ `grep "event8@example.com" "$FBSENDERFILE" | wc -l` = '2' ] \ +&& ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test cancellation in the incoming handler. + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out4.tmp @@ -98,6 +127,17 @@ && echo "Success" \ || echo "Failed" +# Test rescheduling in the outgoing handler. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR + + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \ +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test rescheduling in the incoming handler. + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out5.tmp @@ -116,6 +156,8 @@ && echo "Success" \ || echo "Failed" +# Test rescheduling acceptance in the outgoing handler. + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20141010T080000Z" 2>> $ERROR \ | tee out6.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR @@ -125,6 +167,16 @@ && echo "Success" \ || echo "Failed" +# Test complete cancellation in the outgoing handler. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR + + ! grep -q "event8@example.com" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test complete cancellation in the incoming handler. + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out6.tmp @@ -145,6 +197,12 @@ echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID" +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR + + grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out7.tmp @@ -169,6 +227,12 @@ && echo "Success" \ || echo "Failed" +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR + + ! grep -q "event8@example.com" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out9.tmp @@ -185,6 +249,15 @@ && echo "Success" \ || echo "Failed" +# Test floating dates. Here, the outgoing interpretation is different because +# the sender is in a different time zone. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR + + grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR \ | "$SHOWMAIL" \ > out10.tmp