summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2003-01-10 07:52:42 +0000
committerDamien Miller <djm@cvs.openbsd.org>2003-01-10 07:52:42 +0000
commit4f0174b87e1e508611d45cb09b7327ff612d355f (patch)
tree5185b766234552e1f62001b9ce54bc8a94602f38 /regress/usr.bin/ssh
parent03cefdb67af77946732278e9f64ee48e96753fb7 (diff)
Cleanup before use (would break if run after t-sftp), less console spam
Diffstat (limited to 'regress/usr.bin/ssh')
-rw-r--r--regress/usr.bin/ssh/sftp-batch.sh18
-rw-r--r--regress/usr.bin/ssh/sftp-cmds.sh57
2 files changed, 48 insertions, 27 deletions
diff --git a/regress/usr.bin/ssh/sftp-batch.sh b/regress/usr.bin/ssh/sftp-batch.sh
index 03e15f833e4..cffacb6df1c 100644
--- a/regress/usr.bin/ssh/sftp-batch.sh
+++ b/regress/usr.bin/ssh/sftp-batch.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: sftp-batch.sh,v 1.1 2003/01/08 23:54:22 djm Exp $
+# $OpenBSD: sftp-batch.sh,v 1.2 2003/01/10 07:52:41 djm Exp $
# Placed in the Public Domain.
tid="sftp batchfile"
@@ -7,7 +7,7 @@ DATA=/bin/ls
COPY=${OBJ}/copy
BATCH=${OBJ}/sftp-batch
-rm -rf ${COPY} ${COPY}.* ${BATCH}.*
+rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
cat << EOF > ${BATCH}.pass.1
get $DATA $COPY
@@ -37,17 +37,21 @@ cat << EOF > ${BATCH}.fail.2
EOF
verbose "$tid: good commands"
-${SFTP} -b ${BATCH}.pass.1 -P ${SFTPSERVER} || fail "good commands failed"
+${SFTP} -b ${BATCH}.pass.1 -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "good commands failed"
verbose "$tid: bad commands"
-${SFTP} -b ${BATCH}.fail.1 -P ${SFTPSERVER} && fail "bad commands succeeded"
+${SFTP} -b ${BATCH}.fail.1 -P ${SFTPSERVER} >/dev/null 2>&1 \
+ && fail "bad commands succeeded"
verbose "$tid: comments and blanks"
-${SFTP} -b ${BATCH}.pass.2 -P ${SFTPSERVER} || fail "comments & blanks failed"
+${SFTP} -b ${BATCH}.pass.2 -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "comments & blanks failed"
verbose "$tid: junk command"
-${SFTP} -b ${BATCH}.fail.2 -P ${SFTPSERVER} && fail "junk command succeeded"
+${SFTP} -b ${BATCH}.fail.2 -P ${SFTPSERVER} >/dev/null 2>&1 \
+ && fail "junk command succeeded"
-rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd
+rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
diff --git a/regress/usr.bin/ssh/sftp-cmds.sh b/regress/usr.bin/ssh/sftp-cmds.sh
index 94852517fcb..462c6802f41 100644
--- a/regress/usr.bin/ssh/sftp-cmds.sh
+++ b/regress/usr.bin/ssh/sftp-cmds.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: sftp-cmds.sh,v 1.1 2003/01/08 23:54:22 djm Exp $
+# $OpenBSD: sftp-cmds.sh,v 1.2 2003/01/10 07:52:41 djm Exp $
# Placed in the Public Domain.
# XXX - TODO:
@@ -11,73 +11,90 @@ tid="sftp commands"
DATA=/bin/ls
COPY=${OBJ}/copy
-verbose "$tid: ls"
-echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} || fail "lls failed"
+rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
+
+verbose "$tid: lls"
+echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "lls failed"
# XXX always successful
verbose "$tid: ls"
-echo "ls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} || fail "ls failed"
+echo "ls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "ls failed"
# XXX always successful
verbose "$tid: shell"
-echo "!echo hi there" | ${SFTP} -P ${SFTPSERVER} || fail "shell failed"
+echo "!echo hi there" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "shell failed"
# XXX always successful
verbose "$tid: pwd"
-echo "pwd" | ${SFTP} -P ${SFTPSERVER} || fail "pwd failed"
+echo "pwd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "pwd failed"
# XXX always successful
verbose "$tid: lpwd"
-echo "lpwd" | ${SFTP} -P ${SFTPSERVER} || fail "lpwd failed"
+echo "lpwd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "lpwd failed"
# XXX always successful
verbose "$tid: quit"
-echo "quit" | ${SFTP} -P ${SFTPSERVER} || fail "quit failed"
+echo "quit" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "quit failed"
# XXX always successful
verbose "$tid: help"
-echo "help" | ${SFTP} -P ${SFTPSERVER} || fail "help failed"
+echo "help" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "help failed"
# XXX always successful
rm -f ${COPY}
verbose "$tid: get"
-echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} || fail "get failed"
+echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "get failed"
cmp $DATA ${COPY} || fail "corrupted copy after get"
rm -f ${COPY}
verbose "$tid: put"
-echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} || fail "put failed"
+echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "put failed"
cmp $DATA ${COPY} || fail "corrupted copy after put"
verbose "$tid: rename"
-echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} || fail "rename failed"
+echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "rename failed"
test -f ${COPY}.1 || fail "missing file after rename"
-cmp $DATA ${COPY}.1 || fail "corrupted copy after rename"
+cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename"
verbose "$tid: ln"
-echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} || fail "ln failed"
+echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed"
test -L ${COPY}.2 || fail "missing file after ln"
verbose "$tid: mkdir"
-echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} || fail "mkdir failed"
+echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "mkdir failed"
test -d ${COPY}.dd || fail "missing directory after mkdir"
# XXX do more here
verbose "$tid: chdir"
-echo "chdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} || fail "chdir failed"
+echo "chdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "chdir failed"
verbose "$tid: rmdir"
-echo "rmdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} || fail "rmdir failed"
+echo "rmdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "rmdir failed"
test -d ${COPY}.1 && fail "present directory after rmdir"
verbose "$tid: lmkdir"
-echo "lmkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} || fail "lmkdir failed"
+echo "lmkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "lmkdir failed"
test -d ${COPY}.dd || fail "missing directory after lmkdir"
# XXX do more here
verbose "$tid: lchdir"
-echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} || fail "lchdir failed"
+echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
+ || fail "lchdir failed"
-rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd
+rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*