summary refs log tree commit diff
path: root/nixos/tests/virtualbox.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-09-21 02:38:52 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-09-21 03:49:46 +0200
commita75265924f5f3ee73fdd30c9713b2f8177b7fb98 (patch)
tree06268561ae7f138e49b76a3ba49d559b1d1b8a3d /nixos/tests/virtualbox.nix
parentdf0c265ee1dd2bfef50b493be98047dc87dd977b (diff)
downloadnixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar.gz
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar.bz2
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar.lz
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar.xz
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.tar.zst
nixpkgs-a75265924f5f3ee73fdd30c9713b2f8177b7fb98.zip
nixos/tests/virtualbox: Fix netcat invocation
This is a backwards-incompatibility in netcat-openbsd introduced due to
bumping the netcat version to 1.130 in
a72ba661acf54d1beb2b4e306acba7d6f45621c4.

Version 1.130 no longer exits on EOF but now needs to be passed the -N
flag in order to exit on EOF.

The upstream change reads[1] like this:

  Don't shutdown nc(1)'s network socket when stdin closes. Matches
  *Hobbit*'s original netcat and GNU netcat; revert to old behaviour
  with the new -N flag if needed. After much discussion with otto
  deraadt tedu and Martin Pelikan.  ok deraadt@

Here is the diff of this change:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c.diff?r1=1.110&r2=1.111&f=h

[1]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c?rev=1.111&content-type=text/x-cvsweb-markup

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/tests/virtualbox.nix')
-rw-r--r--nixos/tests/virtualbox.nix8
1 files changed, 4 insertions, 4 deletions
diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix
index 4f7cb176d96..a1ab7614871 100644
--- a/nixos/tests/virtualbox.nix
+++ b/nixos/tests/virtualbox.nix
@@ -461,11 +461,11 @@ in mapAttrs mkVBoxTest {
     my $test1IP = waitForIP_test1 1;
     my $test2IP = waitForIP_test2 1;
 
-    $machine->succeed("echo '$test2IP' | nc '$test1IP' 1234");
-    $machine->succeed("echo '$test1IP' | nc '$test2IP' 1234");
+    $machine->succeed("echo '$test2IP' | nc -N '$test1IP' 1234");
+    $machine->succeed("echo '$test1IP' | nc -N '$test2IP' 1234");
 
-    $machine->waitUntilSucceeds("nc '$test1IP' 5678 >&2");
-    $machine->waitUntilSucceeds("nc '$test2IP' 5678 >&2");
+    $machine->waitUntilSucceeds("nc -N '$test1IP' 5678 < /dev/null >&2");
+    $machine->waitUntilSucceeds("nc -N '$test2IP' 5678 < /dev/null >&2");
 
     shutdownVM_test1;
     shutdownVM_test2;