summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-01-17 16:17:09 +1100
committerDamien Miller <djm@mindrot.org>2011-01-17 16:17:09 +1100
commit58497780ab22d56ac5216c71f5a20efc1e39ce2e (patch)
tree312f7c1feb15d707cca175244d0f5541becdf5ca /regress
parent0c93adc7c1814b113d25c5e214973a3aa630b0af (diff)
- (djm) [configure.ac regress/agent-getpeereid.sh regress/multiplex.sh]
[regress/sftp-glob.sh regress/test-exec.sh] Rework how feature tests are disabled on platforms that do not support them; add a "config_defined()" shell function that greps for defines in config.h and use them to decide on feature tests. Convert a couple of existing grep's over config.h to use the new function Add a define "FILESYSTEM_NO_BACKSLASH" for filesystem that can't represent backslash characters in filenames, enable it for Cygwin and use it to turn of tests for quotes backslashes in sftp-glob.sh. based on discussion with vinschen AT redhat.com and dtucker@; ok dtucker@
Diffstat (limited to 'regress')
-rw-r--r--regress/agent-getpeereid.sh5
-rw-r--r--regress/multiplex.sh3
-rw-r--r--regress/sftp-glob.sh23
-rw-r--r--regress/test-exec.sh11
4 files changed, 28 insertions, 14 deletions
diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh
index 22276a29..f5f5ba55 100644
--- a/regress/agent-getpeereid.sh
+++ b/regress/agent-getpeereid.sh
@@ -7,10 +7,7 @@ UNPRIV=nobody
ASOCK=${OBJ}/agent
SSH_AUTH_SOCK=/nonexistent
-if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1 && \
- grep "#undef.*HAVE_GETPEERUCRED" ${BUILDDIR}/config.h >/dev/null && \
- grep "#undef.*HAVE_SO_PEERCRED" ${BUILDDIR}/config.h >/dev/null
-then
+if ! config_defined HAVE_GETPEEREID HAVE_GETPEERUCRED HAVE_SO_PEERCRED ; then
echo "skipped (not supported on this platform)"
exit 0
fi
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index 8a98a6e5..b94cdf02 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -5,8 +5,7 @@ CTL=/tmp/openssh.regress.ctl-sock.$$
tid="connection multiplexing"
-if grep "#define.*DISABLE_FD_PASSING" ${BUILDDIR}/config.h >/dev/null 2>&1
-then
+if config_defined DISABLE_FD_PASSING ; then
echo "skipped (not supported on this platform)"
exit 0
fi
diff --git a/regress/sftp-glob.sh b/regress/sftp-glob.sh
index 72bb17d7..8d4df2c9 100644
--- a/regress/sftp-glob.sh
+++ b/regress/sftp-glob.sh
@@ -3,11 +3,18 @@
tid="sftp glob"
+config_defined FILESYSTEM_NO_BACKSLASH && nobs="not supported on this platform"
+
sftp_ls() {
target=$1
errtag=$2
expected=$3
unexpected=$4
+ skip=$5
+ if test "x$skip" != "x" ; then
+ verbose "$tid: $errtag (skipped: $skip)"
+ return
+ fi
verbose "$tid: $errtag"
printf "ls -l %s" "${target}" | \
${SFTP} -b - -D ${SFTPSERVER} 2>/dev/null | \
@@ -44,8 +51,8 @@ SPACE="${DIR}/g-q space"
rm -rf ${BASE}
mkdir -p ${DIR}
-touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}"
-touch "${QSLASH}" "${ESLASH}" "${SLASH}" "${SPACE}"
+touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}" "${SPACE}"
+test "x$nobs" = "x" && touch "${QSLASH}" "${ESLASH}" "${SLASH}"
# target message expected unexpected
sftp_ls "${DIR}/fil*" "file glob" "${DATA}" ""
@@ -55,14 +62,14 @@ sftp_ls "${DIR}/g-wild\*" "escaped glob" "g-wild*" "g-wildx"
sftp_ls "${DIR}/g-quote\\\"" "escaped quote" "g-quote\"" ""
sftp_ls "\"${DIR}/g-quote\\\"\"" "quoted quote" "g-quote\"" ""
sftp_ls "'${DIR}/g-quote\"'" "single-quoted quote" "g-quote\"" ""
-sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" ""
-sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" ""
-sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" ""
-sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" ""
-sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" ""
-sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" ""
sftp_ls "${DIR}/g-q\\ space" "escaped space" "g-q space" ""
sftp_ls "'${DIR}/g-q space'" "quoted space" "g-q space" ""
+sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" "" "$nobs"
+sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" "" "$nobs"
+sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" "" "$nobs"
+sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" "" "$nobs"
+sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" "" "$nobs"
+sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" "" "$nobs"
rm -rf ${BASE}
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index b64dcdbc..5c56aeff 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -221,6 +221,17 @@ fatal ()
exit $RESULT
}
+# Check whether preprocessor symbols are defined in config.h.
+config_defined ()
+{
+ str=$1
+ while test "x$2" != "x" ; do
+ str="$str|$2"
+ shift
+ done
+ egrep "^#define.*($str)" ${BUILDDIR}/config.h >/dev/null 2>&1
+}
+
RESULT=0
PIDFILE=$OBJ/pidfile