1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 USER="mailto:paul.boddie@example.com" 6 SENDER=$USER 7 8 mkdir -p "$PREFS/$USER" 9 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 10 echo 'share' > "$PREFS/$USER/freebusy_sharing" 11 echo '20141010' > "$PREFS/$USER/window_start" 12 13 # Make a new event. 14 15 cat > "event_cmd.tmp" <<EOF 16 new 17 period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 17 00 00 Europe/Oslo 18 attendance accept 19 attendee mailto:harvey.horse@example.com 20 attendee mailto:resource-room-confroom@example.com 21 summary Meeting at 4pm 22 finish 23 publish event_self.tmp 24 UID event_uid.tmp 25 EOF 26 27 text_client "$SENDER" "event_cmd.tmp" 28 29 # Obtain the event UID. 30 31 read UID1 < "event_uid.tmp" 32 33 # Register the event at the sender. 34 35 outgoing_script "event_self.tmp" 36 37 # Expect a free/busy period for the sender at the sender. 38 39 list_script "out1f.tmp" "$SENDER" "freebusy" 40 test_freebusy '20141126T150000Z' '20141126T160000Z' "out1f.tmp" 41 42 # Cancel the event. 43 44 cat > "event_cancel_cmd.tmp" <<EOF 45 finish 46 cancel-publish event_cancel.tmp 47 EOF 48 49 text_client_specific "$SENDER" "event_cancel_cmd.tmp" "$UID1" 50 51 # Present the cancellation at the sender. 52 53 outgoing_script "event_cancel.tmp" 54 55 # Expect no free/busy periods for the sender at the sender. 56 57 list_script "out2f.tmp" "$SENDER" "freebusy" 58 test_freebusy_missing '20141126T150000Z' '20141126T160000Z' "out2f.tmp" 59 have_occurrences "$UID1" 0 "out2f.tmp" && success || failed "out2f.tmp" 60 61 # Make a recurring event. 62 63 cat > "event_recurring_cmd.tmp" <<EOF 64 new 65 period 0 edit 20141010 10 00 00 Europe/Oslo 20141010 11 00 00 Europe/Oslo 66 rrule 67 freq monthly 1 68 selection weekday FR 2 end 69 count 3 70 end 71 attendance accept 72 attendee mailto:resource-room-confroom@example.com 73 summary Recurring event 74 finish 75 publish event_recurring_self.tmp 76 UID event_recurring_uid.tmp 77 EOF 78 79 text_client "$SENDER" "event_recurring_cmd.tmp" 80 81 # Obtain the event UID. 82 83 read UID2 < "event_recurring_uid.tmp" 84 85 # Register the event at the sender. 86 87 outgoing_script "event_recurring_self.tmp" 88 89 # Expect free/busy periods for the sender at the sender. 90 91 list_script "out3f.tmp" "$SENDER" "freebusy" 92 test_freebusy '20141010T080000Z' '20141010T090000Z' "out3f.tmp" 93 have_occurrences "$UID2" 3 "out3f.tmp" && success || failed "out3f.tmp" 94 95 # Cancel a recurrence. 96 97 cat > "event_cancel_recurring_cmd.tmp" <<EOF 98 period 1 cancel 99 finish 100 publish event_cancel_recurring.tmp 101 EOF 102 103 text_client_specific "$SENDER" "event_cancel_recurring_cmd.tmp" "$UID2" 104 105 # Present the cancellation at the sender. 106 107 outgoing_script "event_cancel_recurring.tmp" 108 109 # Expect fewer free/busy periods for the sender at the sender. 110 111 list_script "out4f.tmp" "$SENDER" "freebusy" 112 test_freebusy '20141010T080000Z' '20141010T090000Z' "out4f.tmp" 113 test_freebusy_missing '20141114T090000Z' '20141114T100000Z' "out4f.tmp" 114 have_occurrences "$UID2" 2 "out4f.tmp" && success || failed "out4f.tmp" 115 116 # Reschedule an instance. 117 118 cat > "event_reschedule_cmd.tmp" <<EOF 119 period 0 edit 20141011 10 00 00 Europe/Oslo 20141011 11 00 00 Europe/Oslo 120 finish 121 publish event_reschedule_self.tmp 122 EOF 123 124 text_client_specific "$SENDER" "event_reschedule_cmd.tmp" "$UID2" 125 126 # Present the rescheduling at the sender. 127 128 outgoing_script "event_reschedule_self.tmp" 129 130 # Expect a rescheduled free/busy period for the sender at the sender. 131 132 list_script "out5f.tmp" "$SENDER" "freebusy" 133 test_freebusy '20141011T080000Z' '20141011T090000Z' "out5f.tmp" 134 test_freebusy_missing '20141010T080000Z' '20141010T090000Z' "out5f.tmp" 135 136 # Cancel the event. 137 138 cat > "event_cancel_recurring_all_cmd.tmp" <<EOF 139 finish 140 cancel-publish event_cancel_recurring_all.tmp 141 EOF 142 143 text_client_specific "$SENDER" "event_cancel_recurring_all_cmd.tmp" "$UID2" 144 145 # Present the cancellation at the sender. 146 147 outgoing_script "event_cancel_recurring_all.tmp" 148 149 # Expect no free/busy periods for the sender at the sender. 150 151 list_script "out6f.tmp" "$SENDER" "freebusy" 152 test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out6f.tmp" 153 have_occurrences "$UID2" 0 "out6f.tmp" && success || failed "out6f.tmp" 154 155 # Make a recurring all-day event. 156 157 cat > "event_recurring_day_cmd.tmp" <<EOF 158 new 159 period 0 edit 20141010 - 20141010 - 160 rrule 161 freq monthly 1 162 selection weekday FR 2 end 163 count 3 164 end 165 attendance accept 166 attendee mailto:resource-room-confroom@example.com 167 summary Recurring event 168 finish 169 publish event_recurring_day_self.tmp 170 UID event_recurring_day_uid.tmp 171 EOF 172 173 text_client "$SENDER" "event_recurring_day_cmd.tmp" 174 175 # Obtain the event UID. 176 177 read UID3 < "event_recurring_day_uid.tmp" 178 179 # Register the event at the sender. 180 181 outgoing_script "event_recurring_day_self.tmp" 182 183 # Expect free/busy periods for the sender at the sender. 184 185 list_script "out7f.tmp" "$SENDER" "freebusy" 186 test_freebusy '20141211T230000Z' '20141212T230000Z' "out7f.tmp" 187 have_occurrences "$UID3" 3 "out7f.tmp" && success || failed "out7f.tmp" 188 189 # Cancel the event. 190 191 cat > "event_cancel_recurring_day_cmd.tmp" <<EOF 192 finish 193 cancel-publish event_cancel_recurring_day.tmp 194 EOF 195 196 text_client_specific "$SENDER" "event_cancel_recurring_day_cmd.tmp" "$UID3" 197 198 # Present the cancellation at the sender. 199 200 outgoing_script "event_cancel_recurring_day.tmp" 201 202 # Expect no free/busy periods for the sender at the sender. 203 204 list_script "out8f.tmp" "$SENDER" "freebusy" 205 test_freebusy_missing '20141211T230000Z' '20141212T230000Z' "out8f.tmp" 206 have_occurrences "$UID2" 0 "out8f.tmp" && success || failed "out8f.tmp" 207 208 # Switch time zones. 209 210 echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID" 211 212 # Register the recurring event at the sender. 213 214 outgoing_script "event_recurring_self.tmp" 215 216 # Expect free/busy periods for the sender at the sender. 217 218 list_script "out9f.tmp" "$SENDER" "freebusy" 219 test_freebusy '20141010T080000Z' '20141010T090000Z' "out9f.tmp" 220 have_occurrences "$UID2" 3 "out9f.tmp" && success || failed "out9f.tmp" 221 222 # Present the cancellation of the recurring event at the sender. 223 224 outgoing_script "event_cancel_recurring_all.tmp" 225 226 # Expect no free/busy periods for the sender at the sender. 227 228 list_script "out10f.tmp" "$SENDER" "freebusy" 229 test_freebusy_missing '20141011T080000Z' '20141011T090000Z' "out10f.tmp" 230 have_occurrences "$UID2" 0 "out10f.tmp" && success || failed "out10f.tmp" 231 232 # Register the recurring all-day event at the sender. 233 234 outgoing_script "event_recurring_day_self.tmp" 235 236 # Expect free/busy periods for the sender at the sender. 237 # With the changed time zone, the periods will be earlier than before. 238 239 list_script "out11f.tmp" "$SENDER" "freebusy" 240 test_freebusy '20141211T220000Z' '20141212T220000Z' "out11f.tmp" 241 have_occurrences "$UID3" 3 "out11f.tmp" && success || failed "out11f.tmp" 242 243 # Present the cancellation at the sender. 244 245 outgoing_script "event_cancel_recurring_day.tmp" 246 247 # Expect no free/busy periods for the sender at the sender. 248 249 list_script "out12f.tmp" "$SENDER" "freebusy" 250 test_freebusy_missing '20141211T220000Z' '20141212T220000Z' "out12f.tmp" 251 have_occurrences "$UID2" 0 "out12f.tmp" && success || failed "out12f.tmp"