diff options
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r-- | regress/usr.sbin/acme-client/Makefile | 27 | ||||
-rw-r--r-- | regress/usr.sbin/acme-client/create-httpd-env.sh | 16 |
2 files changed, 43 insertions, 0 deletions
diff --git a/regress/usr.sbin/acme-client/Makefile b/regress/usr.sbin/acme-client/Makefile new file mode 100644 index 00000000000..a5485588785 --- /dev/null +++ b/regress/usr.sbin/acme-client/Makefile @@ -0,0 +1,27 @@ +REGRESS_TARGETS=acme + +acme: start_httpd + /usr/sbin/acme-client \ + -C ${.OBJDIR}/www/acme \ + -c ${.OBJDIR}/etc/ssl/acme \ + -f ${.OBJDIR}/etc/acme/privkey.pem \ + -k ${.OBJDIR}/etc/ssl/acme/private/privkey.pem \ + -nNv -s letsencrypt-staging `hostname` + /usr/sbin/acme-client \ + -C ${.OBJDIR}/www/acme \ + -c ${.OBJDIR}/etc/ssl/acme \ + -f ${.OBJDIR}/etc/acme/privkey.pem \ + -k ${.OBJDIR}/etc/ssl/acme/private/privkey.pem \ + -rv -s letsencrypt-staging `hostname` + pkill -xf "/usr/sbin/httpd -f ${.OBJDIR}/etc/httpd.conf" + +start_httpd: + sh ${.CURDIR}/create-httpd-env.sh ${.OBJDIR} + /bin/echo `/bin/hostname` + /usr/sbin/httpd -f ${.OBJDIR}/etc/httpd.conf + sleep .1 # give httpd some time to spin up + pgrep -xf "/usr/sbin/httpd -f ${.OBJDIR}/etc/httpd.conf" + +.PHONY: ${REGRESS_TARGETS} start_httpd + +.include <bsd.regress.mk> diff --git a/regress/usr.sbin/acme-client/create-httpd-env.sh b/regress/usr.sbin/acme-client/create-httpd-env.sh new file mode 100644 index 00000000000..af3a7076602 --- /dev/null +++ b/regress/usr.sbin/acme-client/create-httpd-env.sh @@ -0,0 +1,16 @@ +set -e +mkdir -p $1/www/htdocs +mkdir -p $1/www/acme +mkdir -p $1/www/logs +mkdir -p $1/etc/acme +mkdir -p $1/etc/ssl/acme/private +cat <<END > $1/etc/httpd.conf +chroot "$1/www" +server "default" { + listen on "*" port 80 + location "/.well-known/acme-challenge/*" { + root "/acme" + root strip 2 + } +} +END |