]> diplodocus.org Git - nmh/blobdiff - test/inc/test-pop
readline(3) wrapper: Move free(3) of line to where it's reachable.
[nmh] / test / inc / test-pop
index 73c31a87d972234125f1db072d8d0f7f29ff7419..64620173fb4e09907b364435f807a6663cad6708 100755 (executable)
@@ -24,7 +24,7 @@ setup_test
 
 TESTUSER=testuser
 TESTPASS=testuserpass
-arith_eval 64001 + `id -u` % 1000
+arith_eval 64001 + $$ % 1000
 testport=$arith_val
 
 HOME="${MH_TEST_DIR}"; export HOME
@@ -70,13 +70,22 @@ Date: Tuesday, 19 Dec 2006 4:15:16 -0500
 Dude, nmh is totally brutal.
 EOM
 
+# Check netrc's permissions test
+pid=`"${MH_OBJ_DIR}/test/fakepop" "$testport" '' '' "$testmessage"`
+chmod g=w,o=x $netrc
+run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport" \
+        "inc: group or other permissions, 0100621, forbidden: $netrc
+inc: Remove password or correct file permissions."
+chmod go= $netrc
+
 pid=`"${MH_OBJ_DIR}/test/fakepop" "$testport" \
                        "$TESTUSER" "$TESTPASS" "$testmessage"`
 
 run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 80" \
        "Incorporating new mail into inbox...
 
-  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
+  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do\
+i"
 check "$testmessage" `mhpath +inbox 11` 'keep first'
 
 # Check multiple messages at once
@@ -88,31 +97,15 @@ pid=`"${MH_OBJ_DIR}/test/fakepop" "$testport" \
 run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 80" \
        "Incorporating new mail into inbox...
 
-  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do
-  12  12/18 A Real User        Anything new?<<What's been happening at your pla
+  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're doi
+  12  12/18 A Real User        Anything new?<<What's been happening at your plac
   13  12/19 Nathan Explosion   Brutal<<Dude, nmh is totally brutal. >>"
 
 check "$testmessage" `mhpath +inbox 11` 'keep first'
 check "${testmessage}.2" `mhpath +inbox 12`
 check "${testmessage}.3" `mhpath +inbox 13`
 
-# check -pack
-pid=`"${MH_OBJ_DIR}/test/fakepop" "$testport" \
-                       "$TESTUSER" "$TESTPASS" "$testmessage"`
-
-touch "$MH_TEST_DIR/inc.mbox"
-run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 80 \
-          -pack $MH_TEST_DIR/inc.mbox" \
-       "Incorporating new mail into (null)...
-
-   1  12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
-run_test "inc -file $MH_TEST_DIR/inc.mbox -truncate -width 80" \
-       "Incorporating new mail into inbox...
-
-  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
-
-check $testmessage `mhpath +inbox 11` 'keep first'
-rm -f "$MH_TEST_DIR/inc.mbox" "$MH_TEST_DIR/.inc.map" "$netrc"
+rm -f "$netrc"
 
 # check credentials: file
 # Redirect stdin so that inc doesn't wait on the user if it can't
@@ -128,18 +121,12 @@ echo "credentials: file:${netrc}" >>$MH
 pid=`"${MH_OBJ_DIR}/test/fakepop" "$testport" \
                        "$TESTUSER" "$TESTPASS" "$testmessage"`
 
-touch "$MH_TEST_DIR/inc.mbox"
-run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 65 \
-          -pack $MH_TEST_DIR/inc.mbox" \
-       "Incorporating new mail into (null)...
-
-   1  12/17 No Such User       Hello<<Hey man, how's it going? ." </dev/null
-run_test "inc -file $MH_TEST_DIR/inc.mbox -truncate -width 65" \
+run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 65" \
        "Incorporating new mail into inbox...
 
-  11+ 12/17 No Such User       Hello<<Hey man, how's it going? ." </dev/null
-
+  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . " </dev/null
 check $testmessage `mhpath +inbox 11`
-rm -f "$MH_TEST_DIR/inc.mbox" "$MH_TEST_DIR/.inc.map" "$netrc"
+
+rm -f "$netrc"
 
 exit ${failed:-0}