1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 USER="mailto:resource-room-confroom@example.com" 6 QUOTA=rooms 7 8 mkdir -p "$PREFS/$USER" 9 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 10 echo 'share' > "$PREFS/$USER/freebusy_sharing" 11 12 # Add collective scheduling tests. 13 14 cat > "$PREFS/$USER/scheduling_function" <<EOF 15 schedule_across_quota $QUOTA 16 EOF 17 18 # Set delegates for recurring event handling. 19 20 cat <<EOF | "$SET_DELEGATES" "$QUOTA" $SET_DELEGATES_ARGS 21 $USER 22 EOF 23 24 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 25 | "$SHOWMAIL" \ 26 > out0.tmp 27 28 grep -q 'METHOD:REPLY' out0.tmp \ 29 && ! grep -q '^FREEBUSY' out0.tmp \ 30 && echo "Success" \ 31 || echo "Failed" 32 33 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-indefinitely.txt" 2>> $ERROR \ 34 | "$SHOWMAIL" \ 35 > out2.tmp 36 37 grep -q 'METHOD:REPLY' out2.tmp \ 38 && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \ 39 && echo "Success" \ 40 || echo "Failed" 41 42 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 43 | "$SHOWMAIL" \ 44 > out3.tmp 45 46 grep -q 'METHOD:REPLY' out3.tmp \ 47 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out3.tmp \ 48 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out3.tmp \ 49 && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out3.tmp \ 50 && echo "Success" \ 51 || echo "Failed" 52 53 "$FREEBUSY_SCRIPT" "$USER" $FREEBUSY_ARGS $ARGS 2>> $ERROR 54 55 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_providers" \ 56 | tee out3p.tmp \ 57 | grep -q 'event14@example.com' \ 58 && echo "Success" \ 59 || echo "Failed" 60 61 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-indefinitely.txt" 2>> $ERROR 62 echo "Cancel..." 63 64 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 65 | "$SHOWMAIL" \ 66 > out4.tmp 67 68 grep -q 'METHOD:REPLY' out4.tmp \ 69 && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out4.tmp \ 70 && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out4.tmp \ 71 && ! grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out4.tmp \ 72 && echo "Success" \ 73 || echo "Failed" 74 75 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_providers" \ 76 > out4p.tmp 77 78 ! grep -q 'event14@example.com' "out4p.tmp" \ 79 && echo "Success" \ 80 || echo "Failed" 81 82 # Re-add event to test scheduling and presence in the freebusy-providers file. 83 84 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-indefinitely.txt" 2>> $ERROR \ 85 | "$SHOWMAIL" \ 86 > out5.tmp 87 88 grep -q 'METHOD:REPLY' out5.tmp \ 89 && grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out5.tmp \ 90 && echo "Success" \ 91 || echo "Failed" 92 93 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \ 94 | "$SHOWMAIL" \ 95 > out6.tmp 96 97 grep -q 'METHOD:REPLY' out6.tmp \ 98 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out6.tmp \ 99 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out6.tmp \ 100 && grep -q 'FREEBUSY;FBTYPE=BUSY:20150109T090000Z/20150109T100000Z' out6.tmp \ 101 && echo "Success" \ 102 || echo "Failed" 103 104 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_providers" \ 105 | tee out6p.tmp \ 106 | grep -q 'event14@example.com' \ 107 && echo "Success" \ 108 || echo "Failed"