From bf98328f8a45d5cf883584aab1a544fb1521f9c2 Mon Sep 17 00:00:00 2001 From: bluhm Date: Tue, 18 Apr 2023 19:41:50 +0000 Subject: [PATCH] Skip all tests that need internet connection unless they have it. Run reachability ping only once. Fix clean files and always run make obj. Do not suppress messages from redirectchain test. --- regress/usr.sbin/rpki-client/Makefile.inc | 6 ++-- .../usr.sbin/rpki-client/libressl/Makefile | 28 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/regress/usr.sbin/rpki-client/Makefile.inc b/regress/usr.sbin/rpki-client/Makefile.inc index 2c487ab61ee..0e402ce0c45 100644 --- a/regress/usr.sbin/rpki-client/Makefile.inc +++ b/regress/usr.sbin/rpki-client/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.30 2023/03/12 11:55:34 job Exp $ +# $OpenBSD: Makefile.inc,v 1.31 2023/04/18 19:41:50 bluhm Exp $ .PATH: ${.CURDIR}/../../../../usr.sbin/rpki-client @@ -22,6 +22,8 @@ CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../../usr.sbin/rpki-client LDADD+= -lcrypto -lutil DPADD+= ${LIBCRYPTO} ${LIBUTIL} +CLEANFILES+= *.out *.err *.txt + SRCS_test-ip += test-ip.c ip.c io.c encoding.c print.c x509.c \ log.c validate.c as.c cert.c cms.c crl.c mft.c run-regress-test-ip: test-ip @@ -90,7 +92,7 @@ run-regress-test-rrdp: test-rrdp ./test-rrdp -S 8fe05c2e-047d-49e7-8398-cd4250a572b1 -N 50500 \ -n < ${.CURDIR}/../rrdp/notification.xml 2>&1 | tee rrdp-r2.out cmp ${.CURDIR}/../rrdp/rrdp-r2.out rrdp-r2.out - + ./test-rrdp -S 9b3f7e31-4979-4f8c-9818-73e4dadc3e6b -N 13755 \ -H 75416a54d1bb47f4f4dec7696bd33f77aa3a4a09a295b7f1a027841af0b50c1b \ -d < ${.CURDIR}/../rrdp/delta.xml 2>&1 | tee rrdp-r3.out diff --git a/regress/usr.sbin/rpki-client/libressl/Makefile b/regress/usr.sbin/rpki-client/libressl/Makefile index 2eb016803e8..89ef279838e 100644 --- a/regress/usr.sbin/rpki-client/libressl/Makefile +++ b/regress/usr.sbin/rpki-client/libressl/Makefile @@ -1,19 +1,19 @@ -# $OpenBSD: Makefile,v 1.8 2023/01/04 14:27:00 claudio Exp $ +# $OpenBSD: Makefile,v 1.9 2023/04/18 19:41:50 bluhm Exp $ -PROGS += test-http +PROGS += test-http -SRCS_test-http= test-http.c http.c io.c encoding.c -LDADD_test-http+= -ltls -lssl -lcrypto -lutil -DPADD_test-http+= ${LIBTLS} ${LIBSSL} ${LIBCRYPTO} ${LIBUTIL} +SRCS_test-http = test-http.c http.c io.c encoding.c +LDADD_test-http = -ltls -lssl -lcrypto -lutil +DPADD_test-http = ${LIBTLS} ${LIBSSL} ${LIBCRYPTO} ${LIBUTIL} SERVER = jigsaw.w3.org -REACHABLE = -.if make(run-regress-test-http) -REACHABLE != ! ping -n -c 1 -w 1 ${SERVER} >/dev/null || echo yes +.if ! (make(clean) || make(cleandir) || make(obj)) +REACHABLE !?= ! ping -n -c 1 -w 1 ${SERVER} >/dev/null || echo yes +.MAKEFLAGS := REACHABLE=${REACHABLE} .endif run-regress-test-http: test-http -.if ${REACHABLE:L} == "yes" +.if "${REACHABLE:L}" == "yes" ./test-http https://${SERVER}/HTTP/TE/foo.txt foo.txt ./test-http https://${SERVER}/HTTP/ChunkedScript chunk.out ./test-http https://${SERVER}/HTTP/300/307.html redir.out @@ -25,7 +25,15 @@ run-regress-test-http: test-http REGRESS_TARGETS+= run-regress-test-http-redirectchain run-regress-test-http-redirectchain: test-http - ./test-http 'https://demo.cyotek.com/features/redirectchaintest.php?index=1' redirloop.out 2>&1 | grep -q 'Too many redirections requested' +.if "${REACHABLE:L}" == "yes" + ./test-http \ + 'https://demo.cyotek.com/features/redirectchaintest.php?index=1' \ + redirloop.out 2>&1 | tee redirloop.err + grep -q 'Too many redirections requested' redirloop.err +.else + # server ${SERVER} not reachable + @echo SKIPPED +.endif .PATH: ${.CURDIR}/.. -- 2.20.1