Skip to content

Commit

Permalink
adjust sshd test for user name
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Jan 26, 2024
1 parent 521981e commit 126a884
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sshd-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion apps/wolfsshd/test/run_all_sshd_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 11 additions & 10 deletions apps/wolfsshd/test/sshd_x509_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 126a884

Please sign in to comment.