Skip to content

Commit

Permalink
xrootd.passthru.test-xrdcp: init
Browse files Browse the repository at this point in the history
  • Loading branch information
ShamrockLee committed Dec 20, 2022
1 parent 16516fa commit 4f42490
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/tools/networking/xrootd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
};

Expand Down
19 changes: 19 additions & 0 deletions pkgs/tools/networking/xrootd/test-xrdcp.nix
Original file line number Diff line number Diff line change
@@ -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"
''

0 comments on commit 4f42490

Please sign in to comment.