1.1 --- a/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:22:33 2016 +0200
1.2 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:57:44 2016 +0200
1.3 @@ -2,15 +2,20 @@
1.4
1.5 . "`dirname \"$0\"`/common.sh"
1.6
1.7 -USER="mailto:vincent.vole@example.com"
1.8 +USER1="mailto:vincent.vole@example.com"
1.9 +USER2="mailto:harvey.horse@example.com"
1.10 SENDER="mailto:paul.boddie@example.com"
1.11
1.12 -mkdir -p "$PREFS/$USER"
1.13 -echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
1.14 -echo 'share' > "$PREFS/$USER/freebusy_sharing"
1.15 +mkdir -p "$PREFS/$USER1"
1.16 +echo 'Europe/Oslo' > "$PREFS/$USER1/TZID"
1.17 +echo 'share' > "$PREFS/$USER1/freebusy_sharing"
1.18 +
1.19 +mkdir -p "$PREFS/$USER2"
1.20 +echo 'Europe/Oslo' > "$PREFS/$USER2/TZID"
1.21 +echo 'share' > "$PREFS/$USER2/freebusy_sharing"
1.22
1.23 mkdir -p "$PREFS/$SENDER"
1.24 -echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
1.25 +echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID"
1.26
1.27 # Test free/busy responses.
1.28
1.29 @@ -52,7 +57,7 @@
1.30 && echo "Success" \
1.31 || echo "Failed"
1.32
1.33 -# Test registration in the incoming handler for the recipient.
1.34 +# Test registration in the incoming handler for the recipients.
1.35
1.36 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \
1.37 | "$SHOWMAIL" \
1.38 @@ -62,49 +67,81 @@
1.39 && echo "Success" \
1.40 || echo "Failed"
1.41
1.42 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.43 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.44 > out2f.tmp
1.45
1.46 ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \
1.47 && echo "Success" \
1.48 || echo "Failed"
1.49
1.50 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.51 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \
1.52 > out2o.tmp
1.53
1.54 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \
1.55 && echo "Success" \
1.56 || echo "Failed"
1.57
1.58 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.59 +> out2f2.tmp
1.60 +
1.61 + ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f2.tmp" \
1.62 +&& echo "Success" \
1.63 +|| echo "Failed"
1.64 +
1.65 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \
1.66 +> out2o2.tmp
1.67 +
1.68 + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o2.tmp" \
1.69 +&& echo "Success" \
1.70 +|| echo "Failed"
1.71 +
1.72 # There should be an event created by the sender.
1.73
1.74 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \
1.75 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.76 > out2O.tmp
1.77
1.78 grep -q 'event26@example.com' "out2O.tmp" \
1.79 && echo "Success" \
1.80 || echo "Failed"
1.81
1.82 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \
1.83 +> out2O2.tmp
1.84 +
1.85 + grep -q 'event26@example.com' "out2O2.tmp" \
1.86 +&& echo "Success" \
1.87 +|| echo "Failed"
1.88 +
1.89 # Test acceptance and registration in the outgoing handler.
1.90
1.91 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event26@example.com" 2>> $ERROR \
1.92 + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "event26@example.com" 2>> $ERROR \
1.93 | tee out3.tmp \
1.94 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.95
1.96 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.97 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.98 > out3f.tmp
1.99
1.100 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \
1.101 && echo "Success" \
1.102 || echo "Failed"
1.103
1.104 + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER2" "event26@example.com" 2>> $ERROR \
1.105 +| tee out32.tmp \
1.106 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.107 +
1.108 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.109 +> out3f2.tmp
1.110 +
1.111 + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f2.tmp" \
1.112 +&& echo "Success" \
1.113 +|| echo "Failed"
1.114 +
1.115 # Test registration in the incoming handler.
1.116
1.117 "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \
1.118 | "$SHOWMAIL" \
1.119 > out4.tmp
1.120
1.121 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.122 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.123 > out4f.tmp
1.124
1.125 [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \
1.126 @@ -112,7 +149,7 @@
1.127 && echo "Success" \
1.128 || echo "Failed"
1.129
1.130 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.131 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy_other" "$SENDER" \
1.132 > out4o.tmp
1.133
1.134 [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \
1.135 @@ -120,13 +157,34 @@
1.136 && echo "Success" \
1.137 || echo "Failed"
1.138
1.139 -# Test recurrence declining in the outgoing handler.
1.140 + "$PERSON_SCRIPT" $ARGS < out32.tmp 2>> $ERROR \
1.141 +| "$SHOWMAIL" \
1.142 +> out42.tmp
1.143 +
1.144 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
1.145 +> out4f2.tmp
1.146 +
1.147 + [ `grep "event26@example.com" "out4f2.tmp" | wc -l` = '2' ] \
1.148 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f2.tmp" \
1.149 +&& echo "Success" \
1.150 +|| echo "Failed"
1.151
1.152 - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.153 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy_other" "$SENDER" \
1.154 +> out4o2.tmp
1.155 +
1.156 + [ `grep "event26@example.com" "out4o2.tmp" | wc -l` = '2' ] \
1.157 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o2.tmp" \
1.158 +&& echo "Success" \
1.159 +|| echo "Failed"
1.160 +
1.161 +# Test recurrence declining in the outgoing handler.
1.162 +# Only the first user declines.
1.163 +
1.164 + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.165 | tee out5.tmp \
1.166 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.167
1.168 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.169 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.170 > out5s.tmp
1.171
1.172 [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \
1.173 @@ -136,10 +194,10 @@
1.174
1.175 # There should be a recurrence created by the user.
1.176
1.177 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \
1.178 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.179 > out5O.tmp
1.180
1.181 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "recurrence" "event26@example.com" "20141011T100000" \
1.182 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \
1.183 > out5R.tmp
1.184
1.185 grep -q 'event26@example.com' "out5O.tmp" \
1.186 @@ -161,7 +219,7 @@
1.187 && echo "Success" \
1.188 || echo "Failed"
1.189
1.190 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \
1.191 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.192 > out6o.tmp
1.193
1.194 [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \
1.195 @@ -169,6 +227,16 @@
1.196 && echo "Success" \
1.197 || echo "Failed"
1.198
1.199 +# The second user is still attending the original event.
1.200 +
1.201 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.202 +> out6o2.tmp
1.203 +
1.204 + [ `grep "event26@example.com" "out6o2.tmp" | wc -l` = '2' ] \
1.205 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o2.tmp" \
1.206 +&& echo "Success" \
1.207 +|| echo "Failed"
1.208 +
1.209 # There should be a recurrence created by the user.
1.210
1.211 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \
1.212 @@ -184,11 +252,11 @@
1.213
1.214 # Test recurrence acceptance in the outgoing handler.
1.215
1.216 - "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.217 + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
1.218 | tee out7.tmp \
1.219 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.220
1.221 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.222 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "freebusy" \
1.223 > out7s.tmp
1.224
1.225 [ `grep "event26@example.com" "out7s.tmp" | wc -l` = '2' ] \
1.226 @@ -198,10 +266,10 @@
1.227
1.228 # There should still be a recurrence created by the user.
1.229
1.230 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event26@example.com" \
1.231 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "object" "event26@example.com" \
1.232 > out7O.tmp
1.233
1.234 - "$LIST_SCRIPT" $LIST_ARGS "$USER" "recurrence" "event26@example.com" "20141011T100000" \
1.235 + "$LIST_SCRIPT" $LIST_ARGS "$USER1" "recurrence" "event26@example.com" "20141011T100000" \
1.236 > out7R.tmp
1.237
1.238 grep -q 'event26@example.com' "out7O.tmp" \
1.239 @@ -223,7 +291,7 @@
1.240 && echo "Success" \
1.241 || echo "Failed"
1.242
1.243 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \
1.244 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.245 > out8o.tmp
1.246
1.247 [ `grep "event26@example.com" "out8o.tmp" | wc -l` = '2' ] \
1.248 @@ -231,6 +299,16 @@
1.249 && echo "Success" \
1.250 || echo "Failed"
1.251
1.252 +# The second user should not have been affected.
1.253 +
1.254 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.255 +> out8o2.tmp
1.256 +
1.257 + [ `grep "event26@example.com" "out8o2.tmp" | wc -l` = '2' ] \
1.258 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out8o2.tmp" \
1.259 +&& echo "Success" \
1.260 +|| echo "Failed"
1.261 +
1.262 # There should be a recurrence created by the user.
1.263
1.264 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event26@example.com" \