From e2baee6c4d57afc582d1544076669bd9eea4f9b4 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 7 Aug 2019 13:55:08 -0400
Subject: [PATCH] Make the test pass by waiting a little longer.

Also, comments.
---
 nixos/modules/tests/private-storage.nix | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/nixos/modules/tests/private-storage.nix b/nixos/modules/tests/private-storage.nix
index 048646a1..0838de10 100644
--- a/nixos/modules/tests/private-storage.nix
+++ b/nixos/modules/tests/private-storage.nix
@@ -13,8 +13,19 @@ import <nixpkgs/nixos/tests/make-test.nix> {
   # Test the machine with a Perl program (sobbing).
   testScript =
     ''
+      # Boot the VM.
       $machine->start;
+
+      # The systemd unit should reach the running state.
       $machine->waitForUnit("tahoe.storage.service");
+
+      # Some while after that the Tahoe-LAFS node should listen on the web API
+      # port. The port number here has to agree with the port number set in
+      # the private-storage.nix module.
+      $machine->waitForOpenPort(3456);
+
+      # Once the web API is listening it should be possible to scrape some
+      # status from the node if it is really working.
       $machine->succeed("tahoe -d /var/db/tahoe-lafs/storage status");
     '';
 }
-- 
GitLab