1.1 --- a/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:57:44 2016 +0200
1.2 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 23:44:33 2016 +0200
1.3 @@ -250,6 +250,34 @@
1.4 && echo "Success" \
1.5 || echo "Failed"
1.6
1.7 +# This should cause the organiser to tell the second user about the recurrence.
1.8 +
1.9 + grep -q 'METHOD:REQUEST' out6.tmp \
1.10 +&& echo "Success" \
1.11 +|| echo "Failed"
1.12 +
1.13 + "$PERSON_SCRIPT" $ARGS < out6.tmp 2>> $ERROR \
1.14 +| "$SHOWMAIL" \
1.15 +> out62.tmp
1.16 +
1.17 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \
1.18 +> out6O2.tmp
1.19 +
1.20 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "recurrence" "event26@example.com" "20141011T100000" \
1.21 +> out6R2.tmp
1.22 +
1.23 +# The second user's schedule should remain unchanged.
1.24 +# NOTE: The nature of the periods might need to change, with the recurrence
1.25 +# NOTE: taking over the affected period.
1.26 +
1.27 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.28 +> out6f2.tmp
1.29 +
1.30 + [ `grep "event26@example.com" "out6f2.tmp" | wc -l` = '2' ] \
1.31 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f2.tmp" \
1.32 +&& echo "Success" \
1.33 +|| echo "Failed"
1.34 +
1.35 # Test recurrence acceptance in the outgoing handler.
1.36
1.37 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.38 @@ -321,3 +349,43 @@
1.39 && grep -q 'event26@example.com' "out8R.tmp" \
1.40 && echo "Success" \
1.41 || echo "Failed"
1.42 +
1.43 +# Test recurrence declining in the outgoing handler.
1.44 +# Now the second user declines the parent event.
1.45 +
1.46 + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER2" "event26@example.com" 2>> $ERROR \
1.47 +| tee out9.tmp \
1.48 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.49 +
1.50 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.51 +> out9s.tmp
1.52 +
1.53 + [ `grep "event26@example.com" "out9s.tmp" | wc -l` = '0' ] \
1.54 +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out9s.tmp" \
1.55 +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out9s.tmp" \
1.56 +&& echo "Success" \
1.57 +|| echo "Failed"
1.58 +
1.59 +# Test declining in the incoming handler.
1.60 +
1.61 + "$PERSON_SCRIPT" $ARGS < out9.tmp 2>> $ERROR \
1.62 +| "$SHOWMAIL" \
1.63 +> out10.tmp
1.64 +
1.65 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.66 +> out10f.tmp
1.67 +
1.68 + [ `grep "event26@example.com" "out10f.tmp" | wc -l` = '2' ] \
1.69 +&& grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10f.tmp" \
1.70 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10f.tmp" \
1.71 +&& echo "Success" \
1.72 +|| echo "Failed"
1.73 +
1.74 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.75 +> out10o.tmp
1.76 +
1.77 + [ `grep "event26@example.com" "out10o.tmp" | wc -l` = '1' ] \
1.78 +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10o.tmp" \
1.79 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10o.tmp" \
1.80 +&& echo "Success" \
1.81 +|| echo "Failed"