1.1 --- a/tests/test_multiple_invitation.sh Thu Mar 29 23:28:32 2018 +0200
1.2 +++ b/tests/test_multiple_invitation.sh Thu Mar 29 23:34:57 2018 +0200
1.3 @@ -2,6 +2,7 @@
1.4
1.5 . "`dirname \"$0\"`/common.sh"
1.6
1.7 +SENDER="mailto:paul.boddie@example.com"
1.8 ROOM="mailto:resource-room-confroom@example.com"
1.9 CAR="mailto:resource-car-porsche911@example.com"
1.10
1.11 @@ -13,77 +14,141 @@
1.12 echo 'Europe/Mariehamn' > "$PREFS/$CAR/TZID"
1.13 echo 'share' > "$PREFS/$CAR/freebusy_sharing"
1.14
1.15 - "$RESOURCE_SCRIPT" $ARGS < $TEMPLATES/fb-request-all.txt 2>> $ERROR \
1.16 -| "$SHOWMAIL" \
1.17 -> out0.tmp
1.18 +# Test the recipient's initial free/busy state.
1.19
1.20 - grep -q 'METHOD:REPLY' out0.tmp \
1.21 -&& ! grep -q '^FREEBUSY' out0.tmp \
1.22 -&& echo "Success" \
1.23 -|| echo "Failed"
1.24 +test_initial_freebusy 'resource'
1.25 +test_initial_freebusy_limited 'resource'
1.26 +
1.27 +# Make a new event.
1.28
1.29 - "$RESOURCE_SCRIPT" $ARGS < $TEMPLATES/fb-request.txt 2>> $ERROR \
1.30 -| "$SHOWMAIL" \
1.31 -> out1.tmp
1.32 +cat > "event_cmd.tmp" <<EOF
1.33 +new
1.34 +period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 17 00 00 Europe/Oslo
1.35 +attendance accept
1.36 +attendee mailto:resource-room-confroom@example.com
1.37 +attendee mailto:resource-car-porsche911@example.com
1.38 +summary Test drive
1.39 +finish
1.40 +update event.tmp
1.41 +publish event_self.tmp
1.42 +UID event_uid.tmp
1.43 +EOF
1.44
1.45 - grep -q 'METHOD:REPLY' out1.tmp \
1.46 -&& ! grep -q '^FREEBUSY' out1.tmp \
1.47 -&& echo "Success" \
1.48 -|| echo "Failed"
1.49 +text_client "$SENDER" "event_cmd.tmp"
1.50 +
1.51 +# Obtain the event UID.
1.52 +
1.53 +read UID1 < "event_uid.tmp"
1.54 +
1.55 +# Register the event at the sender.
1.56 +
1.57 +outgoing_script "event_self.tmp"
1.58 +
1.59 +# Present the event to the recipient.
1.60 +
1.61 +resource_script "event.tmp" "out2.tmp" "out2r.tmp"
1.62
1.63 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/event-request-multiple.txt" 2>> $ERROR \
1.64 -| "$SHOWMAIL" \
1.65 -> out2.tmp
1.66 +# Expect replies because each recipient handles the request.
1.67 +
1.68 +# Inspect the room's response.
1.69 +
1.70 +is_present 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp"
1.71 +is_present 'ATTENDEE;PARTSTAT=ACCEPTED' "out2.tmp" && success || failed "out2.tmp"
1.72
1.73 - grep -q 'METHOD:REPLY' out2.tmp \
1.74 -&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
1.75 -&& echo "Success" \
1.76 -|| echo "Failed"
1.77 +# Inspect the car's response.
1.78 +
1.79 +showmail "out2r.tmp" 1 | is_present 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp"
1.80 +showmail "out2r.tmp" 1 | is_present 'ATTENDEE;PARTSTAT=ACCEPTED' "out2.tmp" && success || failed "out2.tmp"
1.81 +
1.82 +# Expect free/busy periods for the recipients.
1.83
1.84 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/event-request-multiple.txt" 2>> $ERROR \
1.85 -| "$SHOWMAIL" \
1.86 -> out3.tmp
1.87 +list_script "out2f1.tmp" "$ROOM" "freebusy"
1.88 +test_freebusy '20141126T150000Z' '20141126T160000Z' "out2f1.tmp"
1.89 +list_script "out2f2.tmp" "$CAR" "freebusy"
1.90 +test_freebusy '20141126T150000Z' '20141126T160000Z' "out2f2.tmp"
1.91 +
1.92 +# Present a new free/busy request to the resources.
1.93 +# NOTE: We might open the event and use that for the request.
1.94
1.95 - grep -q 'METHOD:REPLY' out3.tmp \
1.96 -&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out3.tmp \
1.97 -&& echo "Success" \
1.98 -|| echo "Failed"
1.99 +cat > "fb_cmd.tmp" <<EOF
1.100 +new
1.101 +period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo
1.102 +attendee mailto:resource-room-confroom@example.com
1.103 +attendee mailto:resource-car-porsche911@example.com
1.104 +finish
1.105 +freebusy fb.tmp
1.106 +EOF
1.107 +
1.108 +text_client "$SENDER" "fb_cmd.tmp"
1.109 +
1.110 +# Present the request to the recipients.
1.111
1.112 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
1.113 -| "$SHOWMAIL" \
1.114 -> out4.tmp
1.115 +resource_script "fb.tmp" "out4.tmp" "out4r.tmp"
1.116 +
1.117 +# Expect replies because each recipient handles the request.
1.118 +
1.119 +# Inspect the room's response.
1.120
1.121 - grep -q 'METHOD:REPLY' out4.tmp \
1.122 -&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out4.tmp \
1.123 -&& echo "Success" \
1.124 -|| echo "Failed"
1.125 +is_present 'METHOD:REPLY' "out4.tmp" && success || failed "out4.tmp"
1.126 +is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out4.tmp" && success || failed "out4.tmp"
1.127 +
1.128 +# Inspect the car's response.
1.129 +
1.130 +showmail "out4r.tmp" 1 | is_present 'METHOD:REPLY' "out4.tmp" && success || failed "out4.tmp"
1.131 +showmail "out4r.tmp" 1 | is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out4.tmp" && success || failed "out4.tmp"
1.132
1.133 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/fb-request-car.txt" 2>> $ERROR \
1.134 -| "$SHOWMAIL" \
1.135 -> out5.tmp
1.136 +# Cancel the attendance of the conference room.
1.137 +
1.138 +cat > "event_cancel_cmd.tmp" <<EOF
1.139 +attendee mailto:resource-room-confroom@example.com remove
1.140 +finish
1.141 +cancel event_cancel.tmp
1.142 +EOF
1.143
1.144 - grep -q 'METHOD:REPLY' out5.tmp \
1.145 -&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out5.tmp \
1.146 -&& echo "Success" \
1.147 -|| echo "Failed"
1.148 +text_client_specific "$SENDER" "event_cancel_cmd.tmp" "$UID1"
1.149 +
1.150 +# Present the request to the recipient.
1.151 +
1.152 +resource_script "event_cancel.tmp" "out5.tmp"
1.153 +
1.154 +# Present a new free/busy request to each resource.
1.155
1.156 -"$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-multiple-attendee.txt" 2>> $ERROR
1.157 -echo "Cancel..."
1.158 +cat > "fb_room_cmd.tmp" <<EOF
1.159 +new
1.160 +period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo
1.161 +attendee mailto:resource-room-confroom@example.com
1.162 +finish
1.163 +freebusy fb_room.tmp
1.164 +EOF
1.165
1.166 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
1.167 -| "$SHOWMAIL" \
1.168 -> out6.tmp
1.169 +text_client "$SENDER" "fb_room_cmd.tmp"
1.170 +
1.171 +# Present the request to the recipients.
1.172 +
1.173 +resource_script "fb_room.tmp" "out6.tmp"
1.174 +
1.175 +# Expect a reply but with no free/busy periods.
1.176 +
1.177 +is_present 'METHOD:REPLY' "out6.tmp" && success || failed "out6.tmp"
1.178 +is_absent 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out6.tmp" && success || failed "out6.tmp"
1.179
1.180 - grep -q 'METHOD:REPLY' out6.tmp \
1.181 -&& ! grep -q '^FREEBUSY' out6.tmp \
1.182 -&& echo "Success" \
1.183 -|| echo "Failed"
1.184 +# Present a new free/busy request to each resource.
1.185 +
1.186 +cat > "fb_car_cmd.tmp" <<EOF
1.187 +new
1.188 +period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo
1.189 +attendee mailto:resource-car-porsche911@example.com
1.190 +finish
1.191 +freebusy fb_car.tmp
1.192 +EOF
1.193
1.194 - "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/fb-request-car.txt" 2>> $ERROR \
1.195 -| "$SHOWMAIL" \
1.196 -> out7.tmp
1.197 +text_client "$SENDER" "fb_car_cmd.tmp"
1.198 +
1.199 +# Present the request to the recipients.
1.200
1.201 - grep -q 'METHOD:REPLY' out7.tmp \
1.202 -&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out7.tmp \
1.203 -&& echo "Success" \
1.204 -|| echo "Failed"
1.205 +resource_script "fb_car.tmp" "out7.tmp"
1.206 +
1.207 +# Expect a reply with free/busy periods.
1.208 +
1.209 +is_present 'METHOD:REPLY' "out7.tmp" && success || failed "out7.tmp"
1.210 +is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out7.tmp" && success || failed "out7.tmp"