imip-agent

Annotated tests/test_resource_invitation_recurring_indefinitely.sh

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