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 ERROR=err.tmp 15 16 rm -r $STORE 17 rm -r $STATIC 18 rm $ERROR 19 rm out*.tmp 20 21 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request.txt" 2>> $ERROR 22 cp "$FBFILE" out1.tmp 23 24 grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBFILE" \ 25 && echo "Success" \ 26 || echo "Failed" 27 28 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel.txt" 2>> $ERROR 29 echo "Cancel..." 30 cp "$FBFILE" out2.tmp 31 32 ! grep -q '^2' "$FBFILE" \ 33 && echo "Success" \ 34 || echo "Failed" 35 36 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR 37 cp "$FBFILE" out3.tmp 38 39 [ `cat "$FBFILE" | wc -l` = '3' ] \ 40 && grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \ 41 && echo "Success" \ 42 || echo "Failed" 43 44 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-instance.txt" 2>> $ERROR 45 cp "$FBFILE" out4.tmp 46 47 [ `cat "$FBFILE" | wc -l` = '2' ] \ 48 && ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "$FBFILE" \ 49 && echo "Success" \ 50 || echo "Failed" 51 52 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-reschedule-instance.txt" 2>> $ERROR 53 cp "$FBFILE" out5.tmp 54 55 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBFILE" \ 56 && ! grep -q "^20141010T090000Z${TAB}20141010T100000Z" "$FBFILE" \ 57 && echo "Success" \ 58 || echo "Failed" 59 60 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR 61 cp "$FBFILE" out6.tmp 62 63 ! grep -q '^2' "$FBFILE" \ 64 && echo "Success" \ 65 || echo "Failed" 66 67 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-day.txt" 2>> $ERROR 68 cp "$FBFILE" out7.tmp 69 70 [ `cat "$FBFILE" | wc -l` = '3' ] \ 71 && grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \ 72 && echo "Success" \ 73 || echo "Failed"