imip-agent

Annotated tests/test_resource_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@565 1
#!/bin/sh
paul@565 2
paul@565 3
THIS_DIR=`dirname $0`
paul@565 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@565 8
STORE=/tmp/store
paul@565 9
STATIC=/tmp/static
paul@640 10
PREFS=/tmp/prefs
paul@640 11
ARGS="-S $STORE -P $STATIC -p $PREFS -d"
paul@640 12
USER="mailto:resource-room-confroom@example.com"
paul@602 13
ERROR=err.tmp
paul@565 14
paul@565 15
rm -r $STORE
paul@565 16
rm -r $STATIC
paul@640 17
rm -r $PREFS
paul@602 18
rm $ERROR
paul@602 19
rm out*.tmp
paul@565 20
paul@640 21
mkdir -p "$PREFS/$USER"
paul@640 22
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@640 23
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@640 24
paul@602 25
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 26
| "$SHOWMAIL" \
paul@568 27
> out0.tmp
paul@568 28
paul@568 29
   grep -q 'METHOD:REPLY' out0.tmp \
paul@575 30
&& ! grep -q '^FREEBUSY' out0.tmp \
paul@568 31
&& echo "Success" \
paul@568 32
|| echo "Failed"
paul@568 33
paul@602 34
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@585 35
| "$SHOWMAIL" \
paul@565 36
> out1.tmp
paul@565 37
paul@565 38
   grep -q 'METHOD:REPLY' out1.tmp \
paul@575 39
&& ! grep -q '^FREEBUSY' out1.tmp \
paul@565 40
&& echo "Success" \
paul@565 41
|| echo "Failed"
paul@565 42
paul@602 43
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request.txt" 2>> $ERROR \
paul@585 44
| "$SHOWMAIL" \
paul@565 45
> out2.tmp
paul@565 46
paul@565 47
   grep -q 'METHOD:REPLY' out2.tmp \
paul@565 48
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
paul@565 49
&& echo "Success" \
paul@565 50
|| echo "Failed"
paul@565 51
paul@602 52
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@585 53
| "$SHOWMAIL" \
paul@565 54
> out3.tmp
paul@565 55
paul@565 56
   grep -q 'METHOD:REPLY' out3.tmp \
paul@565 57
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out3.tmp \
paul@565 58
&& echo "Success" \
paul@565 59
|| echo "Failed"
paul@565 60
paul@602 61
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-conflict.txt" 2>> $ERROR \
paul@585 62
| "$SHOWMAIL" \
paul@565 63
> out4.tmp
paul@565 64
paul@565 65
   grep -q 'METHOD:REPLY' out4.tmp \
paul@565 66
&& grep -q 'ATTENDEE;PARTSTAT=DECLINED' out4.tmp \
paul@565 67
&& echo "Success" \
paul@565 68
|| echo "Failed"
paul@566 69
paul@615 70
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-conflict-utc.txt" 2>> $ERROR \
paul@585 71
| "$SHOWMAIL" \
paul@566 72
> out5.tmp
paul@566 73
paul@566 74
   grep -q 'METHOD:REPLY' out5.tmp \
paul@615 75
&& grep -q 'ATTENDEE;PARTSTAT=DECLINED' out5.tmp \
paul@615 76
&& echo "Success" \
paul@615 77
|| echo "Failed"
paul@615 78
paul@615 79
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@615 80
| "$SHOWMAIL" \
paul@615 81
> out6.tmp
paul@615 82
paul@615 83
   grep -q 'METHOD:REPLY' out6.tmp \
paul@615 84
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out6.tmp \
paul@615 85
&& [ `grep 'FREEBUSY;FBTYPE=BUSY' out6.tmp | wc -l` = '1' ] \
paul@566 86
&& echo "Success" \
paul@566 87
|| echo "Failed"
paul@566 88
paul@602 89
"$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel.txt" 2>> $ERROR
paul@570 90
echo "Cancel..."
paul@566 91
paul@602 92
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@585 93
| "$SHOWMAIL" \
paul@615 94
> out7.tmp
paul@566 95
paul@615 96
   grep -q 'METHOD:REPLY' out7.tmp \
paul@615 97
&& ! grep -q '^FREEBUSY' out7.tmp \
paul@566 98
&& echo "Success" \
paul@566 99
|| echo "Failed"
paul@568 100
paul@602 101
"$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-spoofed.txt" 2>> $ERROR
paul@570 102
echo "Spoof..."
paul@568 103
paul@602 104
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@585 105
| "$SHOWMAIL" \
paul@615 106
> out8.tmp
paul@568 107
paul@615 108
   grep -q 'METHOD:REPLY' out8.tmp \
paul@615 109
&& ! grep -q '^FREEBUSY' out8.tmp \
paul@570 110
&& echo "Success" \
paul@570 111
|| echo "Failed"