diff --git a/.github/workflows/sshd-test.yml b/.github/workflows/sshd-test.yml index 42287a66f..828344af8 100644 --- a/.github/workflows/sshd-test.yml +++ b/.github/workflows/sshd-test.yml @@ -28,5 +28,5 @@ jobs: - name: make check run: make check - name: run wolfSSHd tests - run: sudo ./run_all_sshd_tests.sh + run: sudo ./run_all_sshd_tests.sh root working-directory: ./apps/wolfsshd/test diff --git a/apps/wolfsshd/test/run_all_sshd_tests.sh b/apps/wolfsshd/test/run_all_sshd_tests.sh index aac061746..746762bb7 100755 --- a/apps/wolfsshd/test/run_all_sshd_tests.sh +++ b/apps/wolfsshd/test/run_all_sshd_tests.sh @@ -2,9 +2,15 @@ echo "Running all wolfSSHd tests" -USER=$1 +if [ -z "$1" ]; then + USER=$USER +else + USER=$1 +fi + TEST_HOST=$2 TEST_PORT=$3 + TOTAL=0 SKIPPED=0 diff --git a/apps/wolfsshd/test/sshd_x509_test.sh b/apps/wolfsshd/test/sshd_x509_test.sh index 3ba754941..dd9005f53 100755 --- a/apps/wolfsshd/test/sshd_x509_test.sh +++ b/apps/wolfsshd/test/sshd_x509_test.sh @@ -21,16 +21,17 @@ echo "$TEST_CLIENT -c 'pwd' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h $TEST_CLIENT -c 'pwd' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" set +e -#rm -f error.txt -#echo "$TEST_CLIENT -c 'ls error' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\" 2> error.txt" -#$TEST_CLIENT -c 'ls error' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 2> error.txt -# -## check stderr output was caught -#if [ ! -s error.txt ]; then -# echo "No stderr data was found when expected!!" -# cd $PWD -# exit 1 -#fi +rm -f error.txt +echo "$TEST_CLIENT -c 'ls error' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\" 2> error.txt" +$TEST_CLIENT -c 'ls error' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 2> error.txt + +# check stderr output was caught +if [ ! -s error.txt ]; then + echo "No stderr data was found when expected!!" + cd $PWD + exit 1 +fi +rm -f error.txt cd $PWD exit 0