nixos/tests/postfix-tlspol: assert empty policies for localhost

This commit is contained in:
Martin Weinelt 2025-06-29 00:01:13 +02:00
parent 7874cc6005
commit d0218043a9
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -10,9 +10,12 @@
nodes.machine = {
services.postfix.enable = true;
services.postfix-tlspol.enable = true;
};
enableOCR = true;
services.dnsmasq = {
enable = true;
settings.selfmx = true;
};
};
testScript = ''
import json
@ -26,6 +29,8 @@
response = json.loads((machine.succeed("postfix-tlspol -query localhost")))
machine.log(json.dumps(response, indent=2))
assert response["dane"]["policy"] == "", f"Unexpected DANE policy for localhost: {response["dane"]["policy"]}"
assert response["mta-sts"]["policy"] == "", f"Unexpected MTA-STS policy for localhost: {response["mta-sts"]["policy"]}"
machine.log(machine.execute("systemd-analyze security postfix-tlspol.service | grep -v ")[1])
'';