imip-agent

Changeset

685:4b4475ea6b6a
2015-09-04 Paul Boddie raw files shortlog changelog graph Added outgoing handler tests for the sender.
tests/test_person_invitation_recurring.sh (file)
     1.1 --- a/tests/test_person_invitation_recurring.sh	Fri Sep 04 00:26:36 2015 +0200
     1.2 +++ b/tests/test_person_invitation_recurring.sh	Fri Sep 04 23:25:50 2015 +0200
     1.3 @@ -13,6 +13,7 @@
     1.4  SENDER="mailto:paul.boddie@example.com"
     1.5  FBFILE="$STORE/$USER/freebusy"
     1.6  FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER"
     1.7 +FBSENDERFILE="$STORE/$SENDER/freebusy"
     1.8  TAB=`printf '\t'`
     1.9  
    1.10  OUTGOING_SCRIPT="$THIS_DIR/../imip_person_outgoing.py"
    1.11 @@ -38,6 +39,11 @@
    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 @@ -56,6 +62,16 @@
    1.24  && echo "Success" \
    1.25  || echo "Failed"
    1.26  
    1.27 +# Publish an event, testing registration in the outgoing handler.
    1.28 +
    1.29 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR
    1.30 +
    1.31 +   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \
    1.32 +&& echo "Success" \
    1.33 +|| echo "Failed"
    1.34 +
    1.35 +# Test registration in the incoming handler for the recipient.
    1.36 +
    1.37    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \
    1.38  | "$SHOWMAIL" \
    1.39  > out2.tmp
    1.40 @@ -72,6 +88,8 @@
    1.41  && echo "Success" \
    1.42  || echo "Failed"
    1.43  
    1.44 +# Test acceptance and registration in the outgoing handler.
    1.45 +
    1.46    "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \
    1.47  | tee out3.tmp \
    1.48  | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
    1.49 @@ -80,6 +98,17 @@
    1.50  && echo "Success" \
    1.51  || echo "Failed"
    1.52  
    1.53 +# Test recurrence cancellation in the outgoing handler.
    1.54 +
    1.55 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR
    1.56 +
    1.57 +   [ `grep "event8@example.com" "$FBSENDERFILE" | wc -l` = '2' ] \
    1.58 +&& ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "$FBSENDERFILE" \
    1.59 +&& echo "Success" \
    1.60 +|| echo "Failed"
    1.61 +
    1.62 +# Test cancellation in the incoming handler.
    1.63 +
    1.64    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-instance.txt" 2>> $ERROR \
    1.65  | "$SHOWMAIL" \
    1.66  > out4.tmp
    1.67 @@ -98,6 +127,17 @@
    1.68  && echo "Success" \
    1.69  || echo "Failed"
    1.70  
    1.71 +# Test rescheduling in the outgoing handler.
    1.72 +
    1.73 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR
    1.74 +
    1.75 +   grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \
    1.76 +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \
    1.77 +&& echo "Success" \
    1.78 +|| echo "Failed"
    1.79 +
    1.80 +# Test rescheduling in the incoming handler.
    1.81 +
    1.82    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR \
    1.83  | "$SHOWMAIL" \
    1.84  > out5.tmp
    1.85 @@ -116,6 +156,8 @@
    1.86  && echo "Success" \
    1.87  || echo "Failed"
    1.88  
    1.89 +# Test rescheduling acceptance in the outgoing handler.
    1.90 +
    1.91    "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20141010T080000Z" 2>> $ERROR \
    1.92  | tee out6.tmp \
    1.93  | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
    1.94 @@ -125,6 +167,16 @@
    1.95  && echo "Success" \
    1.96  || echo "Failed"
    1.97  
    1.98 +# Test complete cancellation in the outgoing handler.
    1.99 +
   1.100 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR
   1.101 +
   1.102 +   ! grep -q "event8@example.com" "$FBSENDERFILE" \
   1.103 +&& echo "Success" \
   1.104 +|| echo "Failed"
   1.105 +
   1.106 +# Test complete cancellation in the incoming handler.
   1.107 +
   1.108    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \
   1.109  | "$SHOWMAIL" \
   1.110  > out6.tmp
   1.111 @@ -145,6 +197,12 @@
   1.112  
   1.113  echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID"
   1.114  
   1.115 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR
   1.116 +
   1.117 +   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \
   1.118 +&& echo "Success" \
   1.119 +|| echo "Failed"
   1.120 +
   1.121    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \
   1.122  | "$SHOWMAIL" \
   1.123  > out7.tmp
   1.124 @@ -169,6 +227,12 @@
   1.125  && echo "Success" \
   1.126  || echo "Failed"
   1.127  
   1.128 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR
   1.129 +
   1.130 +   ! grep -q "event8@example.com" "$FBSENDERFILE" \
   1.131 +&& echo "Success" \
   1.132 +|| echo "Failed"
   1.133 +
   1.134    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring.txt" 2>> $ERROR \
   1.135  | "$SHOWMAIL" \
   1.136  > out9.tmp
   1.137 @@ -185,6 +249,15 @@
   1.138  && echo "Success" \
   1.139  || echo "Failed"
   1.140  
   1.141 +# Test floating dates. Here, the outgoing interpretation is different because
   1.142 +# the sender is in a different time zone.
   1.143 +
   1.144 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR
   1.145 +
   1.146 +   grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBSENDERFILE" \
   1.147 +&& echo "Success" \
   1.148 +|| echo "Failed"
   1.149 +
   1.150    "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-day-floating.txt" 2>> $ERROR \
   1.151  | "$SHOWMAIL" \
   1.152  > out10.tmp