]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: fix "fail" function usage
authorDaiki Ueno <ueno@gnu.org>
Tue, 10 Dec 2024 06:54:15 +0000 (15:54 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 9 Jan 2025 05:04:23 +0000 (14:04 +0900)
The "fail" shell function takes a PID as the first argument.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
tests/system-override-curves-allowlist.sh
tests/system-override-curves.sh
tests/system-override-default-priority-string.sh
tests/system-override-kx.sh
tests/system-override-profiles.sh
tests/system-override-session-hash.sh
tests/system-override-versions-allowlist.sh
tests/system-override-versions.sh

index b0434539e280df8c24e44cdb114b8e02bdb5a544..abb999cfe7eba3f88ebcc44787e2ca8de4b147f6 100755 (executable)
@@ -114,12 +114,12 @@ PID=$!
 wait_server ${PID}
 
 ${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority ${EXAMPLE_DISABLED_PRIORITY} --insecure --logfile ${TMPFILE_OBSERVED_LOG} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE_CONFIG}"
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority ${EXAMPLE_DISABLED_PRIORITY} --insecure --logfile ${TMPFILE_OBSERVED_LOG} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
@@ -137,7 +137,7 @@ wait_server ${PID}
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 ${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority ${EXAMPLE_DISABLED_PRIORITY} --insecure --logfile ${TMPFILE_OBSERVED_LOG} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
index 2e2013a9e91487ed4f9fe40356253603b016072a..764f985125b5b9c59300c60f6b7fea955b3c104e 100755 (executable)
@@ -81,12 +81,12 @@ PID=$!
 wait_server ${PID}
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-CURVE-ALL:+CURVE-SECP256R1:+CURVE-SECP521R1 --insecure --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-CURVE-ALL:+CURVE-SECP256R1:+CURVE-SECP521R1 --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
@@ -104,7 +104,7 @@ wait_server ${PID}
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-CURVE-ALL:+CURVE-SECP256R1:+CURVE-SECP521R1" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
index 3980be0a7ec23d5c25299b61a736bb0f00eccf7f..2a3c5b7c094dc0276e45b60a108a38d7b4ff26cc 100755 (executable)
@@ -53,7 +53,7 @@ wait_server ${PID}
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${STOCK_PRIORITY}"
 "${CLI}" -p "${PORT}" 127.0.0.1 --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (1)"
+       fail "" "expected connection to fail (1)"
 kill ${PID}
 wait
 
@@ -66,11 +66,11 @@ wait_server ${PID}
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${STOCK_PRIORITY}"
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-TLS1.3" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${STOCK_PRIORITY}"
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.3" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 kill ${PID}
 wait
@@ -84,7 +84,7 @@ PID=$!
 wait_server ${PID}
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --insecure --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (2)"
+       fail "" "expected connection to succeed (2)"
 
 kill ${PID}
 wait
index 642ff0b794bf713f6650283cb9d31d8d68db55fd..bf5ac513dd673ae69abdfbd29f6d7c886ea52373 100755 (executable)
@@ -65,18 +65,18 @@ PID=$!
 wait_server ${PID}
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-KX-ALL:+DHE-RSA --insecure --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-KX-ALL:+DHE-RSA --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 # test whether the unknown KX will be caught
 GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID=1
 export GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to succeed (3)"
+       fail "" "expected connection to succeed (3)"
 
 unset GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID
 
@@ -96,7 +96,7 @@ wait_server ${PID}
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-KX-ALL:+DHE-RSA" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
index 724ff924db982d1d07f26e1b4438a6e7ef13ddb7..508aff545f124c05303f1819f5367f6530496faa 100755 (executable)
@@ -61,15 +61,15 @@ export GNUTLS_DEBUG_LEVEL=3
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_LOW --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (2)"
+       fail "" "expected connection to succeed (2)"
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_MEDIUM --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (3)"
+       fail "" "expected connection to succeed (3)"
 
 # failure case, 384 bit min-profile, 256 bit key
 cat <<_EOF_ > ${TMPFILE}
@@ -81,15 +81,15 @@ _EOF_
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_LOW --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (1)"
+       fail "" "expected connection to fail (1)"
 
 "${CLI}" --attime "2017-11-22" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_MEDIUM --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
index f7bc031a1270a2b04aea81b2315d41afaf884ac2..56e54484aa7a818d5e44c865bc7d45e323e91c2a 100755 (executable)
@@ -70,11 +70,11 @@ export GNUTLS_SYSTEM_PRIORITY_FILE="$testdir/request.cfg"
 export GNUTLS_DEBUG_LEVEL=3
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2" --verify-hostname=localhost --x509cafile ${CA} --logfile="$testdir/client.log" </dev/null >/dev/null ||
-       fail "expected connection to succeed (1)"
+       fail "" "expected connection to succeed (1)"
 
 # "tls-session-hash" has precedence over %FORCE_SESSION_HASH
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2:%FORCE_SESSION_HASH" --verify-hostname=localhost --x509cafile ${CA} --logfile="$testdir/client.log" </dev/null >/dev/null ||
-       fail "expected connection to succeed (2)"
+       fail "" "expected connection to succeed (2)"
 
 echo kill ${PID}
 kill ${PID}
index f7bceaac7b8fb5acace275cc1a82466b8514e3f3..15546f1121e4abdbc8a163321060028dbb805166 100755 (executable)
@@ -82,7 +82,7 @@ wait_server ${PID}
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "$PRIO" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (1)"
+       fail "" "expected connection to fail (1)"
 
 kill ${PID}
 wait
@@ -100,7 +100,7 @@ wait_server ${PID}
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait
index c3dfc71f449c4377280ea9df2d92e31b5dd84057..3f3e4a425d46d191b971a172f9a715c0f32339e2 100755 (executable)
@@ -79,7 +79,7 @@ wait_server ${PID}
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (1)"
+       fail "" "expected connection to fail (1)"
 
 kill ${PID}
 wait
@@ -97,7 +97,7 @@ wait_server ${PID}
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" --insecure --logfile ${TMPFILE2} </dev/null >/dev/null &&
-       fail "expected connection to fail (2)"
+       fail "" "expected connection to fail (2)"
 
 kill ${PID}
 wait