imip-agent

Annotated tests/test_resource_invitation_imposter.sh

1069:37921ab84c01
2016-03-06 Paul Boddie Moved imip_store into a new imiptools.stores package as the file module.
paul@728 1
#!/bin/sh
paul@728 2
paul@1024 3
. "`dirname \"$0\"`/common.sh"
paul@728 4
paul@728 5
USER="mailto:resource-room-confroom@example.com"
paul@728 6
paul@728 7
mkdir -p "$PREFS/$USER"
paul@728 8
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@728 9
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@728 10
echo 'never' > "$PREFS/$USER/organiser_replacement"
paul@728 11
paul@728 12
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
paul@728 13
| "$SHOWMAIL" \
paul@728 14
> out0.tmp
paul@728 15
paul@728 16
   grep -q 'METHOD:REPLY' out0.tmp \
paul@728 17
&& ! grep -q '^FREEBUSY' out0.tmp \
paul@728 18
&& echo "Success" \
paul@728 19
|| echo "Failed"
paul@728 20
paul@728 21
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 22
| "$SHOWMAIL" \
paul@728 23
> out1.tmp
paul@728 24
paul@728 25
   grep -q 'METHOD:REPLY' out1.tmp \
paul@728 26
&& ! grep -q '^FREEBUSY' out1.tmp \
paul@728 27
&& echo "Success" \
paul@728 28
|| echo "Failed"
paul@728 29
paul@728 30
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request.txt" 2>> $ERROR \
paul@728 31
| "$SHOWMAIL" \
paul@728 32
> out2.tmp
paul@728 33
paul@728 34
   grep -q 'METHOD:REPLY' out2.tmp \
paul@728 35
&& grep -q 'ATTENDEE;PARTSTAT=ACCEPTED' out2.tmp \
paul@728 36
&& echo "Success" \
paul@728 37
|| echo "Failed"
paul@728 38
paul@728 39
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 40
| "$SHOWMAIL" \
paul@728 41
> out3.tmp
paul@728 42
paul@728 43
   grep -q 'METHOD:REPLY' out3.tmp \
paul@728 44
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out3.tmp \
paul@728 45
&& echo "Success" \
paul@728 46
|| echo "Failed"
paul@728 47
paul@728 48
# Try to change to an unrecognised organiser.
paul@728 49
paul@728 50
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter.txt" 2>> $ERROR \
paul@728 51
| "$SHOWMAIL" \
paul@728 52
> out4.tmp
paul@728 53
paul@728 54
   ! grep -q 'METHOD:REPLY' out4.tmp \
paul@728 55
&& echo "Success" \
paul@728 56
|| echo "Failed"
paul@728 57
paul@728 58
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 59
| "$SHOWMAIL" \
paul@728 60
> out5.tmp
paul@728 61
paul@728 62
   grep -q 'METHOD:REPLY' out5.tmp \
paul@728 63
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out5.tmp \
paul@728 64
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out5.tmp \
paul@728 65
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out5.tmp \
paul@728 66
&& echo "Success" \
paul@728 67
|| echo "Failed"
paul@728 68
paul@728 69
# Try to change to an attendee as organiser.
paul@728 70
paul@728 71
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter-attendee.txt" 2>> $ERROR \
paul@728 72
| "$SHOWMAIL" \
paul@728 73
> out6.tmp
paul@728 74
paul@728 75
   ! grep -q 'METHOD:REPLY' out6.tmp \
paul@728 76
&& echo "Success" \
paul@728 77
|| echo "Failed"
paul@728 78
paul@728 79
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 80
| "$SHOWMAIL" \
paul@728 81
> out7.tmp
paul@728 82
paul@728 83
   grep -q 'METHOD:REPLY' out7.tmp \
paul@728 84
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out7.tmp \
paul@728 85
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out7.tmp \
paul@728 86
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out7.tmp \
paul@728 87
&& echo "Success" \
paul@728 88
|| echo "Failed"
paul@728 89
paul@728 90
# Change the policy.
paul@728 91
paul@728 92
echo 'attendee' > "$PREFS/$USER/organiser_replacement"
paul@728 93
paul@728 94
# Try to change to an attendee as organiser.
paul@728 95
paul@728 96
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter-attendee.txt" 2>> $ERROR \
paul@728 97
| "$SHOWMAIL" \
paul@728 98
> out8.tmp
paul@728 99
paul@728 100
   grep -q 'METHOD:REPLY' out8.tmp \
paul@728 101
&& echo "Success" \
paul@728 102
|| echo "Failed"
paul@728 103
paul@728 104
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 105
| "$SHOWMAIL" \
paul@728 106
> out9.tmp
paul@728 107
paul@728 108
   grep -q 'METHOD:REPLY' out9.tmp \
paul@728 109
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out9.tmp \
paul@728 110
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out9.tmp \
paul@728 111
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out9.tmp \
paul@728 112
&& echo "Success" \
paul@728 113
|| echo "Failed"
paul@728 114
paul@728 115
# Try to change to an unrecognised organiser.
paul@728 116
paul@728 117
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter.txt" 2>> $ERROR \
paul@728 118
| "$SHOWMAIL" \
paul@728 119
> out10.tmp
paul@728 120
paul@728 121
   ! grep -q 'METHOD:REPLY' out10.tmp \
paul@728 122
&& echo "Success" \
paul@728 123
|| echo "Failed"
paul@728 124
paul@728 125
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 126
| "$SHOWMAIL" \
paul@728 127
> out11.tmp
paul@728 128
paul@728 129
   grep -q 'METHOD:REPLY' out11.tmp \
paul@728 130
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out11.tmp \
paul@728 131
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out11.tmp \
paul@728 132
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out11.tmp \
paul@728 133
&& echo "Success" \
paul@728 134
|| echo "Failed"
paul@728 135
paul@728 136
# Change the policy.
paul@728 137
paul@728 138
echo 'any' > "$PREFS/$USER/organiser_replacement"
paul@728 139
paul@728 140
# Try to change to an unrecognised organiser.
paul@728 141
paul@728 142
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter.txt" 2>> $ERROR \
paul@728 143
| "$SHOWMAIL" \
paul@728 144
> out12.tmp
paul@728 145
paul@728 146
   grep -q 'METHOD:REPLY' out12.tmp \
paul@728 147
&& echo "Success" \
paul@728 148
|| echo "Failed"
paul@728 149
paul@728 150
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 151
| "$SHOWMAIL" \
paul@728 152
> out13.tmp
paul@728 153
paul@728 154
   grep -q 'METHOD:REPLY' out13.tmp \
paul@728 155
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out13.tmp \
paul@728 156
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out13.tmp \
paul@728 157
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out13.tmp \
paul@728 158
&& echo "Success" \
paul@728 159
|| echo "Failed"
paul@728 160
paul@728 161
# Try to change to an attendee as organiser.
paul@728 162
paul@728 163
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-imposter-attendee.txt" 2>> $ERROR \
paul@728 164
| "$SHOWMAIL" \
paul@728 165
> out14.tmp
paul@728 166
paul@728 167
   grep -q 'METHOD:REPLY' out14.tmp \
paul@728 168
&& echo "Success" \
paul@728 169
|| echo "Failed"
paul@728 170
paul@728 171
  "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
paul@728 172
| "$SHOWMAIL" \
paul@728 173
> out15.tmp
paul@728 174
paul@728 175
   grep -q 'METHOD:REPLY' out15.tmp \
paul@728 176
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out15.tmp \
paul@728 177
&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T160000Z' out15.tmp \
paul@728 178
&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out15.tmp \
paul@728 179
&& echo "Success" \
paul@728 180
|| echo "Failed"