imip-agent

tests/test_resource_invitation_add.sh

1058:bb1b8e13ef4d
2016-02-09 Paul Boddie Removed explicit confirmation and retraction function usage, instead employing scheduling functions to obtain confirmation, retraction, locking and unlocking functions, with each distinct invocation occurring only once.
     1 #!/bin/sh     2      3 . "`dirname \"$0\"`/common.sh"     4      5 USER="mailto:resource-room-confroom@example.com"     6 SENDER="mailto:paul.boddie@example.com"     7 FBFILE="$STORE/$USER/freebusy"     8 FBSENDERFILE="$STORE/$SENDER/freebusy"     9 FBSENDEROTHERFILE="$STORE/$SENDER/freebusy-other/$USER"    10     11 mkdir -p "$PREFS/$USER"    12 echo 'Europe/Oslo' > "$PREFS/$USER/TZID"    13 echo 'share' > "$PREFS/$USER/freebusy_sharing"    14     15 mkdir -p "$PREFS/$SENDER"    16 echo 'Europe/Oslo' > "$PREFS/$SENDER/TZID"    17 echo 'always' > "$PREFS/$SENDER/event_refreshing"    18     19 # Publish an event, testing registration in the outgoing handler.    20     21 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR    22     23    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \    24 && echo "Success" \    25 || echo "Failed"    26     27 # Present the request to the recipient.    28     29   "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR \    30 | "$SHOWMAIL" \    31 > out1.tmp    32     33    grep -q 'METHOD:REPLY' out1.tmp \    34 && echo "Success" \    35 || echo "Failed"    36     37    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \    38 && echo "Success" \    39 || echo "Failed"    40     41 # Present the response to the sender.    42     43   "$PERSON_SCRIPT" $ARGS < out1.tmp 2>> $ERROR \    44 | "$SHOWMAIL" \    45 > out2.tmp    46     47    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDEROTHERFILE" \    48 && echo "Success" \    49 || echo "Failed"    50     51 # Attempt to add an occurrence to the event.    52     53 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR    54     55    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDERFILE" \    56 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBSENDERFILE" \    57 && echo "Success" \    58 || echo "Failed"    59     60 # Present the request to the recipient.    61     62   "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-add-recurring.txt" 2>> $ERROR \    63 | "$SHOWMAIL" \    64 > out3.tmp    65     66    grep -q 'METHOD:REFRESH' out3.tmp \    67 && echo "Success" \    68 || echo "Failed"    69     70    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \    71 && ! grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \    72 && echo "Success" \    73 || echo "Failed"    74     75 # Present the refresh message to the organiser.    76     77   "$PERSON_SCRIPT" $ARGS < out3.tmp 2>> $ERROR \    78 | tee out4r.tmp \    79 | "$SHOWMAIL" \    80 > out4.tmp    81     82    grep -q 'METHOD:REQUEST' out4.tmp \    83 && echo "Success" \    84 || echo "Failed"    85     86 # Present the request to the recipient.    87     88   "$RESOURCE_SCRIPT" $ARGS < out4r.tmp 2>> $ERROR \    89 | tee out5r.tmp \    90 | "$SHOWMAIL" \    91 > out5.tmp    92     93    grep -q 'METHOD:REPLY' out5.tmp \    94 && echo "Success" \    95 || echo "Failed"    96     97    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \    98 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBFILE" \    99 && echo "Success" \   100 || echo "Failed"   101    102 # Present the response to the sender.   103    104   "$PERSON_SCRIPT" $ARGS < out5r.tmp 2>> $ERROR \   105 | "$SHOWMAIL" \   106 > out6.tmp   107    108    grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBSENDEROTHERFILE" \   109 && grep -q "^20150109T090000Z${TAB}20150109T100000Z" "$FBSENDEROTHERFILE" \   110 && echo "Success" \   111 || echo "Failed"