paul@641 | 1 | #!/bin/sh |
paul@641 | 2 | |
paul@641 | 3 | THIS_DIR=`dirname $0` |
paul@641 | 4 | |
paul@641 | 5 | TEMPLATES="$THIS_DIR/templates" |
paul@641 | 6 | RESOURCE_SCRIPT="$THIS_DIR/../imip_resource.py" |
paul@641 | 7 | SHOWMAIL="$THIS_DIR/../tools/showmail.py" |
paul@641 | 8 | STORE=/tmp/store |
paul@641 | 9 | STATIC=/tmp/static |
paul@641 | 10 | PREFS=/tmp/prefs |
paul@641 | 11 | ARGS="-S $STORE -P $STATIC -p $PREFS -d" |
paul@641 | 12 | USER="mailto:resource-room-confroom@example.com" |
paul@641 | 13 | ERROR=err.tmp |
paul@641 | 14 | |
paul@641 | 15 | rm -r $STORE |
paul@641 | 16 | rm -r $STATIC |
paul@641 | 17 | rm -r $PREFS |
paul@641 | 18 | rm $ERROR |
paul@641 | 19 | rm out*.tmp |
paul@641 | 20 | |
paul@641 | 21 | mkdir -p "$PREFS/$USER" |
paul@641 | 22 | echo 'Europe/Oslo' > "$PREFS/$USER/TZID" |
paul@641 | 23 | echo 'share' > "$PREFS/$USER/freebusy_sharing" |
paul@641 | 24 | |
paul@641 | 25 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@641 | 26 | | "$SHOWMAIL" \ |
paul@641 | 27 | > out0.tmp |
paul@641 | 28 | |
paul@641 | 29 | grep -q 'METHOD:REPLY' out0.tmp \ |
paul@641 | 30 | && ! grep -q '^FREEBUSY' out0.tmp \ |
paul@641 | 31 | && echo "Success" \ |
paul@641 | 32 | || echo "Failed" |
paul@641 | 33 | |
paul@641 | 34 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-exdate.txt" 2>> $ERROR \ |
paul@641 | 35 | | "$SHOWMAIL" \ |
paul@641 | 36 | > out2.tmp |
paul@641 | 37 | |
paul@641 | 38 | grep -q 'METHOD:REPLY' out2.tmp \ |
paul@641 | 39 | && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \ |
paul@641 | 40 | && echo "Success" \ |
paul@641 | 41 | || echo "Failed" |
paul@641 | 42 | |
paul@641 | 43 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@641 | 44 | | "$SHOWMAIL" \ |
paul@641 | 45 | > out3.tmp |
paul@641 | 46 | |
paul@641 | 47 | grep -q 'METHOD:REPLY' out3.tmp \ |
paul@641 | 48 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out3.tmp \ |
paul@641 | 49 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out3.tmp \ |
paul@641 | 50 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out3.tmp \ |
paul@641 | 51 | && echo "Success" \ |
paul@641 | 52 | || echo "Failed" |
paul@641 | 53 | |
paul@641 | 54 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-exdate.txt" 2>> $ERROR |
paul@641 | 55 | echo "Cancel..." |
paul@641 | 56 | |
paul@641 | 57 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@641 | 58 | | "$SHOWMAIL" \ |
paul@641 | 59 | > out4.tmp |
paul@641 | 60 | |
paul@641 | 61 | grep -q 'METHOD:REPLY' out4.tmp \ |
paul@641 | 62 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out4.tmp \ |
paul@641 | 63 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out4.tmp \ |
paul@641 | 64 | && echo "Success" \ |
paul@641 | 65 | || echo "Failed" |
paul@641 | 66 | |
paul@641 | 67 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-exdate-floating.txt" 2>> $ERROR \ |
paul@641 | 68 | | "$SHOWMAIL" \ |
paul@641 | 69 | > out5.tmp |
paul@641 | 70 | |
paul@641 | 71 | grep -q 'METHOD:REPLY' out5.tmp \ |
paul@641 | 72 | && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out5.tmp \ |
paul@641 | 73 | && echo "Success" \ |
paul@641 | 74 | || echo "Failed" |
paul@641 | 75 | |
paul@641 | 76 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@641 | 77 | | "$SHOWMAIL" \ |
paul@641 | 78 | > out6.tmp |
paul@641 | 79 | |
paul@641 | 80 | grep -q 'METHOD:REPLY' out6.tmp \ |
paul@641 | 81 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out6.tmp \ |
paul@641 | 82 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out6.tmp \ |
paul@641 | 83 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out6.tmp \ |
paul@641 | 84 | && echo "Success" \ |
paul@641 | 85 | || echo "Failed" |
paul@641 | 86 | |
paul@641 | 87 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-exdate-floating.txt" 2>> $ERROR |
paul@641 | 88 | echo "Cancel..." |
paul@641 | 89 | |
paul@641 | 90 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@641 | 91 | | "$SHOWMAIL" \ |
paul@641 | 92 | > out7.tmp |
paul@641 | 93 | |
paul@641 | 94 | grep -q 'METHOD:REPLY' out7.tmp \ |
paul@641 | 95 | && ! grep -q '^FREEBUSY' out7.tmp \ |
paul@641 | 96 | && echo "Success" \ |
paul@641 | 97 | || echo "Failed" |
paul@642 | 98 | |
paul@642 | 99 | # Switch time zones. |
paul@642 | 100 | |
paul@642 | 101 | echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID" |
paul@642 | 102 | |
paul@642 | 103 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-exdate.txt" 2>> $ERROR \ |
paul@642 | 104 | | "$SHOWMAIL" \ |
paul@642 | 105 | > out8.tmp |
paul@642 | 106 | |
paul@642 | 107 | grep -q 'METHOD:REPLY' out8.tmp \ |
paul@642 | 108 | && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out8.tmp \ |
paul@642 | 109 | && echo "Success" \ |
paul@642 | 110 | || echo "Failed" |
paul@642 | 111 | |
paul@642 | 112 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@642 | 113 | | "$SHOWMAIL" \ |
paul@642 | 114 | > out9.tmp |
paul@642 | 115 | |
paul@642 | 116 | grep -q 'METHOD:REPLY' out9.tmp \ |
paul@642 | 117 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out9.tmp \ |
paul@642 | 118 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out9.tmp \ |
paul@642 | 119 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out9.tmp \ |
paul@642 | 120 | && echo "Success" \ |
paul@642 | 121 | || echo "Failed" |
paul@642 | 122 | |
paul@642 | 123 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-exdate.txt" 2>> $ERROR |
paul@642 | 124 | echo "Cancel..." |
paul@642 | 125 | |
paul@642 | 126 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@642 | 127 | | "$SHOWMAIL" \ |
paul@642 | 128 | > out10.tmp |
paul@642 | 129 | |
paul@642 | 130 | grep -q 'METHOD:REPLY' out10.tmp \ |
paul@642 | 131 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out10.tmp \ |
paul@642 | 132 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out10.tmp \ |
paul@642 | 133 | && echo "Success" \ |
paul@642 | 134 | || echo "Failed" |
paul@642 | 135 | |
paul@642 | 136 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-exdate-floating.txt" 2>> $ERROR \ |
paul@642 | 137 | | "$SHOWMAIL" \ |
paul@642 | 138 | > out11.tmp |
paul@642 | 139 | |
paul@642 | 140 | grep -q 'METHOD:REPLY' out11.tmp \ |
paul@642 | 141 | && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out11.tmp \ |
paul@642 | 142 | && echo "Success" \ |
paul@642 | 143 | || echo "Failed" |
paul@642 | 144 | |
paul@642 | 145 | "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ |
paul@642 | 146 | | "$SHOWMAIL" \ |
paul@642 | 147 | > out12.tmp |
paul@642 | 148 | |
paul@642 | 149 | grep -q 'METHOD:REPLY' out12.tmp \ |
paul@642 | 150 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T080000Z/20141114T090000Z' out12.tmp \ |
paul@642 | 151 | && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T080000Z/20141212T090000Z' out12.tmp \ |
paul@642 | 152 | && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T080000Z/20150109T090000Z' out12.tmp \ |
paul@642 | 153 | && echo "Success" \ |
paul@642 | 154 | || echo "Failed" |