imip-agent

tests/test_outgoing_invitation.sh

1023:8fff9da40e5d
2016-01-29 Paul Boddie Fixed translated message for unshared events.
     1 #!/bin/sh     2      3 THIS_DIR=`dirname $0`     4      5 TEMPLATES="$THIS_DIR/templates"     6 OUTGOING_SCRIPT="$THIS_DIR/../imip_person_outgoing.py"     7 SHOWMAIL="$THIS_DIR/../tools/showmail.py"     8 STORE=/tmp/store     9 STATIC=/tmp/static    10 PREFS=/tmp/prefs    11 ARGS="-S $STORE -P $STATIC -p $PREFS -d"    12 USER="mailto:paul.boddie@example.com"    13 FBFILE="$STORE/$USER/freebusy"    14 TAB=`printf '\t'`    15 ERROR=err.tmp    16     17 rm -rf $STORE    18 rm -rf $STATIC    19 rm -rf $PREFS    20 rm -f $ERROR    21 rm -f out*.tmp    22     23 mkdir -p "$PREFS/$USER"    24 echo 'Europe/Oslo' > "$PREFS/$USER/TZID"    25 echo 'share' > "$PREFS/$USER/freebusy_sharing"    26     27 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request.txt" 2>> $ERROR    28 cp "$FBFILE" out1.tmp    29     30    grep -q "^20141126T150000Z${TAB}20141126T160000Z" "$FBFILE" \    31 && echo "Success" \    32 || echo "Failed"    33     34 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel.txt" 2>> $ERROR    35 echo "Cancel..."    36 cp "$FBFILE" out2.tmp    37     38    ! grep -q '^2' "$FBFILE" \    39 && echo "Success" \    40 || echo "Failed"    41     42 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR    43 cp "$FBFILE" out3.tmp    44     45    [ `cat "$FBFILE" | wc -l` = '3' ] \    46 && grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \    47 && echo "Success" \    48 || echo "Failed"    49     50 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-instance.txt" 2>> $ERROR    51 cp "$FBFILE" out4.tmp    52     53    [ `cat "$FBFILE" | wc -l` = '2' ] \    54 && ! grep -q "^20141114T090000Z${TAB}20141114T100000Z" "$FBFILE" \    55 && echo "Success" \    56 || echo "Failed"    57     58 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-reschedule-instance.txt" 2>> $ERROR    59 cp "$FBFILE" out5.tmp    60     61    grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBFILE" \    62 && ! grep -q "^20141010T090000Z${TAB}20141010T100000Z" "$FBFILE" \    63 && echo "Success" \    64 || echo "Failed"    65     66 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR    67 cp "$FBFILE" out6.tmp    68     69    ! grep -q '^2' "$FBFILE" \    70 && echo "Success" \    71 || echo "Failed"    72     73 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-day.txt" 2>> $ERROR    74 cp "$FBFILE" out7.tmp    75     76    [ `cat "$FBFILE" | wc -l` = '3' ] \    77 && grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \    78 && echo "Success" \    79 || echo "Failed"    80     81 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-day.txt" 2>> $ERROR    82 cp "$FBFILE" out8.tmp    83     84    ! grep -q '^2' "$FBFILE" \    85 && echo "Success" \    86 || echo "Failed"    87     88 # Switch time zones.    89     90 echo 'Europe/Mariehamn' > "$PREFS/$USER/TZID"    91     92 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring.txt" 2>> $ERROR    93 cp "$FBFILE" out9.tmp    94     95    [ `cat "$FBFILE" | wc -l` = '3' ] \    96 && grep -q "^20141212T090000Z${TAB}20141212T100000Z" "$FBFILE" \    97 && echo "Success" \    98 || echo "Failed"    99    100 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring.txt" 2>> $ERROR   101 cp "$FBFILE" out10.tmp   102    103    ! grep -q '^2' "$FBFILE" \   104 && echo "Success" \   105 || echo "Failed"   106    107 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-recurring-day.txt" 2>> $ERROR   108 cp "$FBFILE" out11.tmp   109    110    [ `cat "$FBFILE" | wc -l` = '3' ] \   111 && grep -q "^20141211T230000Z${TAB}20141212T230000Z" "$FBFILE" \   112 && echo "Success" \   113 || echo "Failed"   114    115 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-recurring-day.txt" 2>> $ERROR   116 cp "$FBFILE" out12.tmp   117    118    ! grep -q '^2' "$FBFILE" \   119 && echo "Success" \   120 || echo "Failed"