about summary refs log tree commit diff
path: root/pkgs/tools/networking/ipcalc
diff options
context:
space:
mode:
authorSirio Balmelli <sirio@b-ad.ch>2022-11-02 08:55:30 +0100
committerPeter Hoeg <peter@hoeg.com>2022-11-17 09:24:36 +0800
commit5f4cfa67e6f7e92d8acddeebd8f56d1098ffa81e (patch)
tree0d9ce20e5f2dc8fbd616ae3ac758be8d6b6bc79c /pkgs/tools/networking/ipcalc
parent47709a986a4630fa8580db245c33a66aa7d60eb3 (diff)
ipcalc: add patch to disable tests failing in Darwin sandbox
Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
Diffstat (limited to 'pkgs/tools/networking/ipcalc')
-rw-r--r--pkgs/tools/networking/ipcalc/default.nix5
-rw-r--r--pkgs/tools/networking/ipcalc/sandbox_tests.patch59
2 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ipcalc/default.nix b/pkgs/tools/networking/ipcalc/default.nix
index a29c426b2893b..fa3070eb31e51 100644
--- a/pkgs/tools/networking/ipcalc/default.nix
+++ b/pkgs/tools/networking/ipcalc/default.nix
@@ -24,6 +24,11 @@ stdenv.mkDerivation rec {
     hash = "sha256-UQq5TqK83I44ANU0yXD8YUTQWvBFLiAxmLSRtKUJ5WE=";
   };
 
+  patches = [
+    # disable tests which fail in NixOS sandbox (trying to access the network)
+    ./sandbox_tests.patch
+  ];
+
   # technically not needed as we do not support the paid maxmind databases, but
   # keep it around if someone wants to add support and /usr/share/GeoIP is
   # broken anyway
diff --git a/pkgs/tools/networking/ipcalc/sandbox_tests.patch b/pkgs/tools/networking/ipcalc/sandbox_tests.patch
new file mode 100644
index 0000000000000..d0a246843589f
--- /dev/null
+++ b/pkgs/tools/networking/ipcalc/sandbox_tests.patch
@@ -0,0 +1,59 @@
+diff --git a/tests/meson.build b/tests/meson.build
+index 536c169..0ce23f1 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -64,54 +64,6 @@ test('RandomIPv6Explicit',
+ 		ipcalc.full_path() + ' -6 -r 24' + '|grep Address'
+ 	]
+ )
+-test('HostnameIPv6Localhost',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -6 -o localhost',
+-		files('hostname-localhost-ipv6')
+-	]
+-)
+-test('HostnameIPv4Localhost',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -4 -o localhost',
+-		files('hostname-localhost-ipv4')
+-	]
+-)
+-test('HostnameIPv4LocalhostJson',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -j -4 -o localhost',
+-		files('hostname-localhost-ipv4-json')
+-	]
+-)
+-test('IPIPv6Localhost',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -h ::1',
+-		files('ip-localhost-ipv6')
+-	]
+-)
+-test('IPIPv4Localhost',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -h 127.0.0.1',
+-		files('ip-localhost-ipv4')
+-	]
+-)
+-test('IPIPv4LocalhostJson',
+-	testrunner,
+-	args : [
+-		'--test-outfile',
+-		ipcalc.full_path() + ' -j -h 127.0.0.1',
+-		files('ip-localhost-ipv4-json')
+-	]
+-)
+ # --class-prefix tests
+ test('AssignClassPrefix12',
+ 	testrunner,