mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-24 01:23:24 +01:00
Simple test if the service comes up and the CLI can interact with it and gives reasonable results.
30 lines
517 B
Nix
30 lines
517 B
Nix
{
|
|
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))
|
|
|
|
'';
|
|
|
|
}
|