3 if test -z "$MH_OBJ_DIR"; then
4 srcdir
=`dirname "$0"`/..
/..
5 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
8 .
"$MH_OBJ_DIR/test/common.sh"
10 # common.sh sets this to something crazy; did i do that?!
11 testname
=${0#$srcdir/}
13 setup_test_without_data Mail
16 #### Save exit status to use as status for this program.
22 [ -n "$imapd_pid" ] && kill $imapd_pid
23 "$MH_OBJ_DIR/target/debug/mhimap" imap shutdown
25 # TODO have cleanup allow additional cleanup registration?
26 # Or just allow it to accept status as argument.
32 covdir
="$MH_OBJ_DIR/covdata/${MH_COVERAGE_PROFILE:-default}/$testname"
34 export LLVM_PROFILE_FILE
="$covdir/$profile-%m.profraw"
36 imapd
="$MH_TEST_DIR/$$.imapd"
37 start_fakeinetd
"$imapd"
38 imapd_pid
=$fakeinetd_pid
42 imap-manager: $MH_OBJ_DIR/target/debug/imap-folder-manager
43 imap-socket: $MH_TEST_DIR/Mail/imap.d/socket
44 imap-db: $MH_TEST_DIR/Mail/imap.d
46 imap-port: $fakeinetd_port
47 imap-tls: don't protect my data i know what i'm doing
49 imap-mailbox-root: test/
51 if [ -n "$MH_TEST_IMAP_LOG_LEVEL" ]; then
52 echo "imap-log-level: $MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
53 echo "imap-log-$MH_TEST_IMAP_LOG_LEVEL-to: $MH_TEST_DIR/$profile/imap.d/log.$MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
56 expected
="$MH_TEST_DIR/$$.expected"
57 actual
="$MH_TEST_DIR/$$.actual"
59 start_test
'unrecoverable error: server closes connection mid-LIST-response'
61 cat > "$imapd" <<EOSCRIPT
64 * PREAUTH [CAPABILITY IMAP4REV1 UIDPLUS] authenticated
65 * LIST (\NoInferiors \UnMarked) "/" test/fold
71 # This is similar to but NOT THE SAME as EOF tests in test-login; those are during authentication, these are after.
73 cat > "$expected" <<EOF
74 inc: failed to inc folder imap: Received EOF on network
read
76 inc
+imap
> "$actual" 2>&1 || status
=$?
77 check
"$actual" "$expected"
78 (exit $status) && fail
'inc exited 0 on error'