mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
parent
88186e0321
commit
6b63b4a2f5
2 changed files with 28 additions and 30 deletions
|
@ -741,7 +741,7 @@ in
|
||||||
magnetico = handleTest ./magnetico.nix { };
|
magnetico = handleTest ./magnetico.nix { };
|
||||||
mailcatcher = runTest ./mailcatcher.nix;
|
mailcatcher = runTest ./mailcatcher.nix;
|
||||||
mailhog = handleTest ./mailhog.nix { };
|
mailhog = handleTest ./mailhog.nix { };
|
||||||
mailpit = handleTest ./mailpit.nix { };
|
mailpit = runTest ./mailpit.nix;
|
||||||
mailman = handleTest ./mailman.nix { };
|
mailman = handleTest ./mailman.nix { };
|
||||||
man = handleTest ./man.nix { };
|
man = handleTest ./man.nix { };
|
||||||
mariadb-galera = handleTest ./mysql/mariadb-galera.nix { };
|
mariadb-galera = handleTest ./mysql/mariadb-galera.nix { };
|
||||||
|
|
|
@ -1,35 +1,33 @@
|
||||||
import ./make-test-python.nix (
|
{ lib, ... }:
|
||||||
{ lib, ... }:
|
{
|
||||||
{
|
name = "mailpit";
|
||||||
name = "mailpit";
|
meta.maintainers = lib.teams.flyingcircus.members;
|
||||||
meta.maintainers = lib.teams.flyingcircus.members;
|
|
||||||
|
|
||||||
nodes.machine =
|
nodes.machine =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.mailpit.instances.default = { };
|
services.mailpit.instances.default = { };
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ swaks ];
|
environment.systemPackages = with pkgs; [ swaks ];
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
machine.wait_for_unit("mailpit-default.service")
|
machine.wait_for_unit("mailpit-default.service")
|
||||||
machine.wait_for_open_port(1025)
|
machine.wait_for_open_port(1025)
|
||||||
machine.wait_for_open_port(8025)
|
machine.wait_for_open_port(8025)
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
'echo "this is the body of the email" | swaks --to root@example.org --body - --server localhost:1025'
|
'echo "this is the body of the email" | swaks --to root@example.org --body - --server localhost:1025'
|
||||||
)
|
)
|
||||||
|
|
||||||
received = loads(machine.succeed("curl http://localhost:8025/api/v1/messages"))
|
received = loads(machine.succeed("curl http://localhost:8025/api/v1/messages"))
|
||||||
assert received['total'] == 1
|
assert received['total'] == 1
|
||||||
message = received["messages"][0]
|
message = received["messages"][0]
|
||||||
assert len(message['To']) == 1
|
assert len(message['To']) == 1
|
||||||
assert message['To'][0]['Address'] == 'root@example.org'
|
assert message['To'][0]['Address'] == 'root@example.org'
|
||||||
assert "this is the body of the email" in message['Snippet']
|
assert "this is the body of the email" in message['Snippet']
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue