1 #!/bin/sh 2 3 THIS_DIR=`dirname $0` 4 5 TEMPLATES="$THIS_DIR/templates" 6 OUTGOING_SCRIPT="$THIS_DIR/../imip_person_outgoing.py" 7 SHOWMAIL="$THIS_DIR/../tools/showmail.py" 8 STORE=/tmp/store 9 STATIC=/tmp/static 10 ARGS="-S $STORE -P $STATIC -d" 11 USER="mailto:paul.boddie@example.com" 12 FBFILE="$STORE/$USER/freebusy" 13 TAB=`printf '\t'` 14 15 rm -r $STORE 16 rm -r $STATIC 17 18 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request.txt" 2> /dev/null 19 cp "$FBFILE" out1.tmp 20 21 grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBFILE" \ 22 && echo "Success" \ 23 || echo "Failed" 24 25 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel.txt" 2> /dev/null 26 echo "Cancel..." 27 cp "$FBFILE" out2.tmp 28 29 ! grep -q '^2' "$FBFILE" \ 30 && echo "Success" \ 31 || echo "Failed" 32 33 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2> /dev/null 34 cp "$FBFILE" out3.tmp 35 36 [ `cat "$FBFILE" | wc -l` = '3' ] \ 37 && grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 38 && echo "Success" \ 39 || echo "Failed" 40 41 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-instance.txt" 2> /dev/null 42 cp "$FBFILE" out4.tmp 43 44 [ `cat "$FBFILE" | wc -l` = '2' ] \ 45 && ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "$FBFILE" \ 46 && echo "Success" \ 47 || echo "Failed" 48 49 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-reschedule-instance.txt" 2> /dev/null 50 cp "$FBFILE" out5.tmp 51 52 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBFILE" \ 53 && ! grep -q "^20141010T090000Z${TAB}20141010T100000Z" "$FBFILE" \ 54 && echo "Success" \ 55 || echo "Failed" 56 57 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2> /dev/null 58 cp "$FBFILE" out6.tmp 59 60 ! grep -q '^2' "$FBFILE" \ 61 && echo "Success" \ 62 || echo "Failed" 63 64 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-day.txt" 2> /dev/null 65 cp "$FBFILE" out7.tmp 66 67 [ `cat "$FBFILE" | wc -l` = '3' ] \ 68 && grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \ 69 && echo "Success" \ 70 || echo "Failed"