at 23.11-pre 686 B view raw
1import ./make-test-python.nix ({ lib, ... }: { 2 name = "mailhog"; 3 meta.maintainers = with lib.maintainers; [ jojosch ]; 4 5 nodes.machine = { pkgs, ... }: { 6 services.mailhog.enable = true; 7 8 environment.systemPackages = with pkgs; [ swaks ]; 9 }; 10 11 testScript = '' 12 start_all() 13 14 machine.wait_for_unit("mailhog.service") 15 machine.wait_for_open_port(1025) 16 machine.wait_for_open_port(8025) 17 machine.succeed( 18 'echo "this is the body of the email" | swaks --to root@example.org --body - --server localhost:1025' 19 ) 20 assert "this is the body of the email" in machine.succeed( 21 "curl --fail http://localhost:8025/api/v2/messages" 22 ) 23 ''; 24})