Skip to content

Commit

Permalink
unit test: Improve dependency versions list
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Aug 26, 2023
1 parent eab1b10 commit 95c9d0c
Showing 1 changed file with 49 additions and 17 deletions.
66 changes: 49 additions & 17 deletions dev/easytls-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,43 @@ usage ()
"
}


# Tools Version
tools_version() {
print "
OpenSSL command: ${OPENSSL_CMD}"
${INVOKE_OPTS} "${OPENSSL_CMD}" version || \
fail "${INVOKE_OPTS} ${OPENSSL_CMD} version ($exit_code)"

print "
EasyRSA command: ${EASYRSA_CMD}"
${INVOKE_OPTS} "${EASYRSA_CMD}" version || \
fail "${INVOKE_OPTS} ${EASYRSA_CMD} version ($exit_code)"

print "
EasyTLS command: ${EASYTLS_CMD}"
${INVOKE_OPTS} "${EASYTLS_CMD}" -V || \
fail "${INVOKE_OPTS} ${EASYTLS_CMD} -V ($exit_code)"

print "
EasyTLS-cryptv2-verify command: ${TLSCV2V_CMD}"
${INVOKE_OPTS} "${TLSCV2V_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${TLSCV2V_CMD} -V ($exit_code)"

print "
EasyTLS-client-connect command: ${CLICON_CMD}"
${INVOKE_OPTS} "${CLICON_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${CLICON_CMD} -V ($exit_code)"

print "
EasyTLS-client-disconnect command: ${CLIDIS_CMD}"
${INVOKE_OPTS} "${CLIDIS_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${CLIDIS_CMD} -V ($exit_code)"
}

fail ()
{
print "$@"
Expand Down Expand Up @@ -118,7 +155,8 @@ warn() { printf "%s\n" "$*"; }

build_test_pki ()
{
for i in "make-safe-ssl" \
for i in \
"make-safe-ssl" \
"--req-cn='easytls-unit-test' build-ca nopass" \
"build-server-full s01 nopass" \
"build-server-full s02 nopass" \
Expand Down Expand Up @@ -309,7 +347,7 @@ WORK_DIR="$(pwd)"
UTMP_DIR="${WORK_DIR}/unit-test-tmp"
rm -rf "${UTMP_DIR}"

EASYRSA_CMD="./easyrsa"
EASYRSA_CMD="${EASYRSA_CMD:-./easyrsa}"
EASYRSA_OPTS="--batch"

EASYTLS_CMD="./easytls"
Expand Down Expand Up @@ -385,11 +423,18 @@ else
export EASYTLS_OPENVPN=openvpn
export OPENVPN_CMD=openvpn
fi

export EASYRSA_OPENSSL="openssl"
export OPENSSL_CMD="openssl"

fi

# Invoke with user opts: eg. EASYTLS_SILENT=1
INVOKE_OPTS=""

# Version info
tools_version

# Test help
print "TEST: All --help"

Expand Down Expand Up @@ -1216,21 +1261,8 @@ DBUG_DIR="$WORK_DIR/et-tdir1/easytls/metadata"
#"$EASYTLS_CMD" $EASYTLS_OPTS version || \
# fail "Unit test error 71: version"

# Version
${INVOKE_OPTS} "${EASYTLS_CMD}" -V || \
fail "${INVOKE_OPTS} ${EASYTLS_CMD} -V ($exit_code)"

${INVOKE_OPTS} "${TLSCV2V_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${TLSCV2V_CMD} -V ($exit_code)"

${INVOKE_OPTS} "${CLICON_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${CLICON_CMD} -V ($exit_code)"

${INVOKE_OPTS} "${CLIDIS_CMD}" -V || exit_code=$?
[ $exit_code -eq 9 ] || \
fail "${INVOKE_OPTS} ${CLIDIS_CMD} -V ($exit_code)"
# Version info
tools_version

# Stats
unset EASYTLS_QUIET
Expand Down

0 comments on commit 95c9d0c

Please sign in to comment.