aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cert-renew
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-19 23:22:15 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-20 20:16:29 +0100
commit11d971bc07ceb4359565e6611ae03a0c0134d153 (patch)
treeaf2e01a8304db84357a6677ad84b9ab96eb18dfe /tests/cert-renew
parentc214f20a835d0da4bd0c5a85a4bd9089fc4febcb (diff)
Add test suite against Let's Encrypt's staging environment.
https://letsencrypt.org/docs/staging-environment/
Diffstat (limited to 'tests/cert-renew')
-rw-r--r--tests/cert-renew21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/cert-renew b/tests/cert-renew
new file mode 100644
index 0000000..aca1b34
--- /dev/null
+++ b/tests/cert-renew
@@ -0,0 +1,21 @@
+# Skip renewal for recent enough certificates
+
+lacme newOrder 2>"$STDERR" || fail
+grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
+ino1="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
+
+lacme newOrder 2>"$STDERR" || fail
+grepstderr -Ex "^\[simpletest-rsa\] Valid until .*, skipping"
+
+lacme newOrder --force 2>"$STDERR" || fail
+grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
+ino2="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
+test "$ino1" != "$ino2" # we never truncate existing certificates
+
+sed -ri 's|^#?min-days\s*=.*|min-days = 90|' /etc/lacme/lacme-certs.conf
+lacme newOrder 2>"$STDERR" || fail
+grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
+ino3="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
+test "$ino2" != "$ino3" # we never truncate existing certificates
+
+# vim: set filetype=sh :