mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
nixos/tests/postfix-tlspol: init
Simple test if the service comes up and the CLI can interact with it and
gives reasonable results.
(cherry picked from commit 2288aab12d)
This commit is contained in:
@@ -1086,6 +1086,7 @@ in
|
||||
handleTest ./postfix-raise-smtpd-tls-security-level.nix
|
||||
{ };
|
||||
postfixadmin = handleTest ./postfixadmin.nix { };
|
||||
postfix-tlspol = runTest ./postfix-tlspol.nix;
|
||||
postgres-websockets = runTest ./postgres-websockets.nix;
|
||||
postgresql = handleTest ./postgresql { };
|
||||
postgrest = runTest ./postgrest.nix;
|
||||
|
||||
29
nixos/tests/postfix-tlspol.nix
Normal file
29
nixos/tests/postfix-tlspol.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "postfix-tlspol";
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ hexa ];
|
||||
|
||||
nodes.machine = {
|
||||
services.postfix-tlspol.enable = true;
|
||||
};
|
||||
|
||||
enableOCR = true;
|
||||
|
||||
testScript = ''
|
||||
import json
|
||||
|
||||
machine.wait_for_unit("postfix-tlspol.service")
|
||||
|
||||
with subtest("Interact with the service"):
|
||||
machine.succeed("postfix-tlspol -purge")
|
||||
|
||||
response = json.loads((machine.succeed("postfix-tlspol -query localhost")))
|
||||
machine.log(json.dumps(response, indent=2))
|
||||
|
||||
'';
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -22,6 +23,10 @@ buildGoModule rec {
|
||||
|
||||
ldflags = [ "-X main.Version=${version}" ];
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) postfix-tlspol;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Lightweight MTA-STS + DANE/TLSA resolver and TLS policy server for Postfix, prioritizing DANE.";
|
||||
homepage = "https://github.com/Zuplu/postfix-tlspol";
|
||||
|
||||
Reference in New Issue
Block a user