]> andersk Git - openssh.git/blame - regress/sftp-batch.sh
- jmc@cvs.openbsd.org 2010/01/13 12:48:34
[openssh.git] / regress / sftp-batch.sh
CommitLineData
6c8ebe98 1# $OpenBSD: sftp-batch.sh,v 1.4 2009/08/13 01:11:55 djm Exp $
8582624b 2# Placed in the Public Domain.
3
4tid="sftp batchfile"
5
5781bb58 6DATA=/bin/ls${EXEEXT}
8582624b 7COPY=${OBJ}/copy
7267f37e 8BATCH=${OBJ}/sftp.bb
8582624b 9
10rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
11
12cat << EOF > ${BATCH}.pass.1
13 get $DATA $COPY
14 put ${COPY} ${COPY}.1
15 rm ${COPY}
16 -put ${COPY} ${COPY}.2
17EOF
18
19cat << EOF > ${BATCH}.pass.2
20 # This is a comment
21
22 # That was a blank line
23 ls
24EOF
25
26cat << EOF > ${BATCH}.fail.1
27 get $DATA $COPY
28 put ${COPY} ${COPY}.3
29 rm ${COPY}.*
30 # The next command should fail
31 put ${COPY}.3 ${COPY}.4
32EOF
33
34cat << EOF > ${BATCH}.fail.2
35 # The next command should fail
36 jajajajaja
37EOF
38
39verbose "$tid: good commands"
6c8ebe98 40${SFTP} -b ${BATCH}.pass.1 -D ${SFTPSERVER} >/dev/null 2>&1 \
8582624b 41 || fail "good commands failed"
42
43verbose "$tid: bad commands"
6c8ebe98 44${SFTP} -b ${BATCH}.fail.1 -D ${SFTPSERVER} >/dev/null 2>&1 \
8582624b 45 && fail "bad commands succeeded"
46
47verbose "$tid: comments and blanks"
6c8ebe98 48${SFTP} -b ${BATCH}.pass.2 -D ${SFTPSERVER} >/dev/null 2>&1 \
8582624b 49 || fail "comments & blanks failed"
50
51verbose "$tid: junk command"
6c8ebe98 52${SFTP} -b ${BATCH}.fail.2 -D ${SFTPSERVER} >/dev/null 2>&1 \
8582624b 53 && fail "junk command succeeded"
54
55rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
56
57
This page took 0.184561 seconds and 5 git commands to generate.