mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
parent
1c2f1b30b5
commit
1004fff704
2 changed files with 29 additions and 31 deletions
|
@ -678,7 +678,7 @@ in {
|
||||||
maestral = handleTest ./maestral.nix {};
|
maestral = handleTest ./maestral.nix {};
|
||||||
magic-wormhole-mailbox-server = handleTest ./magic-wormhole-mailbox-server.nix {};
|
magic-wormhole-mailbox-server = handleTest ./magic-wormhole-mailbox-server.nix {};
|
||||||
magnetico = handleTest ./magnetico.nix {};
|
magnetico = handleTest ./magnetico.nix {};
|
||||||
mailcatcher = handleTest ./mailcatcher.nix {};
|
mailcatcher = runTest ./mailcatcher.nix;
|
||||||
mailhog = handleTest ./mailhog.nix {};
|
mailhog = handleTest ./mailhog.nix {};
|
||||||
mailpit = handleTest ./mailpit.nix {};
|
mailpit = handleTest ./mailpit.nix {};
|
||||||
mailman = handleTest ./mailman.nix {};
|
mailman = handleTest ./mailman.nix {};
|
||||||
|
|
|
@ -1,37 +1,35 @@
|
||||||
import ./make-test-python.nix (
|
{ lib, ... }:
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "mailcatcher";
|
name = "mailcatcher";
|
||||||
meta.maintainers = [ lib.maintainers.aanderse ];
|
meta.maintainers = [ lib.maintainers.aanderse ];
|
||||||
|
|
||||||
nodes.machine =
|
nodes.machine =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.mailcatcher.enable = true;
|
services.mailcatcher.enable = true;
|
||||||
|
|
||||||
programs.msmtp = {
|
programs.msmtp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
accounts.default = {
|
accounts.default = {
|
||||||
host = "localhost";
|
host = "localhost";
|
||||||
port = 1025;
|
port = 1025;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.mailutils ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
environment.systemPackages = [ pkgs.mailutils ];
|
||||||
start_all()
|
};
|
||||||
|
|
||||||
machine.wait_for_unit("mailcatcher.service")
|
testScript = ''
|
||||||
machine.wait_for_open_port(1025)
|
start_all()
|
||||||
machine.succeed(
|
|
||||||
'echo "this is the body of the email" | mail -s "subject" root@example.org'
|
machine.wait_for_unit("mailcatcher.service")
|
||||||
)
|
machine.wait_for_open_port(1025)
|
||||||
assert "this is the body of the email" in machine.succeed(
|
machine.succeed(
|
||||||
"curl -f http://localhost:1080/messages/1.source"
|
'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"
|
||||||
)
|
)
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue