1.1 --- a/tests/test_person_invitation_decline_instance.sh Sun Jan 21 02:05:35 2018 +0100
1.2 +++ b/tests/test_person_invitation_decline_instance.sh Sun Jan 21 02:06:01 2018 +0100
1.3 @@ -17,376 +17,295 @@
1.4 mkdir -p "$PREFS/$SENDER"
1.5 echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID"
1.6
1.7 -# Test free/busy responses.
1.8 -
1.9 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \
1.10 -| "$SHOWMAIL" \
1.11 -> out0.tmp
1.12 +# Test the recipient's initial free/busy state.
1.13
1.14 - grep -q 'METHOD:REPLY' out0.tmp \
1.15 -&& ! grep -q '^FREEBUSY' out0.tmp \
1.16 -&& echo "Success" \
1.17 -|| echo "Failed"
1.18 +test_initial_freebusy
1.19 +test_initial_freebusy_limited
1.20
1.21 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \
1.22 -| "$SHOWMAIL" \
1.23 -> out1.tmp
1.24 +# Make a new event.
1.25
1.26 - grep -q 'METHOD:REPLY' out1.tmp \
1.27 -&& ! grep -q '^FREEBUSY' out1.tmp \
1.28 -&& echo "Success" \
1.29 -|| echo "Failed"
1.30 -
1.31 -# Publish an event, testing registration in the outgoing handler.
1.32 +cat > "event_cmd.tmp" <<EOF
1.33 +new
1.34 +period 0 edit 20141010 10 00 00 Europe/Oslo 20141010 11 00 00 Europe/Oslo
1.35 +period new 20141011 10 00 00 Europe/Oslo 20141011 11 00 00 Europe/Oslo
1.36 +attendance accept
1.37 +attendee mailto:vincent.vole@example.com
1.38 +attendee mailto:harvey.horse@example.com
1.39 +summary Recurring event
1.40 +finish
1.41 +update event.tmp
1.42 +publish event_self.tmp
1.43 +UID event_uid.tmp
1.44 +EOF
1.45
1.46 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR
1.47 +text_client "$SENDER" "event_cmd.tmp"
1.48 +
1.49 +# Obtain the event UID.
1.50 +
1.51 +read UID1 < "event_uid.tmp"
1.52
1.53 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.54 -> out1f.tmp
1.55 +# Register the event at the sender.
1.56 +
1.57 +outgoing_script "event_self.tmp"
1.58
1.59 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out1f.tmp" \
1.60 -&& echo "Success" \
1.61 -|| echo "Failed"
1.62 +# Expect free/busy periods at the sender.
1.63 +
1.64 +list_script "out1f.tmp" "$SENDER" "freebusy"
1.65 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out1f.tmp"
1.66
1.67 # There should be an event created by the sender.
1.68
1.69 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \
1.70 -> out1O.tmp
1.71 +list_script "out1O.tmp" "$SENDER" "object" "$UID1"
1.72 +is_present "$UID1" "out1O.tmp" && success || failed "out1O.tmp"
1.73
1.74 - grep -q 'event26@example.com' "out1O.tmp" \
1.75 -&& echo "Success" \
1.76 -|| echo "Failed"
1.77 -
1.78 -# Test registration in the incoming handler for the recipients.
1.79 +# Present the event to the recipients.
1.80
1.81 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \
1.82 -| "$SHOWMAIL" \
1.83 -> out2.tmp
1.84 +person_script "event.tmp" "out2.tmp"
1.85 +
1.86 +# Expect no reply because the recipients must handle the request.
1.87
1.88 - ! grep -q 'METHOD:REPLY' out2.tmp \
1.89 -&& echo "Success" \
1.90 -|| echo "Failed"
1.91 +is_absent 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp"
1.92
1.93 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.94 -> out2f.tmp
1.95 +# Expect no free/busy periods for the recipients.
1.96
1.97 - ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \
1.98 -&& echo "Success" \
1.99 -|| echo "Failed"
1.100 +list_script "out2f1.tmp" "$USER1" "freebusy"
1.101 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out2f1.tmp"
1.102
1.103 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \
1.104 -> out2o.tmp
1.105 -
1.106 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \
1.107 -&& echo "Success" \
1.108 -|| echo "Failed"
1.109 +list_script "out2f2.tmp" "$USER2" "freebusy"
1.110 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out2f2.tmp"
1.111
1.112 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.113 -> out2f2.tmp
1.114 -
1.115 - ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f2.tmp" \
1.116 -&& echo "Success" \
1.117 -|| echo "Failed"
1.118 +# Expect free/busy periods for the sender at the recipients.
1.119
1.120 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \
1.121 -> out2o2.tmp
1.122 +list_script "out2fo1.tmp" "$USER1" "freebusy_other" "$SENDER"
1.123 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out2fo1.tmp"
1.124
1.125 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o2.tmp" \
1.126 -&& echo "Success" \
1.127 -|| echo "Failed"
1.128 +list_script "out2fo2.tmp" "$USER2" "freebusy_other" "$SENDER"
1.129 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out2fo2.tmp"
1.130
1.131 # There should be an event created by the sender.
1.132
1.133 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.134 -> out2O.tmp
1.135 +list_script "out2O1.tmp" "$USER1" "object" "$UID1"
1.136 +is_present "$UID1" "out2O1.tmp" && success || failed "out2O1.tmp"
1.137
1.138 - grep -q 'event26@example.com' "out2O.tmp" \
1.139 -&& echo "Success" \
1.140 -|| echo "Failed"
1.141 +list_script "out2O2.tmp" "$USER1" "object" "$UID1"
1.142 +is_present "$UID1" "out2O2.tmp" && success || failed "out2O2.tmp"
1.143
1.144 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \
1.145 -> out2O2.tmp
1.146 +# Accept the invitation.
1.147
1.148 - grep -q 'event26@example.com' "out2O2.tmp" \
1.149 -&& echo "Success" \
1.150 -|| echo "Failed"
1.151 -
1.152 -# Test acceptance and registration in the outgoing handler.
1.153 +cat > "event_accept1_cmd.tmp" <<EOF
1.154 +attendance accept
1.155 +finish
1.156 +update event_accept1.tmp
1.157 +EOF
1.158
1.159 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "event26@example.com" 2>> $ERROR \
1.160 -| tee out3.tmp \
1.161 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.162 + sed 's/event_accept1.tmp/event_accept2.tmp/' "event_accept1_cmd.tmp" \
1.163 +> "event_accept2_cmd.tmp"
1.164
1.165 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.166 -> out3f.tmp
1.167 +text_client_specific "$USER1" "event_accept1_cmd.tmp" "$UID1"
1.168 +text_client_specific "$USER2" "event_accept2_cmd.tmp" "$UID1"
1.169
1.170 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \
1.171 -&& echo "Success" \
1.172 -|| echo "Failed"
1.173 +# Register the acceptance at the recipients.
1.174
1.175 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER2" "event26@example.com" 2>> $ERROR \
1.176 -| tee out32.tmp \
1.177 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.178 +outgoing_script "event_accept1.tmp"
1.179 +outgoing_script "event_accept2.tmp"
1.180 +
1.181 +# Expect free/busy periods at the recipients.
1.182
1.183 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.184 -> out3f2.tmp
1.185 +list_script "out3f1.tmp" "$USER1" "freebusy"
1.186 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out3f1.tmp"
1.187
1.188 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f2.tmp" \
1.189 -&& echo "Success" \
1.190 -|| echo "Failed"
1.191 +list_script "out3f2.tmp" "$USER2" "freebusy"
1.192 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out3f2.tmp"
1.193
1.194 # Test registration in the incoming handler.
1.195
1.196 - "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \
1.197 -| "$SHOWMAIL" \
1.198 -> out4.tmp
1.199 -
1.200 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.201 -> out4f.tmp
1.202 -
1.203 - [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \
1.204 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f.tmp" \
1.205 -&& echo "Success" \
1.206 -|| echo "Failed"
1.207 +person_script "event_accept1.tmp" "out4i1.tmp"
1.208 +list_script "out4f1.tmp" "$SENDER" "freebusy_other" "$USER1"
1.209 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out4f1.tmp"
1.210 +list_script "out4f2v1.tmp" "$SENDER" "freebusy_other" "$USER2"
1.211 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out4f2v1.tmp"
1.212
1.213 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \
1.214 -> out4o.tmp
1.215 +person_script "event_accept2.tmp" "out4i2.tmp"
1.216 +list_script "out4f2v2.tmp" "$SENDER" "freebusy_other" "$USER1"
1.217 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out4f2v2.tmp"
1.218
1.219 - [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \
1.220 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o.tmp" \
1.221 -&& echo "Success" \
1.222 -|| echo "Failed"
1.223 -
1.224 - "$PERSON_SCRIPT" $ARGS < out32.tmp 2>> $ERROR \
1.225 -| "$SHOWMAIL" \
1.226 -> out42.tmp
1.227 -
1.228 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.229 -> out4f2.tmp
1.230 +# Decline the invitation to the recurrence for the first user.
1.231
1.232 - [ `grep "event26@example.com" "out4f2.tmp" | wc -l` = '2' ] \
1.233 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f2.tmp" \
1.234 -&& echo "Success" \
1.235 -|| echo "Failed"
1.236 +cat > "event_decline1_cmd.tmp" <<EOF
1.237 +attendance decline
1.238 +finish
1.239 +update event_decline1.tmp
1.240 +EOF
1.241
1.242 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \
1.243 -> out4o2.tmp
1.244 -
1.245 - [ `grep "event26@example.com" "out4o2.tmp" | wc -l` = '2' ] \
1.246 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o2.tmp" \
1.247 -&& echo "Success" \
1.248 -|| echo "Failed"
1.249 +text_client_specific "$USER1" "event_decline1_cmd.tmp" "$UID1" '20141011T080000Z'
1.250
1.251 -# Test recurrence declining in the outgoing handler.
1.252 -# Only the first user declines.
1.253 +# Register the rejection at the user.
1.254
1.255 - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.256 -| tee out5.tmp \
1.257 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.258 +outgoing_script "event_decline1.tmp"
1.259
1.260 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.261 -> out5s.tmp
1.262 +# Expect only one free/busy period at the user.
1.263
1.264 - [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \
1.265 -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5s.tmp" \
1.266 -&& echo "Success" \
1.267 -|| echo "Failed"
1.268 +list_script "out5s.tmp" "$USER1" "freebusy"
1.269 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out5s.tmp"
1.270 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out5s.tmp"
1.271
1.272 # There should be a recurrence created by the user.
1.273
1.274 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.275 -> out5O.tmp
1.276 +list_script "out5O.tmp" "$USER1" "object" "$UID1"
1.277 +is_present "$UID1" "out5O.tmp" && success || failed "out5O.tmp"
1.278
1.279 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \
1.280 -> out5R.tmp
1.281 +list_script "out5R.tmp" "$USER1" "recurrence" "$UID1" '20141011T080000Z'
1.282 +is_present "$UID1" "out5R.tmp" && success || failed "out5R.tmp"
1.283
1.284 - grep -q 'event26@example.com' "out5O.tmp" \
1.285 -&& grep -q 'event26@example.com' "out5R.tmp" \
1.286 -&& echo "Success" \
1.287 -|| echo "Failed"
1.288 -
1.289 -# Test declining in the incoming handler.
1.290 +# Register the rejection at the sender.
1.291
1.292 - "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \
1.293 -| tee out6r.tmp \
1.294 -| "$SHOWMAIL" \
1.295 -> out6.tmp
1.296 +person_script "event_decline1.tmp" "out6.tmp"
1.297
1.298 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.299 -> out6f.tmp
1.300 +# Expect two free/busy periods for the sender.
1.301
1.302 - [ `grep "event26@example.com" "out6f.tmp" | wc -l` = '2' ] \
1.303 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f.tmp" \
1.304 -&& echo "Success" \
1.305 -|| echo "Failed"
1.306 +list_script "out6f.tmp" "$SENDER" "freebusy"
1.307 +have_occurrences "$UID1" 2 "out6f.tmp" && success || failed "out6f.tmp"
1.308 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6f.tmp"
1.309 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6f.tmp"
1.310
1.311 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.312 -> out6o.tmp
1.313 +# Expect one free/busy period for the first user at the sender.
1.314
1.315 - [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \
1.316 -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o.tmp" \
1.317 -&& echo "Success" \
1.318 -|| echo "Failed"
1.319 -
1.320 -# The second user is still attending the original event.
1.321 +list_script "out6o1.tmp" "$SENDER" "freebusy_other" "$USER1"
1.322 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6o1.tmp"
1.323 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out6o1.tmp"
1.324
1.325 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.326 -> out6o2.tmp
1.327 +# Expect two free/busy periods for the second user at the sender.
1.328
1.329 - [ `grep "event26@example.com" "out6o2.tmp" | wc -l` = '2' ] \
1.330 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o2.tmp" \
1.331 -&& echo "Success" \
1.332 -|| echo "Failed"
1.333 +list_script "out6o2.tmp" "$SENDER" "freebusy_other" "$USER2"
1.334 +have_occurrences "$UID1" 2 "out6o2.tmp" && success || failed "out6o2.tmp"
1.335 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6o2.tmp"
1.336 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6o2.tmp"
1.337
1.338 # There should be a recurrence created by the user.
1.339
1.340 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \
1.341 -> out6O.tmp
1.342 +list_script "out6O.tmp" "$SENDER" "object" "$UID1"
1.343 +is_present "$UID1" "out6O.tmp" && success || failed "out6O.tmp"
1.344
1.345 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "recurrence" "event26@example.com" "20141011T100000" \
1.346 -> out6R.tmp
1.347 -
1.348 - grep -q 'event26@example.com' "out6O.tmp" \
1.349 -&& grep -q 'event26@example.com' "out6R.tmp" \
1.350 -&& echo "Success" \
1.351 -|| echo "Failed"
1.352 +list_script "out6R.tmp" "$SENDER" "recurrence" "$UID1" '20141011T080000Z'
1.353 +is_present "$UID1" "out6R.tmp" && success || failed "out6R.tmp"
1.354
1.355 # This should cause the organiser to tell the second user about the recurrence.
1.356
1.357 - grep -q 'METHOD:REQUEST' out6.tmp \
1.358 -&& echo "Success" \
1.359 -|| echo "Failed"
1.360 +is_present 'METHOD:REQUEST' "out6.tmp" && success || failed "out6.tmp"
1.361 +
1.362 +# Present the update to the second user.
1.363 +
1.364 +person_script "out6.tmp" "out62.tmp"
1.365
1.366 - "$PERSON_SCRIPT" $ARGS < out6r.tmp 2>> $ERROR \
1.367 -| "$SHOWMAIL" \
1.368 -> out62.tmp
1.369 +# There should be a recurrence created by the first user at the second user.
1.370
1.371 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \
1.372 -> out6O2.tmp
1.373 +list_script "out6O2.tmp" "$USER2" "object" "$UID1"
1.374 +is_present "$UID1" "out6O2.tmp" && success || failed "out6O2.tmp"
1.375
1.376 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "recurrence" "event26@example.com" "20141011T100000" \
1.377 -> out6R2.tmp
1.378 +list_script "out6R2.tmp" "$USER2" "recurrence" "$UID1" '20141011T080000Z'
1.379 +is_present "$UID1" "out6R2.tmp" && success || failed "out6R2.tmp"
1.380
1.381 # The second user's schedule should remain unchanged.
1.382 # NOTE: The nature of the periods might need to change, with the recurrence
1.383 # NOTE: taking over the affected period.
1.384
1.385 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.386 -> out6f2.tmp
1.387 +list_script "out6f2.tmp" "$USER2" "freebusy"
1.388 +have_occurrences "$UID1" 2 "out6f2.tmp" && success || failed "out6f2.tmp"
1.389 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out6f2.tmp"
1.390 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6f2.tmp"
1.391
1.392 - [ `grep "event26@example.com" "out6f2.tmp" | wc -l` = '2' ] \
1.393 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f2.tmp" \
1.394 -&& echo "Success" \
1.395 -|| echo "Failed"
1.396 +# Accept the invitation for the recurrence at the first user.
1.397
1.398 -# Test recurrence acceptance in the outgoing handler.
1.399 + sed 's/event_accept1.tmp/event_accept1r.tmp/' "event_accept1_cmd.tmp" \
1.400 +> "event_accept1r_cmd.tmp"
1.401
1.402 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.403 -| tee out7.tmp \
1.404 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.405 +text_client_specific "$USER1" "event_accept1r_cmd.tmp" "$UID1" '20141011T080000Z'
1.406 +
1.407 +# Register acceptance in the outgoing handler.
1.408 +
1.409 +outgoing_script "event_accept1r.tmp"
1.410
1.411 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.412 -> out7s.tmp
1.413 +# Expect both periods in the user's free/busy collection.
1.414
1.415 - [ `grep "event26@example.com" "out7s.tmp" | wc -l` = '2' ] \
1.416 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out7s.tmp" \
1.417 -&& echo "Success" \
1.418 -|| echo "Failed"
1.419 +list_script "out7f.tmp" "$USER1" "freebusy"
1.420 +have_occurrences "$UID1" 2 "out7f.tmp" && success || failed "out7f.tmp"
1.421 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out7f.tmp"
1.422 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out7f.tmp"
1.423
1.424 # There should still be a recurrence created by the user.
1.425
1.426 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.427 -> out7O.tmp
1.428 +list_script "out7O.tmp" "$USER1" "object" "$UID1"
1.429 +is_present "$UID1" "out7O.tmp" && success || failed "out7O.tmp"
1.430
1.431 - "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \
1.432 -> out7R.tmp
1.433 +list_script "out7R.tmp" "$USER1" "recurrence" "$UID1" '20141011T080000Z'
1.434 +is_present "$UID1" "out7R.tmp" && success || failed "out7R.tmp"
1.435
1.436 - grep -q 'event26@example.com' "out7O.tmp" \
1.437 -&& grep -q 'event26@example.com' "out7R.tmp" \
1.438 -&& echo "Success" \
1.439 -|| echo "Failed"
1.440 +# Register the acceptance at the sender.
1.441
1.442 -# Test acceptance in the incoming handler.
1.443 +person_script "event_accept1r.tmp" "out8.tmp"
1.444 +
1.445 +# Expect both periods in the sender's free/busy collection.
1.446
1.447 - "$PERSON_SCRIPT" $ARGS < out7.tmp 2>> $ERROR \
1.448 -| "$SHOWMAIL" \
1.449 -> out8.tmp
1.450 -
1.451 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.452 -> out8f.tmp
1.453 +list_script "out8f.tmp" "$SENDER" "freebusy"
1.454 +have_occurrences "$UID1" 2 "out8f.tmp" && success || failed "out8f.tmp"
1.455 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8f.tmp"
1.456 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8f.tmp"
1.457
1.458 - [ `grep "event26@example.com" "out8f.tmp" | wc -l` = '2' ] \
1.459 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8f.tmp" \
1.460 -&& echo "Success" \
1.461 -|| echo "Failed"
1.462 +# Expect both periods for the first user at the sender.
1.463
1.464 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.465 -> out8o.tmp
1.466 -
1.467 - [ `grep "event26@example.com" "out8o.tmp" | wc -l` = '2' ] \
1.468 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8o.tmp" \
1.469 -&& echo "Success" \
1.470 -|| echo "Failed"
1.471 +list_script "out8o1.tmp" "$SENDER" "freebusy_other" "$USER1"
1.472 +have_occurrences "$UID1" 2 "out8o1.tmp" && success || failed "out8o1.tmp"
1.473 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8o1.tmp"
1.474 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8o1.tmp"
1.475
1.476 # The second user should not have been affected.
1.477
1.478 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.479 -> out8o2.tmp
1.480 -
1.481 - [ `grep "event26@example.com" "out8o2.tmp" | wc -l` = '2' ] \
1.482 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8o2.tmp" \
1.483 -&& echo "Success" \
1.484 -|| echo "Failed"
1.485 +list_script "out8o2.tmp" "$SENDER" "freebusy_other" "$USER2"
1.486 +have_occurrences "$UID1" 2 "out8o2.tmp" && success || failed "out8o2.tmp"
1.487 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out8o2.tmp"
1.488 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out8o2.tmp"
1.489
1.490 # There should be a recurrence created by the user.
1.491
1.492 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \
1.493 -> out8O.tmp
1.494 +list_script "out8O.tmp" "$SENDER" "object" "$UID1"
1.495 +is_present "$UID1" "out8O.tmp" && success || failed "out8O.tmp"
1.496
1.497 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "recurrence" "event26@example.com" "20141011T100000" \
1.498 -> out8R.tmp
1.499 -
1.500 - grep -q 'event26@example.com' "out8O.tmp" \
1.501 -&& grep -q 'event26@example.com' "out8R.tmp" \
1.502 -&& echo "Success" \
1.503 -|| echo "Failed"
1.504 +list_script "out8R.tmp" "$SENDER" "recurrence" "$UID1" '20141011T080000Z'
1.505 +is_present "$UID1" "out8R.tmp" && success || failed "out8R.tmp"
1.506
1.507 # Test recurrence declining in the outgoing handler.
1.508 # Now the second user declines the parent event.
1.509
1.510 - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER2" "event26@example.com" 2>> $ERROR \
1.511 -| tee out9.tmp \
1.512 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.513 + sed 's/event_decline1.tmp/event_decline2.tmp/' "event_decline1_cmd.tmp" \
1.514 +> "event_decline2_cmd.tmp"
1.515 +
1.516 +text_client_specific "$USER2" "event_decline2_cmd.tmp" "$UID1"
1.517 +
1.518 +# Register acceptance in the outgoing handler.
1.519
1.520 - "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.521 -> out9s.tmp
1.522 +outgoing_script "event_decline2.tmp"
1.523 +
1.524 +# Expect only the recurrence period for the second user.
1.525
1.526 - [ `grep "event26@example.com" "out9s.tmp" | wc -l` = '0' ] \
1.527 -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out9s.tmp" \
1.528 -&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out9s.tmp" \
1.529 -&& echo "Success" \
1.530 -|| echo "Failed"
1.531 +list_script "out9s.tmp" "$USER2" "freebusy"
1.532 +have_occurrences "$UID1" 1 "out9s.tmp" && success || failed "out9s.tmp"
1.533 +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out9s.tmp"
1.534 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out9s.tmp"
1.535
1.536 # Test declining in the incoming handler.
1.537
1.538 - "$PERSON_SCRIPT" $ARGS < out9.tmp 2>> $ERROR \
1.539 -| "$SHOWMAIL" \
1.540 -> out10.tmp
1.541 +person_script "event_decline2.tmp" "out10.tmp"
1.542
1.543 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.544 -> out10f.tmp
1.545 +# Expect periods for the organiser as before.
1.546
1.547 - [ `grep "event26@example.com" "out10f.tmp" | wc -l` = '2' ] \
1.548 -&& grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10f.tmp" \
1.549 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10f.tmp" \
1.550 -&& echo "Success" \
1.551 -|| echo "Failed"
1.552 +list_script "out10f.tmp" "$SENDER" "freebusy"
1.553 +have_occurrences "$UID1" 2 "out10f.tmp" && success || failed "out10f.tmp"
1.554 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out10f.tmp"
1.555 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out10f.tmp"
1.556
1.557 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.558 -> out10o.tmp
1.559 +# Expect only the recurrence period for the second user at the organiser.
1.560
1.561 - [ `grep "event26@example.com" "out10o.tmp" | wc -l` = '1' ] \
1.562 -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10o.tmp" \
1.563 -&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10o.tmp" \
1.564 -&& echo "Success" \
1.565 -|| echo "Failed"
1.566 +list_script "out10o2.tmp" "$SENDER" "freebusy_other" "$USER2"
1.567 +have_occurrences "$UID1" 1 "out10o2.tmp" && success || failed "out10o2.tmp"
1.568 +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out10o2.tmp"
1.569 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out10o2.tmp"