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