diff options
Diffstat (limited to 'regress/sftp-glob.sh')
-rw-r--r-- | regress/sftp-glob.sh | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/regress/sftp-glob.sh b/regress/sftp-glob.sh index 72bb17d75..8d4df2c98 100644 --- a/regress/sftp-glob.sh +++ b/regress/sftp-glob.sh | |||
@@ -3,11 +3,18 @@ | |||
3 | 3 | ||
4 | tid="sftp glob" | 4 | tid="sftp glob" |
5 | 5 | ||
6 | config_defined FILESYSTEM_NO_BACKSLASH && nobs="not supported on this platform" | ||
7 | |||
6 | sftp_ls() { | 8 | sftp_ls() { |
7 | target=$1 | 9 | target=$1 |
8 | errtag=$2 | 10 | errtag=$2 |
9 | expected=$3 | 11 | expected=$3 |
10 | unexpected=$4 | 12 | unexpected=$4 |
13 | skip=$5 | ||
14 | if test "x$skip" != "x" ; then | ||
15 | verbose "$tid: $errtag (skipped: $skip)" | ||
16 | return | ||
17 | fi | ||
11 | verbose "$tid: $errtag" | 18 | verbose "$tid: $errtag" |
12 | printf "ls -l %s" "${target}" | \ | 19 | printf "ls -l %s" "${target}" | \ |
13 | ${SFTP} -b - -D ${SFTPSERVER} 2>/dev/null | \ | 20 | ${SFTP} -b - -D ${SFTPSERVER} 2>/dev/null | \ |
@@ -44,8 +51,8 @@ SPACE="${DIR}/g-q space" | |||
44 | 51 | ||
45 | rm -rf ${BASE} | 52 | rm -rf ${BASE} |
46 | mkdir -p ${DIR} | 53 | mkdir -p ${DIR} |
47 | touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}" | 54 | touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}" "${SPACE}" |
48 | touch "${QSLASH}" "${ESLASH}" "${SLASH}" "${SPACE}" | 55 | test "x$nobs" = "x" && touch "${QSLASH}" "${ESLASH}" "${SLASH}" |
49 | 56 | ||
50 | # target message expected unexpected | 57 | # target message expected unexpected |
51 | sftp_ls "${DIR}/fil*" "file glob" "${DATA}" "" | 58 | sftp_ls "${DIR}/fil*" "file glob" "${DATA}" "" |
@@ -55,14 +62,14 @@ sftp_ls "${DIR}/g-wild\*" "escaped glob" "g-wild*" "g-wildx" | |||
55 | sftp_ls "${DIR}/g-quote\\\"" "escaped quote" "g-quote\"" "" | 62 | sftp_ls "${DIR}/g-quote\\\"" "escaped quote" "g-quote\"" "" |
56 | sftp_ls "\"${DIR}/g-quote\\\"\"" "quoted quote" "g-quote\"" "" | 63 | sftp_ls "\"${DIR}/g-quote\\\"\"" "quoted quote" "g-quote\"" "" |
57 | sftp_ls "'${DIR}/g-quote\"'" "single-quoted quote" "g-quote\"" "" | 64 | sftp_ls "'${DIR}/g-quote\"'" "single-quoted quote" "g-quote\"" "" |
58 | sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" "" | ||
59 | sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" "" | ||
60 | sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" "" | ||
61 | sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" "" | ||
62 | sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" "" | ||
63 | sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" "" | ||
64 | sftp_ls "${DIR}/g-q\\ space" "escaped space" "g-q space" "" | 65 | sftp_ls "${DIR}/g-q\\ space" "escaped space" "g-q space" "" |
65 | sftp_ls "'${DIR}/g-q space'" "quoted space" "g-q space" "" | 66 | sftp_ls "'${DIR}/g-q space'" "quoted space" "g-q space" "" |
67 | sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" "" "$nobs" | ||
68 | sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" "" "$nobs" | ||
69 | sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" "" "$nobs" | ||
70 | sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" "" "$nobs" | ||
71 | sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" "" "$nobs" | ||
72 | sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" "" "$nobs" | ||
66 | 73 | ||
67 | rm -rf ${BASE} | 74 | rm -rf ${BASE} |
68 | 75 | ||