From 1f2030fdcb2ae86a821d44a40509b0c479c06055 Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Sun, 15 Dec 2019 15:21:38 +0100 Subject: nixosTests.mailcatcher: Port tests to python --- nixos/tests/mailcatcher.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'nixos/tests/mailcatcher.nix') diff --git a/nixos/tests/mailcatcher.nix b/nixos/tests/mailcatcher.nix index eb5b606ecc8..2ef38544fe0 100644 --- a/nixos/tests/mailcatcher.nix +++ b/nixos/tests/mailcatcher.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ lib, ... }: +import ./make-test-python.nix ({ lib, ... }: { name = "mailcatcher"; @@ -16,11 +16,15 @@ import ./make-test.nix ({ lib, ... }: }; testScript = '' - startAll; + start_all() - $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.source') =~ /this is the body of the email/ or die; + machine.wait_for_unit("mailcatcher.service") + machine.wait_for_open_port("1025") + machine.succeed( + '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 http://localhost:1080/messages/1.source" + ) ''; }) -- cgit 1.4.1