summary refs log tree commit diff
path: root/nixos/tests/mailcatcher.nix
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2019-12-15 15:21:38 +0100
committerChristian Kampka <christian@kampka.net>2019-12-16 12:52:30 +0100
commit1f2030fdcb2ae86a821d44a40509b0c479c06055 (patch)
tree21cc775a1f294accd66da753cb67421428049bc8 /nixos/tests/mailcatcher.nix
parent23d164edb4999c7e77951bdb21b162bb940b7e3c (diff)
downloadnixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar.gz
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar.bz2
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar.lz
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar.xz
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.tar.zst
nixpkgs-1f2030fdcb2ae86a821d44a40509b0c479c06055.zip
nixosTests.mailcatcher: Port tests to python
Diffstat (limited to 'nixos/tests/mailcatcher.nix')
-rw-r--r--nixos/tests/mailcatcher.nix16
1 files changed, 10 insertions, 6 deletions
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"
+    )
   '';
 })