Skip to content

Commit 29835c2

Browse files
authored
Merge pull request #9755 from julek-wolfssl/fix-script-checks
Fix compilation checks in test scripts
2 parents 2f53add + 5f755f6 commit 29835c2

11 files changed

Lines changed: 84 additions & 22 deletions

scripts/benchmark.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
#benchmark.test
44

5+
[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \
6+
&& exit 1
7+
8+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
9+
echo 'skipping benchmark.test because client not compiled in.' 1>&2
10+
exit 77
11+
fi
12+
13+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
14+
echo 'skipping benchmark.test because server not compiled in.' 1>&2
15+
exit 77
16+
fi
17+
518
if [ "$#" -lt 2 ]; then
619
echo "Usage: $0 [mode] [num] [clientargs] [serverargs]" >&2
720
echo " [mode]: 1=Connection Rate (TPS), 2=Throughput Bytes" >&2

scripts/crl-revoked.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \
44
&& exit 1
55

6-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
6+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
77
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
88
exit 77
99
fi
1010

11+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
12+
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
13+
exit 77
14+
fi
15+
1116
#crl.test
1217
# if we can, isolate the network namespace to eliminate port collisions.
1318
if [[ -n "$NETWORK_UNSHARE_HELPER" ]]; then

scripts/dtls.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ DO_DELAY_TEST=${DO_DELAY_TEST:-0}
1616

1717
#set -x # enable debug output
1818

19+
[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \
20+
&& exit 1
21+
22+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
23+
echo 'skipping dtls.test because client not compiled in.' 1>&2
24+
exit 77
25+
fi
26+
27+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
28+
echo 'skipping dtls.test because server not compiled in.' 1>&2
29+
exit 77
30+
fi
31+
1932
# bwrap execution environment to avoid port conflicts
2033
if [ "${AM_BWRAPPED-}" != "yes" ]; then
2134
bwrap_path="$(command -v bwrap)"

scripts/dtlscid.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
[ ! -x ./examples/server/server ] && printf '\n\n%s\n' "Server doesn't exist" \
1010
&& exit 0
1111

12-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
13-
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
12+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
13+
echo 'skipping dtlscid.test because client not compiled in.' 1>&2
1414
exit 77
1515
fi
1616

17-
if ! ./examples/server/server | grep "Server not compiled in!" ; then
18-
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
17+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
18+
echo 'skipping dtlscid.test because server not compiled in.' 1>&2
1919
exit 77
2020
fi
2121

scripts/ocsp-stapling-with-ca-as-responder.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ fi
2929
[ ! -x ./examples/server/server ] && printf '\n\n%s\n' "Server doesn't exist" \
3030
&& exit 1
3131

32-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
33-
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
32+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
33+
echo 'skipping ocsp-stapling-with-ca-as-responder.test because client not compiled in.' 1>&2
3434
exit 77
3535
fi
3636

37-
if ! ./examples/server/server | grep "Server not compiled in!" ; then
38-
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
37+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
38+
echo 'skipping ocsp-stapling-with-ca-as-responder.test because server not compiled in.' 1>&2
3939
exit 77
4040
fi
4141

scripts/ocsp-stapling.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ fi
2323
[ ! -x ./examples/server/server ] && printf '\n\n%s\n' "Server doesn't exist" \
2424
&& exit 1
2525

26-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
27-
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
26+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
27+
echo 'skipping ocsp-stapling.test because client not compiled in.' 1>&2
2828
exit 77
2929
fi
3030

31-
if ! ./examples/server/server | grep "Server not compiled in!" ; then
32-
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
31+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
32+
echo 'skipping ocsp-stapling.test because server not compiled in.' 1>&2
3333
exit 77
3434
fi
3535

scripts/ocsp-stapling2.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ fi
3030
[ ! -x ./examples/server/server ] && printf '\n\n%s\n' "Server doesn't exist" \
3131
&& exit 1
3232

33-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
34-
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
33+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
34+
echo 'skipping ocsp-stapling2.test because client not compiled in.' 1>&2
3535
exit 77
3636
fi
3737

38-
if ! ./examples/server/server | grep "Server not compiled in!" ; then
39-
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
38+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
39+
echo 'skipping ocsp-stapling2.test because server not compiled in.' 1>&2
4040
exit 77
4141
fi
4242

scripts/ocsp-stapling_tls13multi.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ fi
3030
[ ! -x ./examples/server/server ] && printf '\n\n%s\n' "Server doesn't exist" \
3131
&& exit 1
3232

33-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
34-
echo 'skipping crl-revoked.test because client not compiled in.' 1>&2
33+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
34+
echo 'skipping ocsp-stapling_tls13multi.test because client not compiled in.' 1>&2
3535
exit 77
3636
fi
3737

38-
if ! ./examples/server/server | grep "Server not compiled in!" ; then
39-
echo 'skipping crl-revoked.test because server not compiled in.' 1>&2
38+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
39+
echo 'skipping ocsp-stapling_tls13multi.test because server not compiled in.' 1>&2
4040
exit 77
4141
fi
4242

scripts/pkcallbacks.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \
66
&& exit 1
77

8-
if ! ./examples/client/client | grep "Client not compiled in!" ; then
8+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
99
echo 'skipping pkcallbacks.test because client not compiled in.' 1>&2
1010
exit 77
1111
fi
1212

13+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
14+
echo 'skipping pkcallbacks.test because server not compiled in.' 1>&2
15+
exit 77
16+
fi
17+
1318
# if we can, isolate the network namespace to eliminate port collisions.
1419
if [[ -n "$NETWORK_UNSHARE_HELPER" ]]; then
1520
if [[ -z "$NETWORK_UNSHARE_HELPER_CALLED" ]]; then

scripts/rsapss.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
# rsapss.test
44

5+
[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \
6+
&& exit 1
7+
8+
if ./examples/client/client -? 2>&1 | grep "Client not compiled in!" ; then
9+
echo 'skipping rsapss.test because client not compiled in.' 1>&2
10+
exit 77
11+
fi
12+
13+
if ./examples/server/server -? 2>&1 | grep "Server not compiled in!" ; then
14+
echo 'skipping rsapss.test because server not compiled in.' 1>&2
15+
exit 77
16+
fi
17+
518
if ! ./examples/client/client -V | grep -q 4; then
619
echo "skipping because TLS 1.3 not enabled in this build"
720
exit 0

0 commit comments

Comments
 (0)