imip-agent

Annotated tests/test_resource_invitation_recurring.sh

1065:2175787d1896
2016-03-04 Paul Boddie Merged changes from the default branch. freebusy-collections
paul@575 1
#!/bin/sh
paul@575 2
paul@1024 3
. "`dirname \"$0\"`/common.sh"
paul@575 4
paul@640 5
USER="mailto:resource-room-confroom@example.com"
paul@575 6
paul@640 7
mkdir -p "$PREFS/$USER"
paul@640 8
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@640 9
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@640 10
paul@602 11
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 12
| "$SHOWMAIL" \
paul@575 13
> out0.tmp
paul@575 14
paul@575 15
   grep -q 'METHOD:REPLY' out0.tmp \
paul@575 16
&& ! grep -q '^FREEBUSY' out0.tmp \
paul@575 17
&& echo "Success" \
paul@575 18
|| echo "Failed"
paul@575 19
paul@602 20
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR \
paul@585 21
| "$SHOWMAIL" \
paul@575 22
> out2.tmp
paul@575 23
paul@575 24
   grep -q 'METHOD:REPLY' out2.tmp \
paul@575 25
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
paul@575 26
&& echo "Success" \
paul@575 27
|| echo "Failed"
paul@575 28
paul@602 29
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 30
| "$SHOWMAIL" \
paul@575 31
> out3.tmp
paul@575 32
paul@575 33
   grep -q 'METHOD:REPLY' out3.tmp \
paul@575 34
&& [ `grep 'FREEBUSY;FBTYPE=BUSY' out3.tmp | wc -l` = '3' ] \
paul@575 35
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141212T090000Z/20141212T100000Z' out3.tmp \
paul@575 36
&& echo "Success" \
paul@575 37
|| echo "Failed"
paul@575 38
paul@602 39
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-instance.txt" 2>> $ERROR
paul@575 40
echo "Cancel..."
paul@575 41
paul@602 42
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 43
| "$SHOWMAIL" \
paul@575 44
> out4.tmp
paul@575 45
paul@575 46
   grep -q 'METHOD:REPLY' out4.tmp \
paul@575 47
&& [ `grep 'FREEBUSY;FBTYPE=BUSY' out4.tmp | wc -l` = '2' ] \
paul@575 48
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141114T090000Z/20141114T100000Z' out4.tmp \
paul@575 49
&& echo "Success" \
paul@575 50
|| echo "Failed"
paul@575 51
paul@602 52
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-reschedule-instance.txt" 2>> $ERROR \
paul@585 53
| "$SHOWMAIL" \
paul@575 54
> out5.tmp
paul@575 55
paul@575 56
   grep -q 'METHOD:REPLY' out5.tmp \
paul@575 57
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out5.tmp \
paul@575 58
&& echo "Success" \
paul@575 59
|| echo "Failed"
paul@575 60
paul@602 61
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 62
| "$SHOWMAIL" \
paul@575 63
> out6.tmp
paul@575 64
paul@575 65
   grep -q 'METHOD:REPLY' out6.tmp \
paul@575 66
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141011T080000Z/20141011T090000Z' out6.tmp \
paul@592 67
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141010T080000Z/20141010T090000Z' out6.tmp \
paul@575 68
&& echo "Success" \
paul@575 69
|| echo "Failed"
paul@575 70
paul@602 71
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR
paul@575 72
echo "Cancel..."
paul@575 73
paul@602 74
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 75
| "$SHOWMAIL" \
paul@575 76
> out7.tmp
paul@575 77
paul@575 78
   grep -q 'METHOD:REPLY' out7.tmp \
paul@575 79
&& ! grep -q '^FREEBUSY' out7.tmp \
paul@575 80
&& echo "Success" \
paul@575 81
|| echo "Failed"