ac3a84
From c1a79dbfdf667e965d8d390e6d395b64de1e2253 Mon Sep 17 00:00:00 2001
ac3a84
From: Frantisek Sumsal <frantisek@sumsal.cz>
ac3a84
Date: Fri, 8 Jul 2022 20:23:13 +0200
ac3a84
Subject: [PATCH] test: add a test for the OPENPGPKEY RR
ac3a84
ac3a84
(cherry picked from commit 05bb428952d0a91c53398e8b20801af9fb7530f1)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 test/knot-data/zones/signed.test.zone | 14 ++++++++++++++
ac3a84
 test/units/testsuite-75.sh            |  6 ++++++
ac3a84
 2 files changed, 20 insertions(+)
ac3a84
ac3a84
diff --git a/test/knot-data/zones/signed.test.zone b/test/knot-data/zones/signed.test.zone
ac3a84
index 6ddeb0048e..a2baac4284 100644
ac3a84
--- a/test/knot-data/zones/signed.test.zone
ac3a84
+++ b/test/knot-data/zones/signed.test.zone
ac3a84
@@ -57,3 +57,17 @@ _mysvc._tcp           SRV   10 5 1234 myservice
ac3a84
 _invalidsvc._udp      SRV   5 5 1111 invalidservice
ac3a84
 
ac3a84
 _untrustedsvc._udp    SRV   5 5 1111 myservice.untrusted.test.
ac3a84
+
ac3a84
+; OPENPGPKEY RR for mr.smith@signed.test
ac3a84
+; The hash was generated using `echo -ne mr.smith | sha256sum | head -c56`
ac3a84
+; and exported via `gpg --export mr.smith | base64`
ac3a84
+5a786cdc59c161cdafd818143705026636962198c66ed4c5b3da321e._openpgpkey OPENPGPKEY (
ac3a84
+    mDMEYshhzhYJKwYBBAHaRw8BAQdAuU2RxKaycSdaR5YZ/q+/yoHeil/1WNRDVbpjPSd6QBa0GW1y
ac3a84
+    LnNtaXRoQHNpZ25lZC50ZXN0LnpvbmWImQQTFggAQRYhBIOXLJwlwowvXQVeJ3d9yvMKUDBWBQJi
ac3a84
+    yGHOAhsDBQkDwmcABQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEHd9yvMKUDBWo6MA/2oC
ac3a84
+    zdnzMlK9gM5bNCFfPyagJfFfv7fW1l7WXTve6FJtAP0faW24ahE1okjmrsTUwqZHvDThysW5zTSt
ac3a84
+    j49S3JQDA7g4BGLIYc4SCisGAQQBl1UBBQEBB0CuNcTAt5AUE3seFN/Gm2euC+8dgtztyzoO/78K
ac3a84
+    ictFLAMBCAeIeAQYFggAIBYhBIOXLJwlwowvXQVeJ3d9yvMKUDBWBQJiyGHOAhsMAAoJEHd9yvMK
ac3a84
+    UDBWtxkA/jlbUgHpSoTKFNNTeXYbTz9jnoupe9eT4O3tU55ofwO7AQCa5ntSIuzDJ1E2iy7oOLOZ
ac3a84
+    m2ocNqpC7SULHhSKYfUWDg==
ac3a84
+)
ac3a84
diff --git a/test/units/testsuite-75.sh b/test/units/testsuite-75.sh
ac3a84
index 66cc6c9d66..d36cab2923 100755
ac3a84
--- a/test/units/testsuite-75.sh
ac3a84
+++ b/test/units/testsuite-75.sh
ac3a84
@@ -380,6 +380,12 @@ grep -qF "myservice.untrusted.test:1111" "$RUN_OUT"
ac3a84
 grep -qF "10.0.0.123" "$RUN_OUT"
ac3a84
 grep -qF "fd00:dead:beef:cafe::123" "$RUN_OUT"
ac3a84
 grep -qF "authenticated: yes" "$RUN_OUT"
ac3a84
+# Check OPENPGPKEY support
ac3a84
+run delv -t OPENPGPKEY 5a786cdc59c161cdafd818143705026636962198c66ed4c5b3da321e._openpgpkey.signed.test
ac3a84
+grep -qF "; fully validated" "$RUN_OUT"
ac3a84
+run resolvectl openpgp mr.smith@signed.test
ac3a84
+grep -qF "5a786cdc59c161cdafd818143705026636962198c66ed4c5b3da321e._openpgpkey.signed.test" "$RUN_OUT"
ac3a84
+grep -qF "authenticated: yes" "$RUN_OUT"
ac3a84
 
ac3a84
 # DNSSEC validation with multiple records of the same type for the same name
ac3a84
 # Issue: https://github.com/systemd/systemd/issues/22002