From 521981ea1b00e85b0c0ee5df0041f94123639dfd Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 11 Dec 2023 09:58:51 -0800 Subject: [PATCH] check in x509 test script --- apps/wolfsshd/test/sshd_x509_test.sh | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 apps/wolfsshd/test/sshd_x509_test.sh diff --git a/apps/wolfsshd/test/sshd_x509_test.sh b/apps/wolfsshd/test/sshd_x509_test.sh new file mode 100755 index 000000000..3ba754941 --- /dev/null +++ b/apps/wolfsshd/test/sshd_x509_test.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +# sshd local test + +PWD=`pwd` +cd ../../.. + +if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then + echo "expecting host, port and user as arguments" + echo "./sshd_x509_text.sh 127.0.0.1 22222 user" + exit -1 +fi + +TEST_CLIENT="./examples/client/client" +PRIVATE_KEY="./keys/$3-key.der" +PUBLIC_KEY="./keys/$3-cert.der" +CA_CERT="./keys/ca-cert-ecc.der" + +set -e +echo "$TEST_CLIENT -c 'pwd' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\"" +$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 + +cd $PWD +exit 0 + +