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 8 mkdir -p "$PREFS/$USER" 9 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 10 echo 'share' > "$PREFS/$USER/freebusy_sharing" 11 12 mkdir -p "$PREFS/$SENDER" 13 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 14 echo 'always' > "$PREFS/$SENDER/event_refreshing" 15 16 # Test event request registration in the outgoing handler. 17 18 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR 19 20 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 21 > out1f.tmp 22 23 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out1f.tmp" \ 24 && echo "Success" \ 25 || echo "Failed" 26 27 # Present the request to the recipient. 28 29 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring.txt" 2>> $ERROR \ 30 | "$SHOWMAIL" \ 31 > out2.tmp 32 33 ! grep -q 'METHOD:REPLY' out2.tmp \ 34 && echo "Success" \ 35 || echo "Failed" 36 37 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 38 > out2f.tmp 39 40 ! grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out2f.tmp" \ 41 && echo "Success" \ 42 || echo "Failed" 43 44 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ 45 > out2fo.tmp 46 47 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out2fo.tmp" \ 48 && echo "Success" \ 49 || echo "Failed" 50 51 # Test acceptance and registration in the outgoing handler. 52 53 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \ 54 | tee out3.tmp \ 55 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 56 57 "$SHOWMAIL" < out3.tmp | grep -q 'METHOD:REPLY' \ 58 && echo "Success" \ 59 || echo "Failed" 60 61 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 62 > out3f.tmp 63 64 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out3f.tmp" \ 65 && echo "Success" \ 66 || echo "Failed" 67 68 # Present the result to the recipient. 69 70 "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ 71 | "$SHOWMAIL" \ 72 > out4.tmp 73 74 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ 75 > out4fo.tmp 76 77 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out4fo.tmp" \ 78 && echo "Success" \ 79 || echo "Failed" 80 81 # Attempt to add an occurrence to the event. 82 83 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring.txt" 2>> $ERROR 84 85 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 86 > out4f.tmp 87 88 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out4f.tmp" \ 89 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out4f.tmp" \ 90 && echo "Success" \ 91 || echo "Failed" 92 93 # Present the request to the recipient. 94 95 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-add-person-recurring.txt" 2>> $ERROR \ 96 | "$SHOWMAIL" \ 97 > out5.tmp 98 99 grep -q 'METHOD:REFRESH' out5.tmp \ 100 && echo "Success" \ 101 || echo "Failed" 102 103 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 104 > out5f.tmp 105 106 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out5f.tmp" \ 107 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out5f.tmp" \ 108 && echo "Success" \ 109 || echo "Failed" 110 111 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ 112 > out5fo.tmp 113 114 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out5fo.tmp" \ 115 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out5fo.tmp" \ 116 && echo "Success" \ 117 || echo "Failed" 118 119 # Present the refresh message to the organiser. 120 121 "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \ 122 | tee out6r.tmp \ 123 | "$SHOWMAIL" \ 124 > out6.tmp 125 126 grep -q 'METHOD:REQUEST' out6.tmp \ 127 && echo "Success" \ 128 || echo "Failed" 129 130 # Present the request to the recipient. 131 132 "$PERSON_SCRIPT" $ARGS < out6r.tmp 2>> $ERROR \ 133 | "$SHOWMAIL" \ 134 > out7.tmp 135 136 ! grep -q 'METHOD:REPLY' out7.tmp \ 137 && echo "Success" \ 138 || echo "Failed" 139 140 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 141 > out7f.tmp 142 143 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out7f.tmp" \ 144 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out7f.tmp" \ 145 && echo "Success" \ 146 || echo "Failed" 147 148 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ 149 > out7fo.tmp 150 151 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out7fo.tmp" \ 152 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out7fo.tmp" \ 153 && echo "Success" \ 154 || echo "Failed" 155 156 # Test acceptance and registration in the outgoing handler. 157 158 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" 2>> $ERROR \ 159 | tee out8.tmp \ 160 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 161 162 "$SHOWMAIL" < out8.tmp | grep -q 'METHOD:REPLY' \ 163 && echo "Success" \ 164 || echo "Failed" 165 166 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event8@example.com" "20150109T090000Z" 2>> $ERROR \ 167 | tee out9.tmp \ 168 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 169 170 "$SHOWMAIL" < out9.tmp | grep -q 'METHOD:REPLY' \ 171 && echo "Success" \ 172 || echo "Failed" 173 174 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 175 > out9f.tmp 176 177 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out9f.tmp" \ 178 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out9f.tmp" \ 179 && echo "Success" \ 180 || echo "Failed"