aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-21 18:52:08 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-21 19:41:40 +0100
commit16f7d75ac8e46a7905779931c871ac85c7e1aa04 (patch)
tree05121156353a42c81b139b5d45e515dc287bd9fe /tests
parentd56b957dbae6c8214d50ce88d0ea04eb4654b843 (diff)
Add IPC tests with an old lacme(8) resp. lacme-accountd(1).
Diffstat (limited to 'tests')
-rw-r--r--tests/old-accountd29
-rw-r--r--tests/old-lacme36
2 files changed, 65 insertions, 0 deletions
diff --git a/tests/old-accountd b/tests/old-accountd
new file mode 100644
index 0000000..e7ccc0a
--- /dev/null
+++ b/tests/old-accountd
@@ -0,0 +1,29 @@
+# IPC test between lacme(8) and ancient lacme-accountd(1) 0.2 from Debian jessie
+
+adduser --disabled-password \
+ --home /home/lacme-account \
+ --gecos "lacme account user" \
+ --quiet lacme-account
+
+install -olacme-account -glacme-account -Ddm0700 -- ~lacme-account/.config/lacme
+chown lacme-account: /etc/lacme/account.key
+
+cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
+ privkey = file:/etc/lacme/account.key
+EOF
+
+echo "deb http://deb.debian.org/debian stretch main" >>/etc/apt/sources.list
+DEBIAN_FRONTEND="noninteractive" apt update
+DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends --reinstall \
+ -oDPkg::Options::="--force-confdef" -oDPkg::Options::="--force-overwrite" \
+ lacme-accountd/stretch
+
+SOCKET=~lacme-account/S.lacme
+runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" & PID=$!
+lacme --socket="$SOCKET" account
+lacme --socket="$SOCKET" newOrder
+
+kill $PID
+wait
+
+# vim: set filetype=sh :
diff --git a/tests/old-lacme b/tests/old-lacme
new file mode 100644
index 0000000..16a647d
--- /dev/null
+++ b/tests/old-lacme
@@ -0,0 +1,36 @@
+# IPC test between recent lacme-accountd(1) and ancient lacme(8) 0.5 from Debian buster
+# (we don't try earlier versions as we need v2 support of the ACME API)
+
+adduser --disabled-password \
+ --home /home/lacme-account \
+ --gecos "lacme account user" \
+ --quiet lacme-account
+
+install -olacme-account -glacme-account -Ddm0700 -- ~lacme-account/.config/lacme
+chown lacme-account: /etc/lacme/account.key
+mv -f /usr/share/lacme/ca-certificates.crt /usr/share/lacme/ca-certificates.crt.back
+
+cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
+ privkey = file:/etc/lacme/account.key
+EOF
+
+echo "deb http://deb.debian.org/debian buster main" >>/etc/apt/sources.list
+DEBIAN_FRONTEND="noninteractive" apt update
+DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends --reinstall \
+ -oDPkg::Options::="--force-confdef" -oDPkg::Options::="--force-overwrite" \
+ lacme/buster
+
+# restore staging environment
+sed -ri '0,\|^#?server\s*=.*| {s||server = https://acme-staging-v02.api.letsencrypt.org/directory|}' /etc/lacme/lacme.conf
+mv -f /usr/share/lacme/ca-certificates.crt.back /usr/share/lacme/ca-certificates.crt
+
+SOCKET=~lacme-account/S.lacme
+runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" & PID=$!
+sed -ri "s/^\[accountd]$/#&/" /etc/lacme/lacme.conf # https://bugs.debian.org/955767
+lacme --socket="$SOCKET" account
+lacme --socket="$SOCKET" newOrder
+
+kill $PID
+wait
+
+# vim: set filetype=sh :