# HG changeset patch # User Paul Boddie # Date 1461095864 -7200 # Node ID 6e78257c4acd4ad85c43da608c69ac2767affb19 # Parent ec9fe77d9b9b6ef6c2b6f170d6c289f2c6e19c99 Added another participant in order to determine the most appropriate way to handle attendee-created recurrences. diff -r ec9fe77d9b9b -r 6e78257c4acd tests/templates/event-request-person-recurring-rdate.txt --- a/tests/templates/event-request-person-recurring-rdate.txt Tue Apr 19 21:22:33 2016 +0200 +++ b/tests/templates/event-request-person-recurring-rdate.txt Tue Apr 19 21:57:44 2016 +0200 @@ -1,7 +1,7 @@ Content-Type: multipart/alternative; boundary="===============0047278175==" MIME-Version: 1.0 From: paul.boddie@example.com -To: vincent.vole@example.com +To: vincent.vole@example.com, harvey.horse@example.com Subject: Invitation! --===============0047278175== @@ -23,6 +23,7 @@ BEGIN:VEVENT ORGANIZER:mailto:paul.boddie@example.com ATTENDEE;RSVP=TRUE:mailto:vincent.vole@example.com +ATTENDEE;RSVP=TRUE:mailto:harvey.horse@example.com ATTENDEE;RSVP=TRUE:mailto:paul.boddie@example.com DTSTAMP:20141009T182400Z DTSTART;TZID=Europe/Oslo:20141010T100000 diff -r ec9fe77d9b9b -r 6e78257c4acd tests/test_person_invitation_decline_instance.sh --- a/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:22:33 2016 +0200 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:57:44 2016 +0200 @@ -2,15 +2,20 @@ . "`dirname \"$0\"`/common.sh" -USER="mailto:vincent.vole@example.com" +USER1="mailto:vincent.vole@example.com" +USER2="mailto:harvey.horse@example.com" SENDER="mailto:paul.boddie@example.com" -mkdir -p "$PREFS/$USER" -echo 'Europe/Oslo' > "$PREFS/$USER/TZID" -echo 'share' > "$PREFS/$USER/freebusy_sharing" +mkdir -p "$PREFS/$USER1" +echo 'Europe/Oslo' > "$PREFS/$USER1/TZID" +echo 'share' > "$PREFS/$USER1/freebusy_sharing" + +mkdir -p "$PREFS/$USER2" +echo 'Europe/Oslo' > "$PREFS/$USER2/TZID" +echo 'share' > "$PREFS/$USER2/freebusy_sharing" mkdir -p "$PREFS/$SENDER" -echo 'Europe/Oslo' > "$PREFS/$USER/TZID" +echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID" # Test free/busy responses. @@ -52,7 +57,7 @@ && echo "Success" \ || echo "Failed" -# Test registration in the incoming handler for the recipient. +# Test registration in the incoming handler for the recipients. "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \ | "$SHOWMAIL" \ @@ -62,49 +67,81 @@ && echo "Success" \ || echo "Failed" - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ > out2f.tmp ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \ && echo "Success" \ || echo "Failed" - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \ > out2o.tmp grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \ && echo "Success" \ || echo "Failed" + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ +> out2f2.tmp + + ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \ +> out2o2.tmp + + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + # There should be an event created by the sender. - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ > out2O.tmp grep -q 'event26@example.com' "out2O.tmp" \ && echo "Success" \ || echo "Failed" + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \ +> out2O2.tmp + + grep -q 'event26@example.com' "out2O2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + # Test acceptance and registration in the outgoing handler. - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event26@example.com" 2>> $ERROR \ + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "event26@example.com" 2>> $ERROR \ | tee out3.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ > out3f.tmp grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \ && echo "Success" \ || echo "Failed" + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER2" "event26@example.com" 2>> $ERROR \ +| tee out32.tmp \ +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR + + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ +> out3f2.tmp + + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + # Test registration in the incoming handler. "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ | "$SHOWMAIL" \ > out4.tmp - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ > out4f.tmp [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \ @@ -112,7 +149,7 @@ && echo "Success" \ || echo "Failed" - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \ > out4o.tmp [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \ @@ -120,13 +157,34 @@ && echo "Success" \ || echo "Failed" -# Test recurrence declining in the outgoing handler. + "$PERSON_SCRIPT" $ARGS < out32.tmp 2>> $ERROR \ +| "$SHOWMAIL" \ +> out42.tmp + + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ +> out4f2.tmp + + [ `grep "event26@example.com" "out4f2.tmp" | wc -l` = '2' ] \ +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f2.tmp" \ +&& echo "Success" \ +|| echo "Failed" - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \ +> out4o2.tmp + + [ `grep "event26@example.com" "out4o2.tmp" | wc -l` = '2' ] \ +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + +# Test recurrence declining in the outgoing handler. +# Only the first user declines. + + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ | tee out5.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ > out5s.tmp [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \ @@ -136,10 +194,10 @@ # There should be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ > out5O.tmp - "$LIST_SCRIPT" $LIST_ARGS "$USER" "recurrence" "event26@example.com" "20141011T100000" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \ > out5R.tmp grep -q 'event26@example.com' "out5O.tmp" \ @@ -161,7 +219,7 @@ && echo "Success" \ || echo "Failed" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \ > out6o.tmp [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \ @@ -169,6 +227,16 @@ && echo "Success" \ || echo "Failed" +# The second user is still attending the original event. + + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \ +> out6o2.tmp + + [ `grep "event26@example.com" "out6o2.tmp" | wc -l` = '2' ] \ +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + # There should be a recurrence created by the user. "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \ @@ -184,11 +252,11 @@ # Test recurrence acceptance in the outgoing handler. - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ | tee out7.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ > out7s.tmp [ `grep "event26@example.com" "out7s.tmp" | wc -l` = '2' ] \ @@ -198,10 +266,10 @@ # There should still be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ > out7O.tmp - "$LIST_SCRIPT" $LIST_ARGS "$USER" "recurrence" "event26@example.com" "20141011T100000" \ + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \ > out7R.tmp grep -q 'event26@example.com' "out7O.tmp" \ @@ -223,7 +291,7 @@ && echo "Success" \ || echo "Failed" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \ > out8o.tmp [ `grep "event26@example.com" "out8o.tmp" | wc -l` = '2' ] \ @@ -231,6 +299,16 @@ && echo "Success" \ || echo "Failed" +# The second user should not have been affected. + + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \ +> out8o2.tmp + + [ `grep "event26@example.com" "out8o2.tmp" | wc -l` = '2' ] \ +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8o2.tmp" \ +&& echo "Success" \ +|| echo "Failed" + # There should be a recurrence created by the user. "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \ diff -r ec9fe77d9b9b -r 6e78257c4acd tests/test_person_invitation_recurring.sh --- a/tests/test_person_invitation_recurring.sh Tue Apr 19 21:22:33 2016 +0200 +++ b/tests/test_person_invitation_recurring.sh Tue Apr 19 21:57:44 2016 +0200 @@ -10,7 +10,7 @@ echo 'share' > "$PREFS/$USER/freebusy_sharing" mkdir -p "$PREFS/$SENDER" -echo 'Europe/Oslo' > "$PREFS/$USER/TZID" +echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID" # Test free/busy responses.