Skip to content

Commit

Permalink
check in x509 test script
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Jan 26, 2024
1 parent ab45a98 commit 521981e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions apps/wolfsshd/test/sshd_x509_test.sh
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit 521981e

Please sign in to comment.