Author: eelco
Date: Mon Aug 29 14:23:26 2011
New Revision: 28877
URL: https://svn.nixos.org/websvn/nix/?rev=28877&sc=1

Log:
* Make some tests more robust.  In particular, tests should make sure
  that the network-interfaces job is up before accessing the network.

Modified:
   nixos/trunk/tests/firewall.nix
   nixos/trunk/tests/login.nix
   nixos/trunk/tests/nat.nix
   nixos/trunk/tests/tomcat.nix

Modified: nixos/trunk/tests/firewall.nix
==============================================================================
--- nixos/trunk/tests/firewall.nix      Mon Aug 29 13:39:25 2011        (r28876)
+++ nixos/trunk/tests/firewall.nix      Mon Aug 29 14:23:26 2011        (r28877)
@@ -27,6 +27,7 @@
 
       $walled->waitForJob("firewall");
       $walled->waitForJob("httpd");
+      $attacker->waitForJob("network-interfaces");
 
       # Local connections should still work.
       $walled->succeed("curl -v http://localhost/ >&2");

Modified: nixos/trunk/tests/login.nix
==============================================================================
--- nixos/trunk/tests/login.nix Mon Aug 29 13:39:25 2011        (r28876)
+++ nixos/trunk/tests/login.nix Mon Aug 29 14:23:26 2011        (r28877)
@@ -35,11 +35,11 @@
       # Check whether ConsoleKit/udev gives and removes device
       # ownership as needed.
       subtest "device permissions", sub {
+          $machine->fail("getfacl /dev/snd/timer | grep -q alice");
           $machine->succeed("chvt 1");
-          $machine->sleep(1); # urgh
-          $machine->succeed("getfacl /dev/snd/timer | grep -q alice");
+          $machine->waitUntilSucceeds("getfacl /dev/snd/timer | grep -q 
alice");
           $machine->succeed("chvt 2");
-          $machine->sleep(1); # urgh
+          $machine->sleep(2); # urgh
           $machine->fail("getfacl /dev/snd/timer | grep -q alice");
       };
 

Modified: nixos/trunk/tests/nat.nix
==============================================================================
--- nixos/trunk/tests/nat.nix   Mon Aug 29 13:39:25 2011        (r28876)
+++ nixos/trunk/tests/nat.nix   Mon Aug 29 14:23:26 2011        (r28877)
@@ -41,10 +41,12 @@
 
       # The router should have access to the server.
       $server->waitForJob("httpd");
+      $router->waitForJob("network-interfaces");
       $router->succeed("curl --fail http://server/ >&2");
 
       # The client should be also able to connect via the NAT router.
       $router->waitForJob("nat");
+      $client->waitForJob("network-interfaces");
       $client->succeed("curl --fail http://server/ >&2");
       $client->succeed("ping -c 1 server >&2");
       

Modified: nixos/trunk/tests/tomcat.nix
==============================================================================
--- nixos/trunk/tests/tomcat.nix        Mon Aug 29 13:39:25 2011        (r28876)
+++ nixos/trunk/tests/tomcat.nix        Mon Aug 29 14:23:26 2011        (r28877)
@@ -25,7 +25,8 @@
 
     $server->waitForJob("tomcat");
     $server->sleep(30); # Dirty, but it takes a while before Tomcat handles to 
requests properly
-    $client->mustSucceed("curl --fail 
http://server/examples/servlets/servlet/HelloWorldExample";);
-    $client->mustSucceed("curl --fail 
http://server/examples/jsp/jsp2/simpletag/hello.jsp";);
+    $client->waitForJob("network-interfaces");
+    $client->succeed("curl --fail 
http://server/examples/servlets/servlet/HelloWorldExample";);
+    $client->succeed("curl --fail 
http://server/examples/jsp/jsp2/simpletag/hello.jsp";);
   '';
 }
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to