summary refs log tree commit diff
diff options
context:
space:
mode:
authorShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2022-12-20 17:32:24 +0800
committerShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2022-12-20 18:48:02 +0800
commit4f424907226c783b9203c5cddcd0a5276980dc79 (patch)
tree13569d6e44d228b460633a9f3b66b4a9cf6d3fbe
parent16516fa2a72f9b0a90194bf6dd9c302a778e89fa (diff)
downloadnixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar.gz
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar.bz2
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar.lz
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar.xz
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.tar.zst
nixpkgs-4f424907226c783b9203c5cddcd0a5276980dc79.zip
xrootd.passthru.test-xrdcp: init
-rw-r--r--pkgs/tools/networking/xrootd/default.nix7
-rw-r--r--pkgs/tools/networking/xrootd/test-xrdcp.nix19
2 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/tools/networking/xrootd/default.nix
index 0f32ae4ab71..b6fa0bab28d 100644
--- a/pkgs/tools/networking/xrootd/default.nix
+++ b/pkgs/tools/networking/xrootd/default.nix
@@ -36,7 +36,12 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "out" "dev" "man" ];
 
-  passthru.tests = lib.optionalAttrs enableTests && stdenv.isLinux {
+  passthru.tests = lib.optionalAttrs enableTests {
+    test-xrdcp = callPackage ./test-xrdcp.nix {
+      url = "root://eospublic.cern.ch//eos/opendata/alice/2010/LHC10h/000138275/ESD/0000/AliESDs.root";
+      hash = "sha256-tIcs2oi+8u/Qr+P7AAaPTbQT+DEt26gEdc4VNerlEHY=";
+    };
+  } // lib.optionalAttrs stdenv.isLinux {
     test-runner = callPackage ./test-runner.nix { };
   };
 
diff --git a/pkgs/tools/networking/xrootd/test-xrdcp.nix b/pkgs/tools/networking/xrootd/test-xrdcp.nix
new file mode 100644
index 00000000000..3b29e195813
--- /dev/null
+++ b/pkgs/tools/networking/xrootd/test-xrdcp.nix
@@ -0,0 +1,19 @@
+{ lib
+, runCommandLocal
+, buildPlatform
+, xrootd
+, url
+, hash
+}: runCommandLocal (baseNameOf url)
+{
+  nativeBuildInputs = [ xrootd ];
+  outputHashAlgo = null;
+  outputHashMode = "flat";
+  outputHash = hash;
+  inherit url;
+}
+# Set [DY]LD_LIBRARY_PATH to workaround #169677
+# TODO: Remove the library path after #200830 get merged
+''
+  ${lib.optionalString buildPlatform.isDarwin "DY"}LD_LIBRARY_PATH=${lib.makeLibraryPath [ xrootd ]} xrdcp --force "$url" "$out"
+''