imip-agent

tests/test_resource_invitation_imposter.sh

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