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 FBFILE="$STORE/$USER/freebusy" 8 FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER" 9 10 mkdir -p "$PREFS/$USER" 11 echo 'Europe/Oslo' > "$PREFS/$USER/TZID" 12 echo 'share' > "$PREFS/$USER/freebusy_sharing" 13 14 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \ 15 | "$SHOWMAIL" \ 16 > out0.tmp 17 18 grep -q 'METHOD:REPLY' out0.tmp \ 19 && ! grep -q '^FREEBUSY' out0.tmp \ 20 && echo "Success" \ 21 || echo "Failed" 22 23 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.txt" 2>> $ERROR \ 24 | "$SHOWMAIL" \ 25 > out1.tmp 26 27 grep -q 'METHOD:REPLY' out1.tmp \ 28 && ! grep -q '^FREEBUSY' out1.tmp \ 29 && echo "Success" \ 30 || echo "Failed" 31 32 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person.txt" 2>> $ERROR \ 33 | "$SHOWMAIL" \ 34 > out2.tmp 35 36 ! grep -q 'METHOD:REPLY' out2.tmp \ 37 && echo "Success" \ 38 || echo "Failed" 39 40 ! [ -e "$FBFILE" ] \ 41 || ! grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBFILE" \ 42 && echo "Success" \ 43 || echo "Failed" 44 45 grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBOTHERFILE" \ 46 && echo "Success" \ 47 || echo "Failed" 48 49 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event6@example.com" 2>> $ERROR \ 50 | tee out3.tmp \ 51 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 52 53 grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBFILE" \ 54 && echo "Success" \ 55 || echo "Failed" 56 57 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-conflict.txt" 2>> $ERROR \ 58 | "$SHOWMAIL" \ 59 > out4.tmp 60 61 ! grep -q 'METHOD:REPLY' out4.tmp \ 62 && echo "Success" \ 63 || echo "Failed" 64 65 ! grep -q "event7@example.com" "$FBFILE" \ 66 && echo "Success" \ 67 || echo "Failed" 68 69 grep -q "event7@example.com" "$FBOTHERFILE" \ 70 && echo "Success" \ 71 || echo "Failed" 72 73 "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "event7@example.com" 2>> $ERROR \ 74 | tee out5.tmp \ 75 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR 76 77 grep -q "event6@example.com" "$FBFILE" \ 78 && ! grep -q "event7@example.com" "$FBFILE" \ 79 && echo "Success" \ 80 || echo "Failed" 81 82 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person.txt" 2>> $ERROR \ 83 | "$SHOWMAIL" \ 84 > out6.tmp 85 86 ! grep -q 'METHOD:REPLY' out6.tmp \ 87 && echo "Success" \ 88 || echo "Failed" 89 90 ! grep -q "event6@example.com" "$FBFILE" \ 91 && echo "Success" \ 92 || echo "Failed" 93 94 grep -q "event6@example.com" "$FBOTHERFILE" \ 95 && echo "Success" \ 96 || echo "Failed" 97 98 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-all.txt" 2>> $ERROR \ 99 | "$SHOWMAIL" \ 100 > out7.tmp 101 102 ! grep -q 'METHOD:REPLY' out7.tmp \ 103 && echo "Success" \ 104 || echo "Failed" 105 106 ! grep -q "event6@example.com" "$FBFILE" \ 107 && echo "Success" \ 108 || echo "Failed" 109 110 ! grep -q "event6@example.com" "$FBOTHERFILE" \ 111 && echo "Success" \ 112 || echo "Failed" 113 114 "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-spoofed.txt" 2>> $ERROR \ 115 | "$SHOWMAIL" \ 116 > out8.tmp 117 118 ! grep -q 'METHOD:REPLY' out8.tmp \ 119 && echo "Success" \ 120 || echo "Failed" 121 122 ! grep -q "spoof2@example.com" "$FBFILE" \ 123 && echo "Success" \ 124 || echo "Failed" 125 126 ! grep -q "spoof2@example.com" "$FBOTHERFILE" \ 127 && echo "Success" \ 128 || echo "Failed"