1.1 --- a/tests/test_person_invitation_recurring.sh Sat Feb 03 23:35:55 2018 +0100
1.2 +++ b/tests/test_person_invitation_recurring.sh Sat Feb 03 23:36:17 2018 +0100
1.3 @@ -12,319 +12,354 @@
1.4 mkdir -p "$PREFS/$SENDER"
1.5 echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID"
1.6
1.7 -# Test free/busy responses.
1.8 +# Test the recipient's initial free/busy state.
1.9
1.10 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \
1.11 -| "$SHOWMAIL" \
1.12 -> out0.tmp
1.13 +test_initial_freebusy
1.14 +test_initial_freebusy_limited
1.15
1.16 - grep -q 'METHOD:REPLY' out0.tmp \
1.17 -&& ! grep -q '^FREEBUSY' out0.tmp \
1.18 -&& echo "Success" \
1.19 -|| echo "Failed"
1.20 +# Make a new event.
1.21
1.22 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \
1.23 -| "$SHOWMAIL" \
1.24 -> out1.tmp
1.25 +cat > "event_cmd.tmp" <<EOF
1.26 +new
1.27 +period 0 edit 20141010 10 00 00 Europe/Oslo 20141010 11 00 00 Europe/Oslo
1.28 +rrule
1.29 +freq monthly 1
1.30 +selection weekday FR 2 end
1.31 +count 3
1.32 +end
1.33 +attendance accept
1.34 +attendee mailto:vincent.vole@example.com
1.35 +summary Recurring event
1.36 +finish
1.37 +update event.tmp
1.38 +publish event_self.tmp
1.39 +UID event_uid.tmp
1.40 +EOF
1.41
1.42 - grep -q 'METHOD:REPLY' out1.tmp \
1.43 -&& ! grep -q '^FREEBUSY' out1.tmp \
1.44 -&& echo "Success" \
1.45 -|| echo "Failed"
1.46 -
1.47 -# Publish an event, testing registration in the outgoing handler.
1.48 +text_client "$SENDER" "event_cmd.tmp"
1.49
1.50 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR
1.51 +# Obtain the event UID.
1.52
1.53 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.54 -> out1f.tmp
1.55 +read UID1 < "event_uid.tmp"
1.56 +
1.57 +# Register the event at the sender.
1.58
1.59 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out1f.tmp" \
1.60 -&& echo "Success" \
1.61 -|| echo "Failed"
1.62 +outgoing_script "event_self.tmp"
1.63
1.64 -# Test registration in the incoming handler for the recipient.
1.65 +# Expect free/busy periods for the sender.
1.66 +
1.67 +list_script "out1f.tmp" "$SENDER" "freebusy"
1.68 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out1f.tmp"
1.69
1.70 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \
1.71 -| "$SHOWMAIL" \
1.72 -> out2.tmp
1.73 +# Present the request to the recipient.
1.74 +
1.75 +person_script "event.tmp" "out2.tmp"
1.76 +
1.77 +# Expect no reply because the recipient must handle the request.
1.78
1.79 - ! grep -q 'METHOD:REPLY' out2.tmp \
1.80 -&& echo "Success" \
1.81 -|| echo "Failed"
1.82 +is_absent 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp"
1.83
1.84 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.85 -> out2f.tmp
1.86 +# Expect no free/busy periods for the recipient.
1.87 +
1.88 +list_script "out2f.tmp" "$USER" "freebusy"
1.89 +test_freebusy_missing '20141212T090000Z' '20141212T100000Z' "out2f.tmp"
1.90
1.91 - ! grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out2f.tmp" \
1.92 -&& echo "Success" \
1.93 -|| echo "Failed"
1.94 +# Expect free/busy periods for the sender at the recipient.
1.95 +
1.96 +list_script "out2fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.97 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out2fo.tmp"
1.98
1.99 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.100 -> out2o.tmp
1.101 +# Accept the invitation.
1.102
1.103 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out2o.tmp" \
1.104 -&& echo "Success" \
1.105 -|| echo "Failed"
1.106 +cat > "event_accept_cmd.tmp" <<EOF
1.107 +attendance accept
1.108 +finish
1.109 +update event_accept.tmp
1.110 +EOF
1.111
1.112 -# Test acceptance and registration in the outgoing handler.
1.113 +text_client_specific "$USER" "event_accept_cmd.tmp" "$UID1"
1.114
1.115 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \
1.116 -| tee out3.tmp \
1.117 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.118 +# Register the acceptance at the recipient.
1.119 +
1.120 +outgoing_script "event_accept.tmp"
1.121
1.122 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.123 -> out3f.tmp
1.124 +# Expect free/busy periods at the recipient.
1.125
1.126 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out3f.tmp" \
1.127 -&& echo "Success" \
1.128 -|| echo "Failed"
1.129 +list_script "out2f2.tmp" "$USER" "freebusy"
1.130 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out2f2.tmp"
1.131 +
1.132 +# Cancel a recurrence of the event.
1.133
1.134 -# Test recurrence cancellation in the outgoing handler.
1.135 -
1.136 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR
1.137 +cat > "event_cancel_cmd.tmp" <<EOF
1.138 +period 1 cancel
1.139 +finish
1.140 +update event_cancel.tmp
1.141 +EOF
1.142
1.143 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.144 -> out3s.tmp
1.145 +text_client_specific "$SENDER" "event_cancel_cmd.tmp" "$UID1"
1.146 +
1.147 +# Register the cancellation at the sender.
1.148
1.149 - [ `grep "event8@example.com" "out3s.tmp" | wc -l` = '2' ] \
1.150 -&& ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "out3s.tmp" \
1.151 -&& echo "Success" \
1.152 -|| echo "Failed"
1.153 +outgoing_script "event_cancel.tmp"
1.154 +
1.155 +# Expect only two periods at the sender.
1.156
1.157 -# Test cancellation in the incoming handler.
1.158 +list_script "out3s.tmp" "$SENDER" "freebusy"
1.159 +test_freebusy_missing '20141114T090000Z' '20141114T100000Z' "out3s.tmp"
1.160 +have_occurrences "$UID1" 2 "out3s.tmp" && success || failed "out3s.tmp"
1.161
1.162 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR \
1.163 -| "$SHOWMAIL" \
1.164 -> out4.tmp
1.165 +# Register the cancellation at the recipient.
1.166
1.167 - ! grep -q 'METHOD:REPLY' out4.tmp \
1.168 -&& echo "Success" \
1.169 -|| echo "Failed"
1.170 +person_script "event_cancel.tmp" "out4.tmp"
1.171 +
1.172 +# Expect no reply from the recipient.
1.173
1.174 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.175 -> out4f.tmp
1.176 +is_absent 'METHOD:REPLY' "out4.tmp" && success || failed "out4.tmp"
1.177 +
1.178 +# Expect only two periods at the recipient.
1.179
1.180 - [ `grep "event8@example.com" "out4f.tmp" | wc -l` = '2' ] \
1.181 -&& ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "out4f.tmp" \
1.182 -&& echo "Success" \
1.183 -|| echo "Failed"
1.184 +list_script "out4f.tmp" "$USER" "freebusy"
1.185 +test_freebusy_missing '20141114T090000Z' '20141114T100000Z' "out4f.tmp"
1.186 +have_occurrences "$UID1" 2 "out4f.tmp" && success || failed "out4f.tmp"
1.187 +
1.188 +# Expect only two periods for the sender at the recipient.
1.189
1.190 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.191 -> out4o.tmp
1.192 +list_script "out4fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.193 +test_freebusy_missing '20141114T090000Z' '20141114T100000Z' "out4fo.tmp"
1.194 +have_occurrences "$UID1" 2 "out4fo.tmp" && success || failed "out4fo.tmp"
1.195 +
1.196 +# Reschedule the first period
1.197
1.198 - [ `grep "event8@example.com" "out4o.tmp" | wc -l` = '2' ] \
1.199 -&& ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "out4o.tmp" \
1.200 -&& echo "Success" \
1.201 -|| echo "Failed"
1.202 +cat > "event_reschedule_cmd.tmp" <<EOF
1.203 +period 0 edit 20141011 10 00 00 Europe/Oslo 20141011 11 00 00 Europe/Oslo
1.204 +finish
1.205 +update event_reschedule.tmp
1.206 +EOF
1.207
1.208 -# Test rescheduling in the outgoing handler.
1.209 +text_client_specific "$SENDER" "event_reschedule_cmd.tmp" "$UID1"
1.210 +
1.211 +# Register the rescheduling at the sender.
1.212
1.213 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR
1.214 +outgoing_script "event_reschedule.tmp"
1.215
1.216 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.217 -> out4s.tmp
1.218 +# Expect a change in the first period at the sender.
1.219
1.220 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4s.tmp" \
1.221 -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out4s.tmp" \
1.222 -&& echo "Success" \
1.223 -|| echo "Failed"
1.224 +list_script "out4s.tmp" "$SENDER" "freebusy"
1.225 +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out4s.tmp"
1.226 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out4s.tmp"
1.227 +
1.228 +# Register the rescheduling at the recipient.
1.229
1.230 -# Test rescheduling in the incoming handler.
1.231 +person_script "event_reschedule.tmp" "out5.tmp"
1.232
1.233 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR \
1.234 -| "$SHOWMAIL" \
1.235 -> out5.tmp
1.236 +# Expect no reply from the recipient.
1.237 +
1.238 +is_absent 'METHOD:REPLY' "out5.tmp" && success || failed "out5.tmp"
1.239
1.240 - ! grep -q 'METHOD:REPLY' out5.tmp \
1.241 -&& echo "Success" \
1.242 -|| echo "Failed"
1.243 +# Expect no change in the first period at the recipient.
1.244
1.245 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.246 -> out5f.tmp
1.247 +list_script "out5f.tmp" "$USER" "freebusy"
1.248 +test_freebusy '20141010T080000Z' '20141010T090000Z' "out5f.tmp"
1.249 +test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out5f.tmp"
1.250
1.251 - ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5f.tmp" \
1.252 -&& grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out5f.tmp" \
1.253 -&& echo "Success" \
1.254 -|| echo "Failed"
1.255 +# Expect a change in the first period for the sender at the recipient.
1.256
1.257 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.258 -> out5o.tmp
1.259 +list_script "out5fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.260 +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out5fo.tmp"
1.261 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out5fo.tmp"
1.262 +
1.263 +# Accept the rescheduling.
1.264
1.265 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5o.tmp" \
1.266 -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out5o.tmp" \
1.267 -&& echo "Success" \
1.268 -|| echo "Failed"
1.269 +cat > "event_accept2_cmd.tmp" <<EOF
1.270 +attendance accept
1.271 +finish
1.272 +update event_accept2.tmp
1.273 +EOF
1.274
1.275 -# Test rescheduling acceptance in the outgoing handler.
1.276 +text_client_specific "$USER" "event_accept2_cmd.tmp" "$UID1" '20141010T080000Z'
1.277
1.278 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20141010T080000Z" 2>> $ERROR \
1.279 -| tee out6.tmp \
1.280 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.281 +# Register the acceptance at the recipient.
1.282 +
1.283 +outgoing_script "event_accept2.tmp"
1.284
1.285 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.286 -> out6f.tmp
1.287 +# Expect a change in the first period at the recipient.
1.288 +
1.289 +list_script "out6f.tmp" "$USER" "freebusy"
1.290 +test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out6f.tmp"
1.291 +test_freebusy '20141011T080000Z' '20141011T090000Z' "out6f.tmp"
1.292
1.293 - grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f.tmp" \
1.294 -&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out6f.tmp" \
1.295 -&& echo "Success" \
1.296 -|| echo "Failed"
1.297 +# Prepare a complete cancellation.
1.298
1.299 -# Test complete cancellation in the outgoing handler.
1.300 -
1.301 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR
1.302 -
1.303 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.304 -> out6s.tmp
1.305 +cat > "event_cancel_all_cmd.tmp" <<EOF
1.306 +cancel
1.307 +finish
1.308 +cancel event_cancel_all.tmp
1.309 +EOF
1.310
1.311 - ! grep -q "event8@example.com" "out6s.tmp" \
1.312 -&& echo "Success" \
1.313 -|| echo "Failed"
1.314 +text_client_specific "$SENDER" "event_cancel_all_cmd.tmp" "$UID1"
1.315
1.316 -# Test complete cancellation in the incoming handler.
1.317 +# Register the cancellation at the sender.
1.318 +
1.319 +outgoing_script "event_cancel_all.tmp"
1.320
1.321 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \
1.322 -| "$SHOWMAIL" \
1.323 -> out7.tmp
1.324 +# Expect no periods at the sender.
1.325
1.326 - ! grep -q 'METHOD:REPLY' out7.tmp \
1.327 -&& echo "Success" \
1.328 -|| echo "Failed"
1.329 +list_script "out7s.tmp" "$SENDER" "freebusy"
1.330 +have_occurrences "$UID1" 0 "out7s.tmp" && success || failed "out7s.tmp"
1.331 +
1.332 +# Register the cancellation at the recipient.
1.333
1.334 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.335 -> out7f.tmp
1.336 +person_script "event_cancel_all.tmp" "out7.tmp"
1.337 +
1.338 +# Expect no reply from the recipient.
1.339
1.340 - ! grep -q "event8@example.com" "out7f.tmp" \
1.341 -&& echo "Success" \
1.342 -|| echo "Failed"
1.343 +is_absent 'METHOD:REPLY' "out7.tmp" && success || failed "out7.tmp"
1.344 +
1.345 +# Expect no periods at the recipient.
1.346
1.347 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.348 -> out7o.tmp
1.349 +list_script "out7f.tmp" "$USER" "freebusy"
1.350 +have_occurrences "$UID1" 0 "out7f.tmp" && success || failed "out7f.tmp"
1.351
1.352 - ! grep -q "event8@example.com" "out7o.tmp" \
1.353 -&& echo "Success" \
1.354 -|| echo "Failed"
1.355 +# Expect no periods for the sender at the recipient.
1.356 +
1.357 +list_script "out7fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.358 +have_occurrences "$UID1" 0 "out7fo.tmp" && success || failed "out7fo.tmp"
1.359
1.360 # Switch time zones.
1.361
1.362 echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID"
1.363
1.364 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR
1.365 +# Register the event at the sender.
1.366
1.367 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.368 -> out7s.tmp
1.369 +outgoing_script "event_self.tmp"
1.370 +
1.371 +# Expect free/busy periods for the sender.
1.372
1.373 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out7s.tmp" \
1.374 -&& echo "Success" \
1.375 -|| echo "Failed"
1.376 +list_script "out8f.tmp" "$SENDER" "freebusy"
1.377 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out8f.tmp"
1.378
1.379 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \
1.380 -| "$SHOWMAIL" \
1.381 -> out8.tmp
1.382 +# Present the request to the recipient.
1.383
1.384 - ! grep -q 'METHOD:REPLY' out8.tmp \
1.385 -&& echo "Success" \
1.386 -|| echo "Failed"
1.387 +person_script "event.tmp" "out9.tmp"
1.388 +
1.389 +# Expect no reply because the recipient must handle the request.
1.390
1.391 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.392 -> out8f.tmp
1.393 +is_absent 'METHOD:REPLY' "out9.tmp" && success || failed "out9.tmp"
1.394
1.395 - ! grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out8f.tmp" \
1.396 -&& echo "Success" \
1.397 -|| echo "Failed"
1.398 +# Expect no free/busy periods for the recipient.
1.399 +
1.400 +list_script "out9f.tmp" "$USER" "freebusy"
1.401 +test_freebusy_missing '20141212T090000Z' '20141212T100000Z' "out9f.tmp"
1.402
1.403 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.404 -> out8o.tmp
1.405 +# Expect free/busy periods for the sender at the recipient.
1.406
1.407 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out8o.tmp" \
1.408 -&& echo "Success" \
1.409 -|| echo "Failed"
1.410 +list_script "out9fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.411 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out9fo.tmp"
1.412
1.413 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \
1.414 -| tee out9.tmp \
1.415 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.416 +text_client_specific "$USER" "event_accept_cmd.tmp" "$UID1"
1.417 +
1.418 +# Register the acceptance at the recipient.
1.419
1.420 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.421 -> out9f.tmp
1.422 +outgoing_script "event_accept.tmp"
1.423
1.424 - grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out9f.tmp" \
1.425 -&& echo "Success" \
1.426 -|| echo "Failed"
1.427 +# Expect free/busy periods at the recipient.
1.428 +
1.429 +list_script "out9f2.tmp" "$USER" "freebusy"
1.430 +test_freebusy '20141212T090000Z' '20141212T100000Z' "out9f2.tmp"
1.431
1.432 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR
1.433 +# Cancel the event.
1.434 +
1.435 +outgoing_script "event_cancel_all.tmp"
1.436
1.437 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.438 -> out9s.tmp
1.439 +# Expect no periods at the sender.
1.440
1.441 - ! grep -q "event8@example.com" "out9s.tmp" \
1.442 -&& echo "Success" \
1.443 -|| echo "Failed"
1.444 +list_script "out10s.tmp" "$SENDER" "freebusy"
1.445 +have_occurrences "$UID1" 0 "out10s.tmp" && success || failed "out10s.tmp"
1.446
1.447 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \
1.448 -| "$SHOWMAIL" \
1.449 -> out10.tmp
1.450 +# Register the cancellation at the recipient.
1.451 +
1.452 +person_script "event_cancel_all.tmp" "out10.tmp"
1.453
1.454 - ! grep -q 'METHOD:REPLY' out10.tmp \
1.455 -&& echo "Success" \
1.456 -|| echo "Failed"
1.457 +# Expect no reply from the recipient.
1.458
1.459 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.460 -> out10f.tmp
1.461 +is_absent 'METHOD:REPLY' "out10.tmp" && success || failed "out10.tmp"
1.462
1.463 - ! grep -q "event8@example.com" "out10f.tmp" \
1.464 -&& echo "Success" \
1.465 -|| echo "Failed"
1.466 +# Expect no periods at the recipient.
1.467 +
1.468 +list_script "out10f.tmp" "$USER" "freebusy"
1.469 +have_occurrences "$UID1" 0 "out10f.tmp" && success || failed "out10f.tmp"
1.470
1.471 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.472 -> out10o.tmp
1.473 +# Expect no periods for the sender at the recipient.
1.474
1.475 - ! grep -q "event8@example.com" "out10o.tmp" \
1.476 -&& echo "Success" \
1.477 -|| echo "Failed"
1.478 +list_script "out10fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.479 +have_occurrences "$UID1" 0 "out10fo.tmp" && success || failed "out10fo.tmp"
1.480
1.481 # Test floating dates. Here, the outgoing interpretation is different because
1.482 # the sender is in a different time zone.
1.483
1.484 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR
1.485 -
1.486 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.487 -> out10s.tmp
1.488 -
1.489 - grep -q "^20141211T230000Z${TAB}20141212T230000Z" "out10s.tmp" \
1.490 -&& echo "Success" \
1.491 -|| echo "Failed"
1.492 +cat > "event_floating_cmd.tmp" <<EOF
1.493 +new
1.494 +period 0 edit 20141010 - 20141010 -
1.495 +rrule
1.496 +freq monthly 1
1.497 +selection weekday FR 2 end
1.498 +count 3
1.499 +end
1.500 +attendee mailto:vincent.vole@example.com
1.501 +summary Recurring event
1.502 +list
1.503 +finish
1.504 +update event_floating.tmp
1.505 +publish event_floating_self.tmp
1.506 +UID event_floating_uid.tmp
1.507 +EOF
1.508
1.509 - "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR \
1.510 -| "$SHOWMAIL" \
1.511 -> out11.tmp
1.512 +text_client "$SENDER" "event_floating_cmd.tmp"
1.513 +
1.514 +# Obtain the event UID.
1.515 +
1.516 +read UID2 < "event_floating_uid.tmp"
1.517
1.518 - ! grep -q 'METHOD:REPLY' out11.tmp \
1.519 -&& echo "Success" \
1.520 -|| echo "Failed"
1.521 +# Register the event at the sender.
1.522 +
1.523 +outgoing_script "event_floating_self.tmp"
1.524
1.525 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.526 -> out11f.tmp
1.527 +# Expect free/busy periods for the sender.
1.528 +
1.529 +list_script "out11s.tmp" "$SENDER" "freebusy"
1.530 +test_freebusy '20141211T230000Z' '20141212T230000Z' "out11s.tmp"
1.531
1.532 - ! grep -q "^20141211T220000Z${TAB}20141212T220000Z" "out11f.tmp" \
1.533 -&& echo "Success" \
1.534 -|| echo "Failed"
1.535 +# Present the request to the recipient.
1.536 +
1.537 +person_script "event_floating.tmp" "out11.tmp"
1.538 +
1.539 +# Expect no reply because the recipient must handle the request.
1.540 +
1.541 +is_absent 'METHOD:REPLY' "out11.tmp" && success || failed "out11.tmp"
1.542
1.543 -# (The organiser is not attending.)
1.544 +# Expect no free/busy periods for the recipient (in either time zone).
1.545
1.546 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.547 -> out11o.tmp
1.548 +list_script "out11f.tmp" "$USER" "freebusy"
1.549 +test_freebusy_missing '20141211T220000Z' '20141212T220000Z' "out11f.tmp"
1.550 +test_freebusy_missing '20141211T230000Z' '20141212T230000Z' "out11f.tmp"
1.551 +
1.552 +# Expect no free/busy periods for the sender at the recipient.
1.553 +# The organiser is not attending.
1.554
1.555 - ! grep -q "^20141211T220000Z${TAB}20141212T220000Z" "out11o.tmp" \
1.556 -&& echo "Success" \
1.557 -|| echo "Failed"
1.558 +list_script "out11fo.tmp" "$USER" "freebusy_other" "$SENDER"
1.559 +test_freebusy_missing '20141211T220000Z' '20141212T220000Z' "out11fo.tmp"
1.560 +test_freebusy_missing '20141211T230000Z' '20141212T230000Z' "out11fo.tmp"
1.561 +
1.562 +# Accept the invitation.
1.563 +
1.564 +text_client_specific "$USER" "event_accept_cmd.tmp" "$UID2"
1.565
1.566 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event12@example.com" 2>> $ERROR \
1.567 -| tee out12.tmp \
1.568 -| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.569 +# Register the acceptance at the recipient.
1.570 +
1.571 +outgoing_script "event_accept.tmp"
1.572
1.573 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.574 -> out12f.tmp
1.575 +# Expect free/busy periods at the recipient (in the appropriate time zone).
1.576
1.577 - grep -q "^20141211T220000Z${TAB}20141212T220000Z" "out12f.tmp" \
1.578 -&& echo "Success" \
1.579 -|| echo "Failed"
1.580 +list_script "out12f.tmp" "$USER" "freebusy"
1.581 +test_freebusy '20141211T220000Z' '20141212T220000Z' "out12f.tmp"
1.582 +test_freebusy_missing '20141211T230000Z' '20141212T230000Z' "out12f.tmp"