mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
nixos/mailcatcher: add nixos test
This commit is contained in:
parent
395ec8c0d4
commit
c99ea1c203
@ -131,6 +131,7 @@ in
|
||||
#lightdm = handleTest ./lightdm.nix {};
|
||||
login = handleTest ./login.nix {};
|
||||
#logstash = handleTest ./logstash.nix {};
|
||||
mailcatcher = handleTest ./mailcatcher.nix {};
|
||||
mathics = handleTest ./mathics.nix {};
|
||||
matrix-synapse = handleTest ./matrix-synapse.nix {};
|
||||
memcached = handleTest ./memcached.nix {};
|
||||
|
26
nixos/tests/mailcatcher.nix
Normal file
26
nixos/tests/mailcatcher.nix
Normal file
@ -0,0 +1,26 @@
|
||||
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;
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user