mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
27 lines
725 B
Nix
27 lines
725 B
Nix
|
import ./make-test.nix ({ lib, ... }:
|
||
|
|
||
|
{
|
||
|
name = "mailcatcher";
|
||
|
meta.maintainers = [ lib.maintainers.aanderse ];
|
||
|
|
||
|
machine =
|
||
|
{ pkgs, ... }:
|
||
|
{
|
||
|
services.mailcatcher.enable = true;
|
||
|
|
||
|
networking.defaultMailServer.directDelivery = true;
|
||
|
networking.defaultMailServer.hostName = "localhost:1025";
|
||
|
|
||
|
environment.systemPackages = [ pkgs.mailutils ];
|
||
|
};
|
||
|
|
||
|
testScript = ''
|
||
|
startAll;
|
||
|
|
||
|
$machine->waitForUnit('mailcatcher.service');
|
||
|
$machine->waitForOpenPort('1025');
|
||
|
$machine->succeed('echo "this is the body of the email" | mail -s "subject" root@example.org');
|
||
|
$machine->succeed('curl http://localhost:1080/messages/1.json') =~ /this is the body of the email/ or die;
|
||
|
'';
|
||
|
})
|