1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 USER="mailto:vincent.vole@example.com" 6 SENDER="mailto:paul.boddie@example.com" 7 FBFILE="$STORE/$USER/freebusy" 8 FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER" 9 FBSENDERFILE="$STORE/$SENDER/freebusy" 10 FBSENDEROTHERFILE="$STORE/$SENDER/freebusy-other/$USER" 11 12 mkdir -p "$PREFS/$USER" 13 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 14 echo 'share' > "$PREFS/$USER/freebusy_sharing" 15 16 mkdir -p "$PREFS/$SENDER" 17 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 18 echo 'always' > "$PREFS/$SENDER/event_refreshing" 19 20 # Test event request registration in the outgoing handler. 21 22 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR 23 24 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \ 25 && echo "Success" \ 26 || echo "Failed" 27 28 # Present the request to the recipient. 29 30 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \ 31 | "$SHOWMAIL" \ 32 > out2.tmp 33 34 ! grep -q 'METHOD:REPLY' out2.tmp \ 35 && echo "Success" \ 36 || echo "Failed" 37 38 ! [ -e "$FBFILE" ] \ 39 || ! grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 40 && echo "Success" \ 41 || echo "Failed" 42 43 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBOTHERFILE" \ 44 && echo "Success" \ 45 || echo "Failed" 46 47 # Test acceptance and registration in the outgoing handler. 48 49 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \ 50 | tee out3.tmp \ 51 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 52 53 "$SHOWMAIL" < out3.tmp | grep -q 'METHOD:REPLY' \ 54 && echo "Success" \ 55 || echo "Failed" 56 57 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 58 && echo "Success" \ 59 || echo "Failed" 60 61 # Present the result to the recipient. 62 63 "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ 64 | "$SHOWMAIL" \ 65 > out4.tmp 66 67 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDEROTHERFILE" \ 68 && echo "Success" \ 69 || echo "Failed" 70 71 # Attempt to add an occurrence to the event. 72 73 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring.txt" 2>> $ERROR 74 75 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \ 76 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBSENDERFILE" \ 77 && echo "Success" \ 78 || echo "Failed" 79 80 # Present the request to the recipient. 81 82 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring.txt" 2>> $ERROR \ 83 | "$SHOWMAIL" \ 84 > out5.tmp 85 86 grep -q 'METHOD:REFRESH' out5.tmp \ 87 && echo "Success" \ 88 || echo "Failed" 89 90 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 91 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \ 92 && echo "Success" \ 93 || echo "Failed" 94 95 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBOTHERFILE" \ 96 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBOTHERFILE" \ 97 && echo "Success" \ 98 || echo "Failed" 99 100 # Present the refresh message to the organiser. 101 102 "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \ 103 | tee out6r.tmp \ 104 | "$SHOWMAIL" \ 105 > out6.tmp 106 107 grep -q 'METHOD:REQUEST' out6.tmp \ 108 && echo "Success" \ 109 || echo "Failed" 110 111 # Present the request to the recipient. 112 113 "$PERSON_SCRIPT" $ARGS < out6r.tmp 2>> $ERROR \ 114 | "$SHOWMAIL" \ 115 > out7.tmp 116 117 ! grep -q 'METHOD:REPLY' out7.tmp \ 118 && echo "Success" \ 119 || echo "Failed" 120 121 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 122 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \ 123 && echo "Success" \ 124 || echo "Failed" 125 126 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBOTHERFILE" \ 127 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBOTHERFILE" \ 128 && echo "Success" \ 129 || echo "Failed" 130 131 # Test acceptance and registration in the outgoing handler. 132 133 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \ 134 | tee out8.tmp \ 135 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 136 137 "$SHOWMAIL" < out8.tmp | grep -q 'METHOD:REPLY' \ 138 && echo "Success" \ 139 || echo "Failed" 140 141 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20150109T090000Z" 2>> $ERROR \ 142 | tee out9.tmp \ 143 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 144 145 "$SHOWMAIL" < out9.tmp | grep -q 'METHOD:REPLY' \ 146 && echo "Success" \ 147 || echo "Failed" 148 149 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 150 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \ 151 && echo "Success" \ 152 || echo "Failed"