Merge pull request #185381 from onny/clustershell
This commit is contained in:
commit
04053f8228
1 changed files with 36 additions and 19 deletions
|
@ -1,5 +1,13 @@
|
|||
{ stdenv, lib, buildPythonPackage, fetchPypi, pyyaml, openssh
|
||||
, nose, bc, hostname, coreutils, bash, gnused
|
||||
{ stdenv
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pyyaml
|
||||
, openssh
|
||||
, nose
|
||||
, bc
|
||||
, hostname
|
||||
, bash
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -11,8 +19,6 @@ buildPythonPackage rec {
|
|||
sha256 = "ff6fba688a06e5e577315d899f0dab3f4fe479cef99d444a4e651af577b7d081";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ pyyaml ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace lib/ClusterShell/Worker/Ssh.py \
|
||||
--replace '"ssh"' '"${openssh}/bin/ssh"' \
|
||||
|
@ -20,29 +26,40 @@ buildPythonPackage rec {
|
|||
|
||||
substituteInPlace lib/ClusterShell/Worker/fastsubprocess.py \
|
||||
--replace '"/bin/sh"' '"${bash}/bin/sh"'
|
||||
|
||||
for f in tests/*; do
|
||||
substituteInPlace $f \
|
||||
--replace '/bin/hostname' '${hostname}/bin/hostname' \
|
||||
--replace '/bin/sleep' 'sleep' \
|
||||
--replace '/bin/echo' 'echo' \
|
||||
--replace '/bin/uname' 'uname' \
|
||||
--replace '/bin/false' 'false' \
|
||||
--replace '/bin/true' 'true' \
|
||||
--replace '/usr/bin/printf' 'printf'
|
||||
done
|
||||
|
||||
# Fix warnings
|
||||
substituteInPlace lib/ClusterShell/Task.py \
|
||||
--replace "notifyAll" "notify_all"
|
||||
substituteInPlace tests/TaskPortTest.py lib/ClusterShell/Task.py \
|
||||
--replace "currentThread" "current_thread"
|
||||
'';
|
||||
|
||||
checkInputs = [ nose bc hostname coreutils gnused ];
|
||||
propagatedBuildInputs = [ pyyaml ];
|
||||
|
||||
checkInputs = [
|
||||
bc
|
||||
hostname
|
||||
nose
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "ClusterShell" ];
|
||||
|
||||
# Many tests want to open network connections
|
||||
# https://github.com/cea-hpc/clustershell#test-suite
|
||||
#
|
||||
# Several tests fail on Darwin
|
||||
checkPhase = ''
|
||||
for f in tests/*; do
|
||||
substituteInPlace $f \
|
||||
--replace '/bin/hostname' '${hostname}/bin/hostname' \
|
||||
--replace '/bin/sleep' '${coreutils}/bin/sleep' \
|
||||
--replace '"sleep' '"${coreutils}/bin/sleep' \
|
||||
--replace '/bin/echo' '${coreutils}/bin/echo' \
|
||||
--replace '/bin/uname' '${coreutils}/bin/uname' \
|
||||
--replace '/bin/false' '${coreutils}/bin/false' \
|
||||
--replace '/bin/true' '${coreutils}/bin/true' \
|
||||
--replace '/usr/bin/printf' '${coreutils}/bin/printf' \
|
||||
--replace '"sed' '"${gnused}/bin/sed' \
|
||||
--replace ' sed ' ' ${gnused}/bin/sed '
|
||||
done
|
||||
|
||||
rm tests/CLIClushTest.py
|
||||
rm tests/TreeWorkerTest.py
|
||||
rm tests/TaskDistantMixin.py
|
||||
|
|
Loading…
Reference in a new issue