imip-agent

Annotated tests/test_resource_invitation_bad.sh

1069:37921ab84c01
2016-03-06 Paul Boddie Moved imip_store into a new imiptools.stores package as the file module.
paul@721 1
#!/bin/sh
paul@721 2
paul@1024 3
. "`dirname \"$0\"`/common.sh"
paul@721 4
paul@721 5
USER="mailto:resource-room-confroom@example.com"
paul@721 6
paul@721 7
mkdir -p "$PREFS/$USER"
paul@721 8
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@721 9
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@721 10
paul@721 11
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@721 12
| "$SHOWMAIL" \
paul@721 13
> out0.tmp
paul@721 14
paul@721 15
   grep -q 'METHOD:REPLY' out0.tmp \
paul@721 16
&& ! grep -q '^FREEBUSY' out0.tmp \
paul@721 17
&& echo "Success" \
paul@721 18
|| echo "Failed"
paul@721 19
paul@721 20
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-day.txt" 2>> $ERROR \
paul@721 21
| "$SHOWMAIL" \
paul@721 22
> out1.tmp
paul@721 23
paul@721 24
   grep -q 'METHOD:REPLY' out1.tmp \
paul@721 25
&& ! grep -q '^FREEBUSY' out1.tmp \
paul@721 26
&& echo "Success" \
paul@721 27
|| echo "Failed"
paul@721 28
paul@721 29
# Recover from a bad DTSTAMP.
paul@721 30
paul@721 31
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-bad-dtstamp.txt" 2>> $ERROR \
paul@721 32
| "$SHOWMAIL" \
paul@721 33
> out2.tmp
paul@721 34
paul@721 35
   grep -q 'METHOD:REPLY' out2.tmp \
paul@721 36
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
paul@721 37
&& echo "Success" \
paul@721 38
|| echo "Failed"
paul@721 39
paul@721 40
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-day.txt" 2>> $ERROR \
paul@721 41
| "$SHOWMAIL" \
paul@721 42
> out3.tmp
paul@721 43
paul@721 44
   grep -q 'METHOD:REPLY' out3.tmp \
paul@721 45
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T080000Z/20141126T090000Z' out3.tmp \
paul@721 46
&& echo "Success" \
paul@721 47
|| echo "Failed"
paul@721 48
paul@721 49
# Reject a bad DTSTART.
paul@721 50
paul@721 51
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-bad-dtstart.txt" 2>> $ERROR \
paul@721 52
| "$SHOWMAIL" \
paul@721 53
> out4.tmp
paul@721 54
paul@721 55
   ! grep -q 'METHOD:REPLY' out4.tmp \
paul@721 56
&& echo "Success" \
paul@721 57
|| echo "Failed"
paul@721 58
paul@721 59
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-day.txt" 2>> $ERROR \
paul@721 60
| "$SHOWMAIL" \
paul@721 61
> out5.tmp
paul@721 62
paul@721 63
   grep -q 'METHOD:REPLY' out5.tmp \
paul@721 64
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T090000Z/20141126T100000Z' out5.tmp \
paul@721 65
&& echo "Success" \
paul@721 66
|| echo "Failed"
paul@726 67
paul@726 68
# Reject a bad DTEND.
paul@726 69
paul@726 70
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-bad-dtend.txt" 2>> $ERROR \
paul@726 71
| "$SHOWMAIL" \
paul@726 72
> out6.tmp
paul@726 73
paul@726 74
   ! grep -q 'METHOD:REPLY' out6.tmp \
paul@726 75
&& echo "Success" \
paul@726 76
|| echo "Failed"
paul@726 77
paul@726 78
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-day.txt" 2>> $ERROR \
paul@726 79
| "$SHOWMAIL" \
paul@726 80
> out7.tmp
paul@726 81
paul@726 82
   grep -q 'METHOD:REPLY' out7.tmp \
paul@726 83
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T100000Z/20141126T110000Z' out7.tmp \
paul@726 84
&& echo "Success" \
paul@726 85
|| echo "Failed"