mirror of https://github.com/wolfSSL/wolfssh.git
Use wolfssh-options in the test scripts
The scripts now read the build options from the probe instead of grepping usage text, config.log and daemon logs. Drops the usage lines only tests read.pull/1184/head
parent
8f5d31a2c6
commit
754317b6bf
|
|
@ -16,6 +16,9 @@ test_cases=(
|
||||||
# Set defaults
|
# Set defaults
|
||||||
USER=$USER
|
USER=$USER
|
||||||
|
|
||||||
|
# Build options for this tree; defines WOLFSSH_OPTIONS and wolfssh_has.
|
||||||
|
. ./wolfssh_options.sh
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
MATCH=""
|
MATCH=""
|
||||||
EXCLUDE=""
|
EXCLUDE=""
|
||||||
|
|
@ -424,16 +427,14 @@ else
|
||||||
stop_wolfsshd
|
stop_wolfsshd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ML-DSA composite host key test. Runs when we control the local daemon.
|
# ML-DSA composite host key test. Runs when we control the local daemon;
|
||||||
# The client side uses an ECC key since we only test the host key here.
|
# the client uses an ECC key since only the host key is under test.
|
||||||
# sshd_config_test_mldsa has no other host key, so a build without ML-DSA
|
# sshd_config_test_mldsa has no other host key, so an ML-DSA-less build
|
||||||
# cannot start the daemon at all; check for support out here rather than
|
# cannot start the daemon; check out here, not in the test script. The
|
||||||
# letting the test script skip, which would come too late. ML-DSA comes from
|
# check is the composite, not the umbrella: the ECDSA half can be missing
|
||||||
# wolfSSL (HAVE_DILITHIUM) and has no wolfSSH configure option, so probe the
|
# on its own.
|
||||||
# client's algorithm list. The closed port keeps the probe from connecting.
|
|
||||||
if [ "$USING_LOCAL_HOST" == 1 ]; then
|
if [ "$USING_LOCAL_HOST" == 1 ]; then
|
||||||
if ../../../examples/client/client -E -u "$USER" -h 127.0.0.1 -p 1 \
|
if wolfssh_has MLDSA87_ES384; then
|
||||||
2>/dev/null | grep -q "ssh-mldsa87-es384@wolfssl.com"; then
|
|
||||||
start_wolfsshd "sshd_config_test_mldsa"
|
start_wolfsshd "sshd_config_test_mldsa"
|
||||||
run_test "sshd_mldsa_composite_test.sh"
|
run_test "sshd_mldsa_composite_test.sh"
|
||||||
printf "Shutting down test wolfSSHd\n"
|
printf "Shutting down test wolfSSHd\n"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# sshd local test
|
# sshd local test
|
||||||
|
|
||||||
ROOT_PWD=$(pwd)
|
ROOT_PWD=$(pwd)
|
||||||
|
. ./wolfssh_options.sh
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
TEST_CLIENT="./apps/wolfssh/wolfssh"
|
TEST_CLIENT="./apps/wolfssh/wolfssh"
|
||||||
|
|
@ -18,18 +19,18 @@ HOST_IP="$1"
|
||||||
HOST_PORT="$2"
|
HOST_PORT="$2"
|
||||||
USER_SET="$3"
|
USER_SET="$3"
|
||||||
|
|
||||||
# check if wolfssh app was compiled
|
# check if wolfssh app was compiled. test_if_supported also drives the example
|
||||||
OUTPUT=$("$TEST_CLIENT" -V)
|
# client, and libtool can leave a script behind, so run each rather than -x.
|
||||||
RESULT=$?
|
if ! wolfssh_has SSHCLIENT || [ ! -x "$TEST_CLIENT" ] \
|
||||||
if [ "$RESULT" != 0 ]; then
|
|| [ ! -x ./examples/client/client ] \
|
||||||
|
|| "$TEST_CLIENT" -V 2>&1 | grep -q "does not exist" \
|
||||||
|
|| ./examples/client/client "-?" 2>&1 | grep -q "does not exist"; then
|
||||||
echo "wolfSSH app not compiled in";
|
echo "wolfSSH app not compiled in";
|
||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Debug mode needs to be on to inspect the debug output
|
# Debug mode needs to be on to inspect the debug output
|
||||||
printf "$OUTPUT" | grep "DEBUG"
|
if ! wolfssh_has DEBUG; then
|
||||||
RESULT=$?
|
|
||||||
if [ "$RESULT" != 0 ]; then
|
|
||||||
echo "wolfSSH app not compiled with debug mode";
|
echo "wolfSSH app not compiled with debug mode";
|
||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
@ -59,8 +60,8 @@ printf "\n"
|
||||||
# host key algorithms sent.
|
# host key algorithms sent.
|
||||||
find_substring_of_algos() {
|
find_substring_of_algos() {
|
||||||
# Extract the substring between start and end lines
|
# Extract the substring between start and end lines
|
||||||
SUBSTRING=$(printf "$OUTPUT" | grep -A100 "Server Host Key Algorithms")
|
SUBSTRING=$(printf '%s\n' "$OUTPUT" | grep -A100 "Server Host Key Algorithms")
|
||||||
SUBSTRING=$(printf "$SUBSTRING" | grep -v -A95 "DKI: Enc Algorithms")
|
SUBSTRING=$(printf '%s\n' "$SUBSTRING" | grep -v -A95 "DKI: Enc Algorithms")
|
||||||
}
|
}
|
||||||
|
|
||||||
# take input argument $1 and checks if it is in the SUBSTRING
|
# take input argument $1 and checks if it is in the SUBSTRING
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# sshd local test
|
# sshd local test
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
|
. ./wolfssh_options.sh
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp"
|
TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp"
|
||||||
|
|
@ -16,6 +17,11 @@ if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! wolfssh_has SFTP || [ ! -x "$TEST_SFTP_CLIENT" ]; then
|
||||||
|
echo "SFTP client not available in this build, skipping"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir test-$$
|
mkdir test-$$
|
||||||
mkdir test-$$/subfolder
|
mkdir test-$$/subfolder
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,13 @@ if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# A password login can only be checked when a backend was compiled in.
|
||||||
|
. ./wolfssh_options.sh
|
||||||
|
if ! wolfssh_has PAM && ! wolfssh_has LIBCRYPT && ! wolfssh_has LIBLOGIN; then
|
||||||
|
echo "SKIP: wolfsshd built without a password check backend"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
|
||||||
TEST_HOST="$1"
|
TEST_HOST="$1"
|
||||||
TEST_PORT="$2"
|
TEST_PORT="$2"
|
||||||
if [ ! -z "$3" ]; then
|
if [ ! -z "$3" ]; then
|
||||||
|
|
@ -51,11 +58,6 @@ sleep 1
|
||||||
stop_wolfsshd
|
stop_wolfsshd
|
||||||
|
|
||||||
# log.txt is owned by root (wolfsshd ran via sudo); use sudo to read it.
|
# log.txt is owned by root (wolfsshd ran via sudo); use sudo to read it.
|
||||||
if sudo grep -q "No compiled in password check" ./log.txt; then
|
|
||||||
echo "SKIP: wolfsshd built without libcrypt/liblogin support"
|
|
||||||
exit 77
|
|
||||||
fi
|
|
||||||
|
|
||||||
if sudo grep -q "Error checking password" ./log.txt; then
|
if sudo grep -q "Error checking password" ./log.txt; then
|
||||||
echo "FAIL: empty-password NULL-guard regression detected"
|
echo "FAIL: empty-password NULL-guard regression detected"
|
||||||
echo "----- log.txt -----"
|
echo "----- log.txt -----"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# sshd local test
|
# sshd local test
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
|
. ./wolfssh_options.sh
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp"
|
TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp"
|
||||||
|
|
@ -16,6 +17,11 @@ if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! wolfssh_has SFTP || [ ! -x "$TEST_SFTP_CLIENT" ]; then
|
||||||
|
echo "SFTP client not available in this build, skipping"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
|
||||||
# wolfSSHd confines SFTP access to the user's home directory, so the remote
|
# wolfSSHd confines SFTP access to the user's home directory, so the remote
|
||||||
# file must live under it. Resolve the same home directory wolfSSHd uses
|
# file must live under it. Resolve the same home directory wolfSSHd uses
|
||||||
# (the passwd entry), falling back to $HOME.
|
# (the passwd entry), falling back to $HOME.
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,14 @@
|
||||||
set +m # quiet job-control "Terminated" notices when stopping the daemon
|
set +m # quiet job-control "Terminated" notices when stopping the daemon
|
||||||
|
|
||||||
PWD0=$(pwd)
|
PWD0=$(pwd)
|
||||||
|
. ./wolfssh_options.sh
|
||||||
cd ../../..
|
cd ../../..
|
||||||
ROOT=$(pwd)
|
ROOT=$(pwd)
|
||||||
|
|
||||||
skip() { echo "$1"; cd "$PWD0"; exit 77; }
|
skip() { echo "$1"; cd "$PWD0"; exit 77; }
|
||||||
|
|
||||||
# Only meaningful when wolfSSHd was built with OpenSSH certificate support.
|
# Only meaningful when wolfSSHd was built with OpenSSH certificate support.
|
||||||
grep -q "WOLFSSH_OSSH_CERTS" config.log 2>/dev/null || \
|
wolfssh_has OSSH_CERTS || \
|
||||||
skip "wolfSSHd not built with --enable-ossh-certs, skipping"
|
skip "wolfSSHd not built with --enable-ossh-certs, skipping"
|
||||||
|
|
||||||
WOLFSSHD="$ROOT/apps/wolfsshd/wolfsshd"
|
WOLFSSHD="$ROOT/apps/wolfsshd/wolfsshd"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# sshd local test
|
# sshd local test
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
|
. ./wolfssh_options.sh
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
TEST_SCP_CLIENT="./examples/scpclient/wolfscp"
|
TEST_SCP_CLIENT="./examples/scpclient/wolfscp"
|
||||||
|
|
@ -16,6 +17,11 @@ if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! wolfssh_has SCP || [ ! -x "$TEST_SCP_CLIENT" ]; then
|
||||||
|
echo "SCP client not available in this build, skipping"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir test-$$
|
mkdir test-$$
|
||||||
|
|
||||||
OUTDIR="`pwd`/test-$$"
|
OUTDIR="`pwd`/test-$$"
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@
|
||||||
# "example". The wolfSSHd UPN domain check must therefore reject the cert.
|
# "example". The wolfSSHd UPN domain check must therefore reject the cert.
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
|
. ./wolfssh_options.sh
|
||||||
|
|
||||||
# The UPN domain check is compiled only when wolfSSL is built with FPKI. Probe
|
# The UPN domain check is compiled only when wolfSSL is built with FPKI.
|
||||||
# the daemon binary's help output, which prints an FPKI marker under the same
|
if ! wolfssh_has FPKI; then
|
||||||
# build guard, and skip when the check is not present.
|
|
||||||
if ! ../wolfsshd "-?" 2>&1 | grep -q "FPKI"; then
|
|
||||||
echo "wolfSSHd built without FPKI; UPN domain check not compiled in, skipping"
|
echo "wolfSSHd built without FPKI; UPN domain check not compiled in, skipping"
|
||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Build option probe for the wolfSSHd test scripts. Source it before any cd,
|
||||||
|
# since it resolves the tree from the script's own location:
|
||||||
|
#
|
||||||
|
# . ./wolfssh_options.sh
|
||||||
|
# if ! wolfssh_has SFTP; then
|
||||||
|
# echo "built without SFTP, skipping"
|
||||||
|
# exit 77
|
||||||
|
# fi
|
||||||
|
#
|
||||||
|
# The tests run from this directory, so the one path to the build tree lives
|
||||||
|
# here. WOLFSSH_ROOT is absolute, so it survives their cd ../../.. . A probe
|
||||||
|
# that will not run is a build problem, not an option being off.
|
||||||
|
|
||||||
|
WOLFSSH_ROOT=$(cd "$(dirname "$0")/../../.." && pwd) || exit 1
|
||||||
|
WOLFSSH_OPTIONS=$("$WOLFSSH_ROOT/apps/wolfssh-options") || {
|
||||||
|
echo "fail: could not run $WOLFSSH_ROOT/apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Whole line match, so one option name cannot match another that has it as a
|
||||||
|
# prefix.
|
||||||
|
wolfssh_has() {
|
||||||
|
echo "$WOLFSSH_OPTIONS" | grep -qx "$1"
|
||||||
|
}
|
||||||
|
|
@ -195,19 +195,13 @@ static void ShowUsage(void)
|
||||||
printf("wolfSSHd %s linked with wolfSSL %s\n", LIBWOLFSSH_VERSION_STRING,
|
printf("wolfSSHd %s linked with wolfSSL %s\n", LIBWOLFSSH_VERSION_STRING,
|
||||||
LIBWOLFSSL_VERSION_STRING);
|
LIBWOLFSSL_VERSION_STRING);
|
||||||
printf(" -? display this help and exit\n");
|
printf(" -? display this help and exit\n");
|
||||||
printf(" -f <file name> Configuration file to use, default is "
|
printf(" -f <file name> Configuration file to use, default is:\n"
|
||||||
"/etc/ssh/sshd_config\n");
|
" /etc/ssh/sshd_config\n");
|
||||||
printf(" -p <int> Port number to listen on\n");
|
printf(" -p <int> Port number to listen on\n");
|
||||||
printf(" -d Turn on debug mode\n");
|
printf(" -d Turn on debug mode\n");
|
||||||
printf(" -D Run in foreground (do not detach)\n");
|
printf(" -D Run in foreground (do not detach)\n");
|
||||||
printf(" -h <file name> host private key file to use\n");
|
printf(" -h <file name> host private key file to use\n");
|
||||||
printf(" -E <file name> append to log file\n");
|
printf(" -E <file name> append to log file\n");
|
||||||
#ifdef WOLFSSL_FPKI
|
|
||||||
/* build-capability note, separated from the option list; also greppable by
|
|
||||||
* test scripts, for the cert UPN domain check (AuthorizedUPNDomains) */
|
|
||||||
printf("\n");
|
|
||||||
printf("Build features: FPKI certificate UPN domain checking\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,8 @@ static void ShowUsage(void)
|
||||||
printf(" -x exit after successful connection without doing\n"
|
printf(" -x exit after successful connection without doing\n"
|
||||||
" read/write\n");
|
" read/write\n");
|
||||||
#ifdef WOLFSSH_TEST_BLOCK
|
#ifdef WOLFSSH_TEST_BLOCK
|
||||||
printf("-N non-blocking sockets required when compiled with "
|
printf(" -N non-blocking sockets, required when compiled with\n"
|
||||||
"WOLFSSH_TEST_BLOCK\n");
|
" WOLFSSH_TEST_BLOCK\n");
|
||||||
#else
|
#else
|
||||||
printf(" -N use non-blocking sockets\n");
|
printf(" -N use non-blocking sockets\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -129,11 +129,6 @@ static void ShowUsage(void)
|
||||||
printf(" -k set the list of key algos\n");
|
printf(" -k set the list of key algos\n");
|
||||||
printf(" -C set the list of encrypt algos\n");
|
printf(" -C set the list of encrypt algos\n");
|
||||||
printf(" -q turn off debugging output\n");
|
printf(" -q turn off debugging output\n");
|
||||||
#ifndef WOLFSSH_HAVE_SYMLINK
|
|
||||||
/* report disabled symlink checking so test scripts can skip the
|
|
||||||
* symlink-rejection cases the server would otherwise follow */
|
|
||||||
printf(" symlink checking off (e.g. WOLFSSH_NO_SYMLINK_CHECK)\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,14 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test for nonblocking only
|
# test for nonblocking only
|
||||||
./examples/client/client -h | grep WOLFSSH_TEST_BLOCK
|
WOLFSSH_OPTIONS=$(./apps/wolfssh-options) || {
|
||||||
if [ $? -eq 0 ]
|
echo "fail: could not run ./apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if echo "$WOLFSSH_OPTIONS" | grep -qx "TEST_BLOCK"
|
||||||
then
|
then
|
||||||
echo "macro NO_WOLFSSH_CLIENT was used"
|
echo "macro WOLFSSH_TEST_BLOCK was used"
|
||||||
echo "skipping for now"
|
echo "skipping for now"
|
||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,12 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## test for nonblocking only
|
## test for nonblocking only
|
||||||
if ./examples/client/client "-?" 2>&1 | grep WOLFSSH_TEST_BLOCK >/dev/null 2>&1
|
WOLFSSH_OPTIONS=$(./apps/wolfssh-options) || {
|
||||||
|
echo "fail: could not run ./apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if echo "$WOLFSSH_OPTIONS" | grep -qx "TEST_BLOCK"
|
||||||
then
|
then
|
||||||
echo "skipping: non-blocking test"
|
echo "skipping: non-blocking test"
|
||||||
exit 77
|
exit 77
|
||||||
|
|
|
||||||
|
|
@ -6,25 +6,28 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
WOLFSSH_OPTIONS=$(./apps/wolfssh-options) || {
|
||||||
|
echo "fail: could not run ./apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# test SFTP client is working (that NO_WOLFSSH_CLIENT was not used)
|
# test SFTP client is working (that NO_WOLFSSH_CLIENT was not used)
|
||||||
|
if ! echo "$WOLFSSH_OPTIONS" | grep -qx "CLIENT"
|
||||||
|
then
|
||||||
|
echo "macro NO_WOLFSSH_CLIENT was used"
|
||||||
|
echo "skipping test"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
|
||||||
./examples/sftpclient/wolfsftp -h
|
./examples/sftpclient/wolfsftp -h
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
./examples/sftpclient/wolfsftp -h | grep NO_WOLFSSH_CLIENT
|
echo "wolfSFTP client not compiled in or not working"
|
||||||
if [ $? -eq 0 ]
|
exit 1
|
||||||
then
|
|
||||||
echo "macro NO_WOLFSSH_CLIENT was used"
|
|
||||||
echo "skipping test"
|
|
||||||
exit 77
|
|
||||||
else
|
|
||||||
echo "wolfSFTP client not compiled in or not working"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test for nonblocking only
|
# test for nonblocking only
|
||||||
./examples/client/client -h | grep WOLFSSH_TEST_BLOCK
|
if echo "$WOLFSSH_OPTIONS" | grep -qx "TEST_BLOCK"
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
echo "macro WOLFSSH_TEST_BLOCK was used"
|
echo "macro WOLFSSH_TEST_BLOCK was used"
|
||||||
exit 77
|
exit 77
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,12 @@ ready_file=`pwd`/wolfssh_scp_ready$$
|
||||||
|
|
||||||
# test for nonblocking only - wolfscp does not support -N flag for non-blocking
|
# test for nonblocking only - wolfscp does not support -N flag for non-blocking
|
||||||
# mode, so we must skip when TEST_BLOCK is enabled
|
# mode, so we must skip when TEST_BLOCK is enabled
|
||||||
./examples/client/client -h | grep WOLFSSH_TEST_BLOCK
|
WOLFSSH_OPTIONS=$(./apps/wolfssh-options) || {
|
||||||
if [ $? -eq 0 ]
|
echo "fail: could not run ./apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if echo "$WOLFSSH_OPTIONS" | grep -qx "TEST_BLOCK"
|
||||||
then
|
then
|
||||||
echo "WOLFSSH_TEST_BLOCK detected"
|
echo "WOLFSSH_TEST_BLOCK detected"
|
||||||
echo "wolfscp client does not support non-blocking mode, skipping test"
|
echo "wolfscp client does not support non-blocking mode, skipping test"
|
||||||
|
|
@ -192,12 +196,9 @@ if test $RESULT -eq 0; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The symlink-rejection guard is compiled out by WOLFSSH_NO_SYMLINK_CHECK, which
|
# Without the symlink-rejection guard the server follows symlinks by design,
|
||||||
# the example client reports in its usage output (-?). Skip this test when it is
|
# so the check below would false-fail.
|
||||||
# set: the server then follows symlinks by design and the check below would
|
if ! echo "$WOLFSSH_OPTIONS" | grep -qx "SYMLINK_CHECK"; then
|
||||||
# false-fail.
|
|
||||||
./examples/client/client '-?' | grep WOLFSSH_NO_SYMLINK_CHECK
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "symlink checking disabled, skipping symlink test"
|
echo "symlink checking disabled, skipping symlink test"
|
||||||
else
|
else
|
||||||
echo "Test that the server refuses to follow a symlink (server to local)"
|
echo "Test that the server refuses to follow a symlink (server to local)"
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,13 @@ nonblockingOnly=0
|
||||||
|
|
||||||
[ ! -x ./examples/sftpclient/wolfsftp ] && echo -e "\n\nwolfSFTP client doesn't exist" && exit 1
|
[ ! -x ./examples/sftpclient/wolfsftp ] && echo -e "\n\nwolfSFTP client doesn't exist" && exit 1
|
||||||
|
|
||||||
|
WOLFSSH_OPTIONS=$(./apps/wolfssh-options) || {
|
||||||
|
echo "fail: could not run ./apps/wolfssh-options"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# test for if the SFTP client works
|
# test for if the SFTP client works
|
||||||
./examples/sftpclient/wolfsftp -h | grep NO_WOLFSSH_CLIENT
|
if ! echo "$WOLFSSH_OPTIONS" | grep -qx "CLIENT"
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
echo "macro NO_WOLFSSH_CLIENT was used"
|
echo "macro NO_WOLFSSH_CLIENT was used"
|
||||||
echo "skipping test"
|
echo "skipping test"
|
||||||
|
|
@ -20,10 +24,9 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test for nonblocking only
|
# test for nonblocking only
|
||||||
./examples/client/client -h | grep WOLFSSH_TEST_BLOCK
|
if echo "$WOLFSSH_OPTIONS" | grep -qx "TEST_BLOCK"
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
echo "macro NO_WOLFSSH_CLIENT was used"
|
echo "macro WOLFSSH_TEST_BLOCK was used"
|
||||||
nonblockingOnly=1
|
nonblockingOnly=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue