imip-agent

tests/test_person_invitation.sh

1292:8a08870781bb
2017-10-06 Paul Boddie Remove SENT-BY from attributes where the sender matches the user. Simplify get_timestamp, making it use get_time.
     1 #!/bin/sh     2      3 . "`dirname \"$0\"`/common.sh"     4      5 USER="mailto:vincent.vole@example.com"     6 SENDER="mailto:paul.boddie@example.com"     7      8 mkdir -p "$PREFS/$USER"     9 echo 'Europe/Oslo' > "$PREFS/$USER/TZID"    10 echo 'share' > "$PREFS/$USER/freebusy_sharing"    11     12   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-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   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person.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   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person.txt" 2>> $ERROR \    31 | "$SHOWMAIL" \    32 > out2.tmp    33     34    ! grep -q 'METHOD:REPLY' out2.tmp \    35 && echo "Success" \    36 || echo "Failed"    37     38    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    39 >  out2f.tmp    40     41    ! grep -q "^20141126T150000Z${TAB}20141126T160000Z" "out2f.tmp" \    42 && echo "Success" \    43 || echo "Failed"    44     45    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \    46 >  out2fo.tmp    47     48    grep -q "^20141126T150000Z${TAB}20141126T160000Z" "out2fo.tmp" \    49 && echo "Success" \    50 || echo "Failed"    51     52   "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" "event6@example.com" 2>> $ERROR \    53 | tee out3.tmp \    54 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR    55     56    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    57 >  out3f.tmp    58     59    grep -q "^20141126T150000Z${TAB}20141126T160000Z" "out3f.tmp" \    60 && echo "Success" \    61 || echo "Failed"    62     63   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-conflict.txt" 2>> $ERROR \    64 | "$SHOWMAIL" \    65 > out4.tmp    66     67    ! grep -q 'METHOD:REPLY' out4.tmp \    68 && echo "Success" \    69 || echo "Failed"    70     71    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    72 >  out4f.tmp    73     74    ! grep -q "event7@example.com" "out4f.tmp" \    75 && echo "Success" \    76 || echo "Failed"    77     78    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \    79 >  out4fo.tmp    80     81    grep -q "event7@example.com" "out4fo.tmp" \    82 && echo "Success" \    83 || echo "Failed"    84     85   "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "event7@example.com" 2>> $ERROR \    86 | tee out5.tmp \    87 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR    88     89    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    90 >  out5f.tmp    91     92    grep -q "event6@example.com" "out5f.tmp" \    93 && ! grep -q "event7@example.com" "out5f.tmp" \    94 && echo "Success" \    95 || echo "Failed"    96     97   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person.txt" 2>> $ERROR \    98 | "$SHOWMAIL" \    99 > out6.tmp   100    101    ! grep -q 'METHOD:REPLY' out6.tmp \   102 && echo "Success" \   103 || echo "Failed"   104    105    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \   106 >  out6f.tmp   107    108    ! grep -q "event6@example.com" "out6f.tmp" \   109 && echo "Success" \   110 || echo "Failed"   111    112    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \   113 >  out6fo.tmp   114    115    grep -q "event6@example.com" "out6fo.tmp" \   116 && echo "Success" \   117 || echo "Failed"   118    119   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-all.txt" 2>> $ERROR \   120 | "$SHOWMAIL" \   121 > out7.tmp   122    123    ! grep -q 'METHOD:REPLY' out7.tmp \   124 && echo "Success" \   125 || echo "Failed"   126    127    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \   128 >  out7f.tmp   129    130    ! grep -q "event6@example.com" "out7f.tmp" \   131 && echo "Success" \   132 || echo "Failed"   133    134    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \   135 >  out7fo.tmp   136    137    ! grep -q "event6@example.com" "out7fo.tmp" \   138 && echo "Success" \   139 || echo "Failed"   140    141   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-spoofed.txt" 2>> $ERROR \   142 | "$SHOWMAIL" \   143 > out8.tmp   144    145    ! grep -q 'METHOD:REPLY' out8.tmp \   146 && echo "Success" \   147 || echo "Failed"   148    149    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \   150 >  out8f.tmp   151    152    ! grep -q "spoof2@example.com" "out8f.tmp" \   153 && echo "Success" \   154 || echo "Failed"   155    156    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \   157 >  out8fo.tmp   158    159    ! grep -q "spoof2@example.com" "out8fo.tmp" \   160 && echo "Success" \   161 || echo "Failed"