1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 USER="mailto:vincent.vole@example.com" 6 SENDER="mailto:paul.boddie@example.com" 7 8 mkdir -p "$PREFS/$USER" 9 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 10 echo 'share' > "$PREFS/$USER/freebusy_sharing" 11 12 mkdir -p "$PREFS/$SENDER" 13 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 14 15 # Test free/busy responses. 16 17 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \ 18 | "$SHOWMAIL" \ 19 > out0.tmp 20 21 grep -q 'METHOD:REPLY' out0.tmp \ 22 && ! grep -q '^FREEBUSY' out0.tmp \ 23 && echo "Success" \ 24 || echo "Failed" 25 26 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \ 27 | "$SHOWMAIL" \ 28 > out1.tmp 29 30 grep -q 'METHOD:REPLY' out1.tmp \ 31 && ! grep -q '^FREEBUSY' out1.tmp \ 32 && echo "Success" \ 33 || echo "Failed" 34 35 # Publish an event, testing registration in the outgoing handler. 36 37 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR 38 39 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 40 > out1f.tmp 41 42 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out1f.tmp" \ 43 && echo "Success" \ 44 || echo "Failed" 45 46 # Test registration in the incoming handler for the recipient. 47 48 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-rdate.txt" 2>> $ERROR \ 49 | "$SHOWMAIL" \ 50 > out2.tmp 51 52 ! grep -q 'METHOD:REPLY' out2.tmp \ 53 && echo "Success" \ 54 || echo "Failed" 55 56 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 57 > out2f.tmp 58 59 ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2f.tmp" \ 60 && echo "Success" \ 61 || echo "Failed" 62 63 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ 64 > out2o.tmp 65 66 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out2o.tmp" \ 67 && echo "Success" \ 68 || echo "Failed" 69 70 # Test acceptance and registration in the outgoing handler. 71 72 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event26@example.com" 2>> $ERROR \ 73 | tee out3.tmp \ 74 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 75 76 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 77 > out3f.tmp 78 79 grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out3f.tmp" \ 80 && echo "Success" \ 81 || echo "Failed" 82 83 # Test registration in the incoming handler. 84 85 "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \ 86 | "$SHOWMAIL" \ 87 > out4.tmp 88 89 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 90 > out4f.tmp 91 92 [ `grep "event26@example.com" "out4f.tmp" | wc -l` = '2' ] \ 93 && grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4f.tmp" \ 94 && echo "Success" \ 95 || echo "Failed" 96 97 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \ 98 > out4o.tmp 99 100 [ `grep "event26@example.com" "out4o.tmp" | wc -l` = '2' ] \ 101 && grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out4o.tmp" \ 102 && echo "Success" \ 103 || echo "Failed" 104 105 # Test recurrence declination in the outgoing handler. 106 107 "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "event26@example.com" "20141011T100000" 2>> $ERROR \ 108 | tee out5.tmp \ 109 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 110 111 "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \ 112 > out5s.tmp 113 114 [ `grep "event26@example.com" "out5s.tmp" | wc -l` = '1' ] \ 115 && ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out5s.tmp" \ 116 && echo "Success" \ 117 || echo "Failed" 118 119 # Test declination in the incoming handler. 120 121 "$PERSON_SCRIPT" $ARGS < out5.tmp 2>> $ERROR \ 122 | "$SHOWMAIL" \ 123 > out6.tmp 124 125 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \ 126 > out6f.tmp 127 128 [ `grep "event26@example.com" "out6f.tmp" | wc -l` = '2' ] \ 129 && grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f.tmp" \ 130 && echo "Success" \ 131 || echo "Failed" 132 133 "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER" \ 134 > out6o.tmp 135 136 [ `grep "event26@example.com" "out6o.tmp" | wc -l` = '1' ] \ 137 && ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6o.tmp" \ 138 && echo "Success" \ 139 || echo "Failed"