1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 USER="mailto:resource-room-confroom@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/$SENDER/TZID" 14 echo 'always' > "$PREFS/$SENDER/event_refreshing" 15 16 # Publish an event, testing registration in the outgoing handler. 17 18 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR 19 20 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 21 | tee out0f.tmp \ 22 | grep -q "^20141212T090000Z${TAB}20141212T100000Z" \ 23 && echo "Success" \ 24 || echo "Failed" 25 26 # Present the request to the recipient. 27 28 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR \ 29 | "$SHOWMAIL" \ 30 > out1.tmp 31 32 grep -q 'METHOD:REPLY' out1.tmp \ 33 && echo "Success" \ 34 || echo "Failed" 35 36 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 37 | tee out1f.tmp \ 38 | grep -q "^20141212T090000Z${TAB}20141212T100000Z" \ 39 && echo "Success" \ 40 || echo "Failed" 41 42 # Present the response to the sender. 43 44 "$PERSON_SCRIPT" $ARGS < out1.tmp 2>> $ERROR \ 45 | "$SHOWMAIL" \ 46 > out2.tmp 47 48 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ 49 | tee out2o.tmp \ 50 | grep -q "^20141212T090000Z${TAB}20141212T100000Z" \ 51 && echo "Success" \ 52 || echo "Failed" 53 54 # Attempt to add an occurrence to the event. 55 56 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR 57 58 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 59 > out2f.tmp 60 61 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out2f.tmp" \ 62 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out2f.tmp" \ 63 && echo "Success" \ 64 || echo "Failed" 65 66 # Present the request to the recipient. 67 68 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR \ 69 | "$SHOWMAIL" \ 70 > out3.tmp 71 72 grep -q 'METHOD:REFRESH' out3.tmp \ 73 && echo "Success" \ 74 || echo "Failed" 75 76 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 77 > out3f.tmp 78 79 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out3f.tmp" \ 80 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out3f.tmp" \ 81 && echo "Success" \ 82 || echo "Failed" 83 84 # Present the refresh message to the organiser. 85 86 "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ 87 | tee out4r.tmp \ 88 | "$SHOWMAIL" \ 89 > out4.tmp 90 91 grep -q 'METHOD:REQUEST' out4.tmp \ 92 && echo "Success" \ 93 || echo "Failed" 94 95 # Present the request to the recipient. 96 97 "$RESOURCE_SCRIPT" $ARGS < out4r.tmp 2>> $ERROR \ 98 | tee out5r.tmp \ 99 | "$SHOWMAIL" \ 100 > out5.tmp 101 102 grep -q 'METHOD:REPLY' out5.tmp \ 103 && echo "Success" \ 104 || echo "Failed" 105 106 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 107 > out5f.tmp 108 109 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out5f.tmp" \ 110 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out5f.tmp" \ 111 && echo "Success" \ 112 || echo "Failed" 113 114 # Present the response to the sender. 115 116 "$PERSON_SCRIPT" $ARGS < out5r.tmp 2>> $ERROR \ 117 | "$SHOWMAIL" \ 118 > out6.tmp 119 120 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ 121 > out6o.tmp 122 123 grep -q "^20141212T090000Z${TAB}20141212T100000Z" "out6o.tmp" \ 124 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "out6o.tmp" \ 125 && echo "Success" \ 126 || echo "Failed"