imip-agent

Annotated tests/test_resource_invitation_add.sh

1024:48b37822d2a0
2016-01-29 Paul Boddie Moved common test initialisation into a separate script.
paul@737 1
#!/bin/sh
paul@737 2
paul@1024 3
. "`dirname \"$0\"`/common.sh"
paul@737 4
paul@737 5
USER="mailto:resource-room-confroom@example.com"
paul@737 6
SENDER="mailto:paul.boddie@example.com"
paul@737 7
FBFILE="$STORE/$USER/freebusy"
paul@737 8
FBSENDERFILE="$STORE/$SENDER/freebusy"
paul@737 9
FBSENDEROTHERFILE="$STORE/$SENDER/freebusy-other/$USER"
paul@737 10
paul@737 11
mkdir -p "$PREFS/$USER"
paul@737 12
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@737 13
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@737 14
paul@737 15
mkdir -p "$PREFS/$SENDER"
paul@737 16
echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID"
paul@737 17
echo 'always' > "$PREFS/$SENDER/event_refreshing"
paul@737 18
paul@737 19
# Publish an event, testing registration in the outgoing handler.
paul@737 20
paul@737 21
"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR
paul@737 22
paul@737 23
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \
paul@737 24
&& echo "Success" \
paul@737 25
|| echo "Failed"
paul@737 26
paul@737 27
# Present the request to the recipient.
paul@737 28
paul@737 29
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR \
paul@737 30
| "$SHOWMAIL" \
paul@737 31
> out1.tmp
paul@737 32
paul@737 33
   grep -q 'METHOD:REPLY' out1.tmp \
paul@737 34
&& echo "Success" \
paul@737 35
|| echo "Failed"
paul@737 36
paul@737 37
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \
paul@737 38
&& echo "Success" \
paul@737 39
|| echo "Failed"
paul@737 40
paul@737 41
# Present the response to the sender.
paul@737 42
paul@737 43
  "$PERSON_SCRIPT" $ARGS < out1.tmp 2>> $ERROR \
paul@737 44
| "$SHOWMAIL" \
paul@737 45
> out2.tmp
paul@737 46
paul@737 47
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDEROTHERFILE" \
paul@737 48
&& echo "Success" \
paul@737 49
|| echo "Failed"
paul@737 50
paul@737 51
# Attempt to add an occurrence to the event.
paul@737 52
paul@737 53
"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR
paul@737 54
paul@737 55
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \
paul@737 56
&& grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBSENDERFILE" \
paul@737 57
&& echo "Success" \
paul@737 58
|| echo "Failed"
paul@737 59
paul@737 60
# Present the request to the recipient.
paul@737 61
paul@737 62
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR \
paul@737 63
| "$SHOWMAIL" \
paul@737 64
> out3.tmp
paul@737 65
paul@737 66
   grep -q 'METHOD:REFRESH' out3.tmp \
paul@737 67
&& echo "Success" \
paul@737 68
|| echo "Failed"
paul@737 69
paul@737 70
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \
paul@737 71
&& ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \
paul@737 72
&& echo "Success" \
paul@737 73
|| echo "Failed"
paul@737 74
paul@737 75
# Present the refresh message to the organiser.
paul@737 76
paul@737 77
  "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \
paul@866 78
| tee out4r.tmp \
paul@737 79
| "$SHOWMAIL" \
paul@737 80
> out4.tmp
paul@737 81
paul@737 82
   grep -q 'METHOD:REQUEST' out4.tmp \
paul@737 83
&& echo "Success" \
paul@737 84
|| echo "Failed"
paul@737 85
paul@737 86
# Present the request to the recipient.
paul@737 87
paul@866 88
  "$RESOURCE_SCRIPT" $ARGS < out4r.tmp 2>> $ERROR \
paul@737 89
| tee out5r.tmp \
paul@737 90
| "$SHOWMAIL" \
paul@737 91
> out5.tmp
paul@737 92
paul@737 93
   grep -q 'METHOD:REPLY' out5.tmp \
paul@737 94
&& echo "Success" \
paul@737 95
|| echo "Failed"
paul@737 96
paul@737 97
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \
paul@737 98
&& grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \
paul@737 99
&& echo "Success" \
paul@737 100
|| echo "Failed"
paul@737 101
paul@737 102
# Present the response to the sender.
paul@737 103
paul@737 104
  "$PERSON_SCRIPT" $ARGS < out5r.tmp 2>> $ERROR \
paul@737 105
| "$SHOWMAIL" \
paul@737 106
> out6.tmp
paul@737 107
paul@737 108
   grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDEROTHERFILE" \
paul@737 109
&& grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBSENDEROTHERFILE" \
paul@737 110
&& echo "Success" \
paul@737 111
|| echo "Failed"