imip-agent

Annotated tests/test_multiple_invitation.sh

787:9cf10fe21c3a
2015-09-28 Paul Boddie Separated attendee/recurrence manipulation from presentation, introducing form field dictionary updates from form period/date objects, also simplifying the processing of attendees, removing filtering operations during editing. imipweb-client-simplification
paul@573 1
#!/bin/sh
paul@573 2
paul@573 3
THIS_DIR=`dirname $0`
paul@573 4
paul@585 5
TEMPLATES="$THIS_DIR/templates"
paul@585 6
RESOURCE_SCRIPT="$THIS_DIR/../imip_resource.py"
paul@585 7
SHOWMAIL="$THIS_DIR/../tools/showmail.py"
paul@573 8
STORE=/tmp/store
paul@573 9
STATIC=/tmp/static
paul@640 10
PREFS=/tmp/prefs
paul@640 11
ARGS="-S $STORE -P $STATIC -p $PREFS -d"
paul@644 12
ROOM="mailto:resource-room-confroom@example.com"
paul@644 13
CAR="mailto:resource-car-porsche911@example.com"
paul@602 14
ERROR=err.tmp
paul@573 15
paul@573 16
rm -r $STORE
paul@573 17
rm -r $STATIC
paul@640 18
rm -r $PREFS
paul@602 19
rm $ERROR
paul@602 20
rm out*.tmp
paul@573 21
paul@644 22
mkdir -p "$PREFS/$ROOM"
paul@644 23
echo 'Europe/Oslo' > "$PREFS/$ROOM/TZID"
paul@644 24
echo 'share' > "$PREFS/$ROOM/freebusy_sharing"
paul@644 25
paul@644 26
mkdir -p "$PREFS/$CAR"
paul@644 27
echo 'Europe/Mariehamn' > "$PREFS/$CAR/TZID"
paul@644 28
echo 'share' > "$PREFS/$CAR/freebusy_sharing"
paul@640 29
paul@602 30
  "$RESOURCE_SCRIPT" $ARGS < $TEMPLATES/fb-request-all.txt 2>> $ERROR \
paul@585 31
| "$SHOWMAIL" \
paul@573 32
> out0.tmp
paul@573 33
paul@573 34
   grep -q 'METHOD:REPLY' out0.tmp \
paul@575 35
&& ! grep -q '^FREEBUSY' out0.tmp \
paul@573 36
&& echo "Success" \
paul@573 37
|| echo "Failed"
paul@573 38
paul@602 39
  "$RESOURCE_SCRIPT" $ARGS < $TEMPLATES/fb-request.txt 2>> $ERROR \
paul@585 40
| "$SHOWMAIL" \
paul@573 41
> out1.tmp
paul@573 42
paul@573 43
   grep -q 'METHOD:REPLY' out1.tmp \
paul@575 44
&& ! grep -q '^FREEBUSY' out1.tmp \
paul@573 45
&& echo "Success" \
paul@573 46
|| echo "Failed"
paul@573 47
paul@602 48
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/event-request-multiple.txt" 2>> $ERROR \
paul@585 49
| "$SHOWMAIL" \
paul@573 50
> out2.tmp
paul@573 51
paul@573 52
   grep -q 'METHOD:REPLY' out2.tmp \
paul@573 53
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
paul@573 54
&& echo "Success" \
paul@573 55
|| echo "Failed"
paul@573 56
paul@602 57
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/event-request-multiple.txt" 2>> $ERROR \
paul@585 58
| "$SHOWMAIL" \
paul@573 59
> out3.tmp
paul@573 60
paul@573 61
   grep -q 'METHOD:REPLY' out3.tmp \
paul@573 62
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out3.tmp \
paul@573 63
&& echo "Success" \
paul@573 64
|| echo "Failed"
paul@573 65
paul@602 66
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@585 67
| "$SHOWMAIL" \
paul@573 68
> out4.tmp
paul@573 69
paul@573 70
   grep -q 'METHOD:REPLY' out4.tmp \
paul@573 71
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out4.tmp \
paul@573 72
&& echo "Success" \
paul@573 73
|| echo "Failed"
paul@573 74
paul@602 75
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/fb-request-car.txt" 2>> $ERROR \
paul@585 76
| "$SHOWMAIL" \
paul@573 77
> out5.tmp
paul@573 78
paul@573 79
   grep -q 'METHOD:REPLY' out5.tmp \
paul@573 80
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out5.tmp \
paul@573 81
&& echo "Success" \
paul@573 82
|| echo "Failed"
paul@573 83
paul@602 84
"$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-multiple-attendee.txt" 2>> $ERROR
paul@573 85
echo "Cancel..."
paul@573 86
paul@602 87
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-room-confroom@example.com' < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@585 88
| "$SHOWMAIL" \
paul@573 89
> out6.tmp
paul@573 90
paul@573 91
   grep -q 'METHOD:REPLY' out6.tmp \
paul@575 92
&& ! grep -q '^FREEBUSY' out6.tmp \
paul@573 93
&& echo "Success" \
paul@573 94
|| echo "Failed"
paul@573 95
paul@602 96
  "$RESOURCE_SCRIPT" $ARGS -o 'resource-car-porsche911@example.com' < "$TEMPLATES/fb-request-car.txt" 2>> $ERROR \
paul@585 97
| "$SHOWMAIL" \
paul@573 98
> out7.tmp
paul@573 99
paul@573 100
   grep -q 'METHOD:REPLY' out7.tmp \
paul@573 101
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out7.tmp \
paul@573 102
&& echo "Success" \
paul@573 103
|| echo "Failed"