imip-agent

tests/test_person_non_participation.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:vincent.vole@example.com"     6 IMPOSTER="mailto:oliver.otter@example.com"     7 SENDER="mailto:paul.boddie@example.com"     8      9 mkdir -p "$PREFS/$USER"    10 echo 'no' > "$PREFS/$USER/participating"    11     12 mkdir -p "$PREFS/$SENDER"    13 echo 'yes' > "$PREFS/$SENDER/participating"    14     15   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-request-person-all.txt" 2>> $ERROR \    16 | "$SHOWMAIL" \    17 > out0.tmp    18     19    ! grep -q 'METHOD:REPLY' out0.tmp \    20 && echo "Success" \    21 || echo "Failed"    22     23 # Show the request to the outgoing handler first.    24     25 "$OUTGOING_SCRIPT" < "$TEMPLATES/event-request-person.txt" $ARGS 2>> $ERROR    26     27    "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "object" "event6@example.com" \    28 >  out0O.tmp    29     30    grep -q "event6@example.com" "out0O.tmp" \    31 && echo "Success" \    32 || echo "Failed"    33     34 # Send a request to the recipient.    35     36   "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-request-person.txt" 2>> $ERROR \    37 | "$SHOWMAIL" \    38 > out2.tmp    39     40    ! grep -q 'METHOD:REPLY' out2.tmp \    41 && echo "Success" \    42 || echo "Failed"    43     44    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    45 >  out2f.tmp    46     47    ! grep -q "event6@example.com" "out2f.tmp" \    48 && echo "Success" \    49 || echo "Failed"    50     51    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy_other" "$SENDER" \    52 >  out2s.tmp    53     54    ! grep -q "event6@example.com" "out2s.tmp" \    55 && echo "Success" \    56 || echo "Failed"    57     58 # Make sure that the recipient ignored it.    59     60   "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER" < "$TEMPLATES/event-request-person-object.txt" 2>> $ERROR \    61 | tee out3.tmp \    62 | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR    63     64    "$LIST_SCRIPT" $LIST_ARGS "$USER" "freebusy" \    65 >  out2f.tmp    66     67    ! grep -q "^20141126T150000Z${TAB}20141126T160000Z" "out2f.tmp" \    68 && echo "Success" \    69 || echo "Failed"    70     71 # Now see if an imposter can invite themself to the event.    72     73   "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$IMPOSTER" < "$TEMPLATES/event-request-person-imposter-object.txt" 2>> $ERROR \    74 | tee out4.tmp \    75 | "$PERSON_SCRIPT" $ARGS 2>> $ERROR \    76 | "$SHOWMAIL" \    77 > out5.tmp    78     79    "$LIST_SCRIPT" $LIST_ARGS "$USER" "object" "event6@example.com" \    80 >  out5O.tmp    81     82    ! grep -q "otter" "out5O.tmp" \    83 && echo "Success" \    84 || echo "Failed"    85     86    "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$IMPOSTER" \    87 >  out5s.tmp    88     89    ! grep -q "^20141126T150000Z${TAB}20141126T160000Z" "out5s.tmp" \    90 && echo "Success" \    91 || echo "Failed"