# HG changeset patch # User Paul Boddie # Date 1516496761 -3600 # Node ID 8e5a2dd7e7b4c9e4ba737e80a1e6598a5e41a4ff # Parent be8ebc16d77506df82443aa9cc0745c9ad17ba93 Introduced text client and helper function usage. diff -r be8ebc16d775 -r 8e5a2dd7e7b4 tests/test_person_invitation_decline_instance.sh --- a/tests/test_person_invitation_decline_instance.sh Sun Jan 21 02:05:35 2018 +0100 +++ b/tests/test_person_invitation_decline_instance.sh Sun Jan 21 02:06:01 2018 +0100 @@ -17,376 +17,295 @@ mkdir -p "$PREFS/$SENDER" echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID" -# Test free/busy responses. - - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \ -| "$SHOWMAIL" \ -> out0.tmp +# Test the recipient's initial free/busy state. - grep -q 'METHOD:REPLY' out0.tmp \ -&& ! grep -q '^FREEBUSY' out0.tmp \ -&& echo "Success" \ -|| echo "Failed" +test_initial_freebusy +test_initial_freebusy_limited - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \ -| "$SHOWMAIL" \ -> out1.tmp +# Make a new event. - grep -q 'METHOD:REPLY' out1.tmp \ -&& ! grep -q '^FREEBUSY' out1.tmp \ -&& echo "Success" \ -|| echo "Failed" - -# Publish an event, testing registration in the outgoing handler. +cat > "event_cmd.tmp" <> $ERROR +text_client "$SENDER" "event_cmd.tmp" + +# Obtain the event UID. + +read UID1 < "event_uid.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ -> out1f.tmp +# Register the event at the sender. + +outgoing_script "event_self.tmp" - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out1f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Expect free/busy periods at the sender. + +list_script "out1f.tmp" "$SENDER" "freebusy" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out1f.tmp" # There should be an event created by the sender. - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \ -> out1O.tmp +list_script "out1O.tmp" "$SENDER" "object" "$UID1" +is_present "$UID1" "out1O.tmp" && success || failed "out1O.tmp" - grep -q 'event26@example.com' "out1O.tmp" \ -&& echo "Success" \ -|| echo "Failed" - -# Test registration in the incoming handler for the recipients. +# Present the event to the recipients. - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \ -| "$SHOWMAIL" \ -> out2.tmp +person_script "event.tmp" "out2.tmp" + +# Expect no reply because the recipients must handle the request. - ! grep -q 'METHOD:REPLY' out2.tmp \ -&& echo "Success" \ -|| echo "Failed" +is_absent 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out2f.tmp +# Expect no free/busy periods for the recipients. - ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out2f1.tmp" "$USER1" "freebusy" +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out2f1.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \ -> out2o.tmp - - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out2f2.tmp" "$USER2" "freebusy" +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out2f2.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ -> out2f2.tmp - - ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Expect free/busy periods for the sender at the recipients. - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \ -> out2o2.tmp +list_script "out2fo1.tmp" "$USER1" "freebusy_other" "$SENDER" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out2fo1.tmp" - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out2fo2.tmp" "$USER2" "freebusy_other" "$SENDER" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out2fo2.tmp" # There should be an event created by the sender. - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ -> out2O.tmp +list_script "out2O1.tmp" "$USER1" "object" "$UID1" +is_present "$UID1" "out2O1.tmp" && success || failed "out2O1.tmp" - grep -q 'event26@example.com' "out2O.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out2O2.tmp" "$USER1" "object" "$UID1" +is_present "$UID1" "out2O2.tmp" && success || failed "out2O2.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \ -> out2O2.tmp +# Accept the invitation. - grep -q 'event26@example.com' "out2O2.tmp" \ -&& echo "Success" \ -|| echo "Failed" - -# Test acceptance and registration in the outgoing handler. +cat > "event_accept1_cmd.tmp" <> $ERROR \ -| tee out3.tmp \ -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR + sed 's/event_accept1.tmp/event_accept2.tmp/' "event_accept1_cmd.tmp" \ +> "event_accept2_cmd.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out3f.tmp +text_client_specific "$USER1" "event_accept1_cmd.tmp" "$UID1" +text_client_specific "$USER2" "event_accept2_cmd.tmp" "$UID1" - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Register the acceptance at the recipients. - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER2" "event26@example.com" 2>> $ERROR \ -| tee out32.tmp \ -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR +outgoing_script "event_accept1.tmp" +outgoing_script "event_accept2.tmp" + +# Expect free/busy periods at the recipients. - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out3f2.tmp +list_script "out3f1.tmp" "$USER1" "freebusy" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out3f1.tmp" - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out3f2.tmp" "$USER2" "freebusy" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out3f2.tmp" # Test registration in the incoming handler. - "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ -| "$SHOWMAIL" \ -> out4.tmp - - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out4f.tmp - - [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +person_script "event_accept1.tmp" "out4i1.tmp" +list_script "out4f1.tmp" "$SENDER" "freebusy_other" "$USER1" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out4f1.tmp" +list_script "out4f2v1.tmp" "$SENDER" "freebusy_other" "$USER2" +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out4f2v1.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \ -> out4o.tmp +person_script "event_accept2.tmp" "out4i2.tmp" +list_script "out4f2v2.tmp" "$SENDER" "freebusy_other" "$USER1" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out4f2v2.tmp" - [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o.tmp" \ -&& echo "Success" \ -|| echo "Failed" - - "$PERSON_SCRIPT" $ARGS < out32.tmp 2>> $ERROR \ -| "$SHOWMAIL" \ -> out42.tmp - - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ -> out4f2.tmp +# Decline the invitation to the recurrence for the first user. - [ `grep "event26@example.com" "out4f2.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +cat > "event_decline1_cmd.tmp" < out4o2.tmp - - [ `grep "event26@example.com" "out4o2.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +text_client_specific "$USER1" "event_decline1_cmd.tmp" "$UID1" '20141011T080000Z' -# Test recurrence declining in the outgoing handler. -# Only the first user declines. +# Register the rejection at the user. - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ -| tee out5.tmp \ -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR +outgoing_script "event_decline1.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out5s.tmp +# Expect only one free/busy period at the user. - [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \ -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5s.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out5s.tmp" "$USER1" "freebusy" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out5s.tmp" +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out5s.tmp" # There should be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ -> out5O.tmp +list_script "out5O.tmp" "$USER1" "object" "$UID1" +is_present "$UID1" "out5O.tmp" && success || failed "out5O.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \ -> out5R.tmp +list_script "out5R.tmp" "$USER1" "recurrence" "$UID1" '20141011T080000Z' +is_present "$UID1" "out5R.tmp" && success || failed "out5R.tmp" - grep -q 'event26@example.com' "out5O.tmp" \ -&& grep -q 'event26@example.com' "out5R.tmp" \ -&& echo "Success" \ -|| echo "Failed" - -# Test declining in the incoming handler. +# Register the rejection at the sender. - "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \ -| tee out6r.tmp \ -| "$SHOWMAIL" \ -> out6.tmp +person_script "event_decline1.tmp" "out6.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ -> out6f.tmp +# Expect two free/busy periods for the sender. - [ `grep "event26@example.com" "out6f.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out6f.tmp" "$SENDER" "freebusy" +have_occurrences "$UID1" 2 "out6f.tmp" && success || failed "out6f.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6f.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6f.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \ -> out6o.tmp +# Expect one free/busy period for the first user at the sender. - [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \ -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o.tmp" \ -&& echo "Success" \ -|| echo "Failed" - -# The second user is still attending the original event. +list_script "out6o1.tmp" "$SENDER" "freebusy_other" "$USER1" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6o1.tmp" +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out6o1.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \ -> out6o2.tmp +# Expect two free/busy periods for the second user at the sender. - [ `grep "event26@example.com" "out6o2.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out6o2.tmp" "$SENDER" "freebusy_other" "$USER2" +have_occurrences "$UID1" 2 "out6o2.tmp" && success || failed "out6o2.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6o2.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6o2.tmp" # There should be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \ -> out6O.tmp +list_script "out6O.tmp" "$SENDER" "object" "$UID1" +is_present "$UID1" "out6O.tmp" && success || failed "out6O.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "recurrence" "event26@example.com" "20141011T100000" \ -> out6R.tmp - - grep -q 'event26@example.com' "out6O.tmp" \ -&& grep -q 'event26@example.com' "out6R.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out6R.tmp" "$SENDER" "recurrence" "$UID1" '20141011T080000Z' +is_present "$UID1" "out6R.tmp" && success || failed "out6R.tmp" # This should cause the organiser to tell the second user about the recurrence. - grep -q 'METHOD:REQUEST' out6.tmp \ -&& echo "Success" \ -|| echo "Failed" +is_present 'METHOD:REQUEST' "out6.tmp" && success || failed "out6.tmp" + +# Present the update to the second user. + +person_script "out6.tmp" "out62.tmp" - "$PERSON_SCRIPT" $ARGS < out6r.tmp 2>> $ERROR \ -| "$SHOWMAIL" \ -> out62.tmp +# There should be a recurrence created by the first user at the second user. - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \ -> out6O2.tmp +list_script "out6O2.tmp" "$USER2" "object" "$UID1" +is_present "$UID1" "out6O2.tmp" && success || failed "out6O2.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "recurrence" "event26@example.com" "20141011T100000" \ -> out6R2.tmp +list_script "out6R2.tmp" "$USER2" "recurrence" "$UID1" '20141011T080000Z' +is_present "$UID1" "out6R2.tmp" && success || failed "out6R2.tmp" # The second user's schedule should remain unchanged. # NOTE: The nature of the periods might need to change, with the recurrence # NOTE: taking over the affected period. - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ -> out6f2.tmp +list_script "out6f2.tmp" "$USER2" "freebusy" +have_occurrences "$UID1" 2 "out6f2.tmp" && success || failed "out6f2.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6f2.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6f2.tmp" - [ `grep "event26@example.com" "out6f2.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f2.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Accept the invitation for the recurrence at the first user. -# Test recurrence acceptance in the outgoing handler. + sed 's/event_accept1.tmp/event_accept1r.tmp/' "event_accept1_cmd.tmp" \ +> "event_accept1r_cmd.tmp" - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ -| tee out7.tmp \ -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR +text_client_specific "$USER1" "event_accept1r_cmd.tmp" "$UID1" '20141011T080000Z' + +# Register acceptance in the outgoing handler. + +outgoing_script "event_accept1r.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \ -> out7s.tmp +# Expect both periods in the user's free/busy collection. - [ `grep "event26@example.com" "out7s.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out7s.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out7f.tmp" "$USER1" "freebusy" +have_occurrences "$UID1" 2 "out7f.tmp" && success || failed "out7f.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out7f.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out7f.tmp" # There should still be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \ -> out7O.tmp +list_script "out7O.tmp" "$USER1" "object" "$UID1" +is_present "$UID1" "out7O.tmp" && success || failed "out7O.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \ -> out7R.tmp +list_script "out7R.tmp" "$USER1" "recurrence" "$UID1" '20141011T080000Z' +is_present "$UID1" "out7R.tmp" && success || failed "out7R.tmp" - grep -q 'event26@example.com' "out7O.tmp" \ -&& grep -q 'event26@example.com' "out7R.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Register the acceptance at the sender. -# Test acceptance in the incoming handler. +person_script "event_accept1r.tmp" "out8.tmp" + +# Expect both periods in the sender's free/busy collection. - "$PERSON_SCRIPT" $ARGS < out7.tmp 2>> $ERROR \ -| "$SHOWMAIL" \ -> out8.tmp - - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ -> out8f.tmp +list_script "out8f.tmp" "$SENDER" "freebusy" +have_occurrences "$UID1" 2 "out8f.tmp" && success || failed "out8f.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8f.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8f.tmp" - [ `grep "event26@example.com" "out8f.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +# Expect both periods for the first user at the sender. - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \ -> out8o.tmp - - [ `grep "event26@example.com" "out8o.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8o.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out8o1.tmp" "$SENDER" "freebusy_other" "$USER1" +have_occurrences "$UID1" 2 "out8o1.tmp" && success || failed "out8o1.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8o1.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8o1.tmp" # 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" +list_script "out8o2.tmp" "$SENDER" "freebusy_other" "$USER2" +have_occurrences "$UID1" 2 "out8o2.tmp" && success || failed "out8o2.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8o2.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8o2.tmp" # There should be a recurrence created by the user. - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \ -> out8O.tmp +list_script "out8O.tmp" "$SENDER" "object" "$UID1" +is_present "$UID1" "out8O.tmp" && success || failed "out8O.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "recurrence" "event26@example.com" "20141011T100000" \ -> out8R.tmp - - grep -q 'event26@example.com' "out8O.tmp" \ -&& grep -q 'event26@example.com' "out8R.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out8R.tmp" "$SENDER" "recurrence" "$UID1" '20141011T080000Z' +is_present "$UID1" "out8R.tmp" && success || failed "out8R.tmp" # Test recurrence declining in the outgoing handler. # Now the second user declines the parent event. - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER2" "event26@example.com" 2>> $ERROR \ -| tee out9.tmp \ -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR + sed 's/event_decline1.tmp/event_decline2.tmp/' "event_decline1_cmd.tmp" \ +> "event_decline2_cmd.tmp" + +text_client_specific "$USER2" "event_decline2_cmd.tmp" "$UID1" + +# Register acceptance in the outgoing handler. - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \ -> out9s.tmp +outgoing_script "event_decline2.tmp" + +# Expect only the recurrence period for the second user. - [ `grep "event26@example.com" "out9s.tmp" | wc -l` = '0' ] \ -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out9s.tmp" \ -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out9s.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out9s.tmp" "$USER2" "freebusy" +have_occurrences "$UID1" 1 "out9s.tmp" && success || failed "out9s.tmp" +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out9s.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out9s.tmp" # Test declining in the incoming handler. - "$PERSON_SCRIPT" $ARGS < out9.tmp 2>> $ERROR \ -| "$SHOWMAIL" \ -> out10.tmp +person_script "event_decline2.tmp" "out10.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ -> out10f.tmp +# Expect periods for the organiser as before. - [ `grep "event26@example.com" "out10f.tmp" | wc -l` = '2' ] \ -&& grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10f.tmp" \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10f.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out10f.tmp" "$SENDER" "freebusy" +have_occurrences "$UID1" 2 "out10f.tmp" && success || failed "out10f.tmp" +test_freebusy '20141010T080000Z' '20141010T090000Z' "out10f.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out10f.tmp" - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \ -> out10o.tmp +# Expect only the recurrence period for the second user at the organiser. - [ `grep "event26@example.com" "out10o.tmp" | wc -l` = '1' ] \ -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10o.tmp" \ -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10o.tmp" \ -&& echo "Success" \ -|| echo "Failed" +list_script "out10o2.tmp" "$SENDER" "freebusy_other" "$USER2" +have_occurrences "$UID1" 1 "out10o2.tmp" && success || failed "out10o2.tmp" +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out10o2.tmp" +test_freebusy '20141011T080000Z' '20141011T090000Z' "out10o2.tmp"