1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 00:53:59 2016 +0200
1.3 @@ -0,0 +1,139 @@
1.4 +#!/bin/sh
1.5 +
1.6 +. "`dirname \"$0\"`/common.sh"
1.7 +
1.8 +USER="mailto:vincent.vole@example.com"
1.9 +SENDER="mailto:paul.boddie@example.com"
1.10 +
1.11 +mkdir -p "$PREFS/$USER"
1.12 +echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
1.13 +echo 'share' > "$PREFS/$USER/freebusy_sharing"
1.14 +
1.15 +mkdir -p "$PREFS/$SENDER"
1.16 +echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
1.17 +
1.18 +# Test free/busy responses.
1.19 +
1.20 + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \
1.21 +| "$SHOWMAIL" \
1.22 +> out0.tmp
1.23 +
1.24 + grep -q 'METHOD:REPLY' out0.tmp \
1.25 +&& ! grep -q '^FREEBUSY' out0.tmp \
1.26 +&& echo "Success" \
1.27 +|| echo "Failed"
1.28 +
1.29 + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \
1.30 +| "$SHOWMAIL" \
1.31 +> out1.tmp
1.32 +
1.33 + grep -q 'METHOD:REPLY' out1.tmp \
1.34 +&& ! grep -q '^FREEBUSY' out1.tmp \
1.35 +&& echo "Success" \
1.36 +|| echo "Failed"
1.37 +
1.38 +# Publish an event, testing registration in the outgoing handler.
1.39 +
1.40 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR
1.41 +
1.42 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.43 +> out1f.tmp
1.44 +
1.45 + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out1f.tmp" \
1.46 +&& echo "Success" \
1.47 +|| echo "Failed"
1.48 +
1.49 +# Test registration in the incoming handler for the recipient.
1.50 +
1.51 + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \
1.52 +| "$SHOWMAIL" \
1.53 +> out2.tmp
1.54 +
1.55 + ! grep -q 'METHOD:REPLY' out2.tmp \
1.56 +&& echo "Success" \
1.57 +|| echo "Failed"
1.58 +
1.59 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.60 +> out2f.tmp
1.61 +
1.62 + ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \
1.63 +&& echo "Success" \
1.64 +|| echo "Failed"
1.65 +
1.66 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.67 +> out2o.tmp
1.68 +
1.69 + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \
1.70 +&& echo "Success" \
1.71 +|| echo "Failed"
1.72 +
1.73 +# Test acceptance and registration in the outgoing handler.
1.74 +
1.75 + "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event26@example.com" 2>> $ERROR \
1.76 +| tee out3.tmp \
1.77 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.78 +
1.79 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.80 +> out3f.tmp
1.81 +
1.82 + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \
1.83 +&& echo "Success" \
1.84 +|| echo "Failed"
1.85 +
1.86 +# Test registration in the incoming handler.
1.87 +
1.88 + "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \
1.89 +| "$SHOWMAIL" \
1.90 +> out4.tmp
1.91 +
1.92 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.93 +> out4f.tmp
1.94 +
1.95 + [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \
1.96 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f.tmp" \
1.97 +&& echo "Success" \
1.98 +|| echo "Failed"
1.99 +
1.100 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \
1.101 +> out4o.tmp
1.102 +
1.103 + [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \
1.104 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o.tmp" \
1.105 +&& echo "Success" \
1.106 +|| echo "Failed"
1.107 +
1.108 +# Test recurrence declination in the outgoing handler.
1.109 +
1.110 + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "event26@example.com" "20141011T080000Z" 2>> $ERROR \
1.111 +| tee out5.tmp \
1.112 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
1.113 +
1.114 + "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \
1.115 +> out5s.tmp
1.116 +
1.117 + [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \
1.118 +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5s.tmp" \
1.119 +&& echo "Success" \
1.120 +|| echo "Failed"
1.121 +
1.122 +# Test declination in the incoming handler.
1.123 +
1.124 + "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \
1.125 +| "$SHOWMAIL" \
1.126 +> out6.tmp
1.127 +
1.128 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.129 +> out6f.tmp
1.130 +
1.131 + [ `grep "event26@example.com" "out6f.tmp" | wc -l` = '2' ] \
1.132 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f.tmp" \
1.133 +&& echo "Success" \
1.134 +|| echo "Failed"
1.135 +
1.136 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \
1.137 +> out6o.tmp
1.138 +
1.139 + [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \
1.140 +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o.tmp" \
1.141 +&& echo "Success" \
1.142 +|| echo "Failed"