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