summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/interop/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libssl/interop/Makefile.inc')
-rw-r--r--src/regress/lib/libssl/interop/Makefile.inc57
1 files changed, 43 insertions, 14 deletions
diff --git a/src/regress/lib/libssl/interop/Makefile.inc b/src/regress/lib/libssl/interop/Makefile.inc
index f209bdbd91..1a1ef30ca6 100644
--- a/src/regress/lib/libssl/interop/Makefile.inc
+++ b/src/regress/lib/libssl/interop/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.2 2018/11/07 06:29:26 bluhm Exp $ 1# $OpenBSD: Makefile.inc,v 1.3 2018/11/07 20:46:28 bluhm Exp $
2 2
3.PATH: ${.CURDIR}/.. 3.PATH: ${.CURDIR}/..
4 4
@@ -18,43 +18,72 @@ ldd-$p.out: $p
18 18
19# run netcat server and connect with test client 19# run netcat server and connect with test client
20 20
21CLEANFILES += client.out netcat-l.out netcat-l.fstat 21CLEANFILES += nc-client.out netcat-l.out netcat-l.fstat
22REGRESS_TARGETS += run-client 22REGRESS_TARGETS += run-client
23client.out run-client: client 127.0.0.1.crt 23nc-client.out run-client: client 127.0.0.1.crt
24 @echo '\n======== $@ ========' 24 @echo '\n======== $@ ========'
25 echo "greeting" | nc -l -c -C 127.0.0.1.crt -K 127.0.0.1.key \ 25 echo "greeting" | nc -l -c -C 127.0.0.1.crt -K 127.0.0.1.key \
26 127.0.0.1 0 >netcat-l.out & \ 26 127.0.0.1 0 >netcat-l.out & \
27 sleep 1; fstat -p $$! >netcat-l.fstat 27 sleep 1; fstat -p $$! >netcat-l.fstat
28 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./client \ 28 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./client \
29 `sed -n 's/.* stream tcp .*:/127.0.0.1 /p' netcat-l.fstat` \ 29 `sed -n 's/.* stream tcp .*:/127.0.0.1 /p' netcat-l.fstat` \
30 >client.out 30 >nc-client.out
31 # check that the client run successfully to the end 31 # check that the client run successfully to the end
32 grep -q '^success$$' client.out 32 grep -q '^success$$' nc-client.out
33 # client must have read server greeting 33 # client must have read server greeting
34 grep -q '^<<< greeting$$' client.out 34 grep -q '^<<< greeting$$' nc-client.out
35 # netstat server must have read client hello 35 # netstat server must have read client hello
36 grep -q '^hello$$' netcat-l.out 36 grep -q '^hello$$' netcat-l.out
37 37
38# run test server and connect with netcat client 38# run test server and connect with netcat client
39 39
40CLEANFILES += server.out netcat.out 40CLEANFILES += nc-server.out netcat.out
41REGRESS_TARGETS += run-server 41REGRESS_TARGETS += run-server
42server.out run-server: server 127.0.0.1.crt 42nc-server.out run-server: server 127.0.0.1.crt
43 @echo '\n======== $@ ========' 43 @echo '\n======== $@ ========'
44 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./server 127.0.0.1 0 >server.out 44 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./server 127.0.0.1 0 \
45 >nc-server.out
45 echo "hello" | nc -c -T noverify \ 46 echo "hello" | nc -c -T noverify \
46 `sed -n 's/listen sock: //p' server.out` \ 47 `sed -n 's/listen sock: //p' nc-server.out` \
47 >netcat.out 48 >netcat.out
48 # check that the server child run successfully to the end 49 # check that the server child run successfully to the end
49 grep -q '^success$$' server.out 50 grep -q '^success$$' nc-server.out
50 # server must have read client hello 51 # server must have read client hello
51 grep -q '^<<< hello$$' server.out 52 grep -q '^<<< hello$$' nc-server.out
52 # client must have read server greeting 53 # client must have read server greeting
53 grep -q '^greeting$$' netcat.out 54 grep -q '^greeting$$' netcat.out
54 55
55# check that programs have used correct runtime library 56# run test server and with test client, self test the ssl library
56 57
57REGRESS_TARGETS += ${PROGS:S/^/run-version-/} 58CLEANFILES += self-client.out self-server.out
59REGRESS_TARGETS += run-self
60self-client.out self-server.out run-self: client server 127.0.0.1.crt
61 @echo '\n======== $@ ========'
62 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./server 127.0.0.1 0 \
63 >self-server.out
64 LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./client \
65 `sed -n 's/listen sock: //p' self-server.out` \
66 >self-client.out
67 # check that the client run successfully to the end
68 grep -q '^success$$' self-client.out
69 # client must have read server greeting
70 grep -q '^<<< greeting$$' self-client.out
71 # check that the server child run successfully to the end
72 grep -q '^success$$' self-server.out
73 # server must have read client hello
74 grep -q '^<<< hello$$' self-server.out
75
76.for o in nc-client nc-server self-client self-server
77
78# check that client and server have used correct runtime library
79
80REGRESS_TARGETS += run-version-$o
81
82# check that client and server have used correct TLS protocol
83
84REGRESS_TARGETS += run-protocol-$o
85
86.endfor
58 87
59# create certificates for TLS 88# create certificates for TLS
60 89