2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-23 22:23:15 +00:00
nixpkgs/nixos/tests/mailcatcher.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
730 B
Nix
Raw Normal View History

import ./make-test-python.nix ({ lib, ... }:
2019-03-27 11:35:24 +00:00
{
name = "mailcatcher";
meta.maintainers = [ lib.maintainers.aanderse ];
2022-03-20 23:15:30 +00:00
nodes.machine =
2019-03-27 11:35:24 +00:00
{ pkgs, ... }:
{
services.mailcatcher.enable = true;
services.ssmtp.enable = true;
services.ssmtp.hostName = "localhost:1025";
2019-03-27 11:35:24 +00:00
environment.systemPackages = [ pkgs.mailutils ];
};
testScript = ''
start_all()
2019-03-27 11:35:24 +00:00
machine.wait_for_unit("mailcatcher.service")
machine.wait_for_open_port("1025")
machine.succeed(
'echo "this is the body of the email" | mail -s "subject" root@example.org'
)
assert "this is the body of the email" in machine.succeed(
"curl -f http://localhost:1080/messages/1.source"
)
2019-03-27 11:35:24 +00:00
'';
})