1 #!/bin/sh 2 3 THIS_DIR=`dirname $0` 4 5 TEMPLATES="$THIS_DIR/templates" 6 RESOURCE_SCRIPT="$THIS_DIR/../imip_resource.py" 7 SHOWMAIL="$THIS_DIR/../tools/showmail.py" 8 STORE=/tmp/store 9 STATIC=/tmp/static 10 PREFS=/tmp/prefs 11 ARGS="-S $STORE -P $STATIC -p $PREFS -d" 12 USER="mailto:resource-room-confroom@example.com" 13 ERROR=err.tmp 14 15 rm -rf $STORE 16 rm -rf $STATIC 17 rm -rf $PREFS 18 rm -f $ERROR 19 rm -f out*.tmp 20 21 mkdir -p "$PREFS/$USER" 22 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 23 echo 'share' > "$PREFS/$USER/freebusy_sharing" 24 25 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 26 | "$SHOWMAIL" \ 27 > out0.tmp 28 29 grep -q 'METHOD:REPLY' out0.tmp \ 30 && ! grep -q '^FREEBUSY' out0.tmp \ 31 && echo "Success" \ 32 || echo "Failed" 33 34 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR \ 35 | "$SHOWMAIL" \ 36 > out2.tmp 37 38 grep -q 'METHOD:REPLY' out2.tmp \ 39 && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \ 40 && echo "Success" \ 41 || echo "Failed" 42 43 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 44 | "$SHOWMAIL" \ 45 > out3.tmp 46 47 grep -q 'METHOD:REPLY' out3.tmp \ 48 && [ `grep 'FREEBUSY;FBTYPE=BUSY' out3.tmp | wc -l` = '3' ] \ 49 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out3.tmp \ 50 && echo "Success" \ 51 || echo "Failed" 52 53 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-instance.txt" 2>> $ERROR 54 echo "Cancel..." 55 56 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 57 | "$SHOWMAIL" \ 58 > out4.tmp 59 60 grep -q 'METHOD:REPLY' out4.tmp \ 61 && [ `grep 'FREEBUSY;FBTYPE=BUSY' out4.tmp | wc -l` = '2' ] \ 62 && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out4.tmp \ 63 && echo "Success" \ 64 || echo "Failed" 65 66 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-reschedule-instance.txt" 2>> $ERROR \ 67 | "$SHOWMAIL" \ 68 > out5.tmp 69 70 grep -q 'METHOD:REPLY' out5.tmp \ 71 && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out5.tmp \ 72 && echo "Success" \ 73 || echo "Failed" 74 75 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 76 | "$SHOWMAIL" \ 77 > out6.tmp 78 79 grep -q 'METHOD:REPLY' out6.tmp \ 80 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141011T080000Z/20141011T090000Z' out6.tmp \ 81 && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141010T080000Z/20141010T090000Z' out6.tmp \ 82 && echo "Success" \ 83 || echo "Failed" 84 85 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR 86 echo "Cancel..." 87 88 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 89 | "$SHOWMAIL" \ 90 > out7.tmp 91 92 grep -q 'METHOD:REPLY' out7.tmp \ 93 && ! grep -q '^FREEBUSY' out7.tmp \ 94 && echo "Success" \ 95 || echo "Failed"