1{ stdenv, buildPythonPackage, fetchPypi, pyyaml, openssh
2, nose, bc, hostname, coreutils, bash, gnused
3}:
4
5buildPythonPackage rec {
6 pname = "ClusterShell";
7 version = "1.8";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "1bm0pq8w2rql9q9i2bhs865rqvb6zck3h3gkb1d0mh59arrr7p4m";
12 };
13
14 propagatedBuildInputs = [ pyyaml ];
15
16 postPatch = ''
17 substituteInPlace lib/ClusterShell/Worker/Ssh.py \
18 --replace '"ssh"' '"${openssh}/bin/ssh"' \
19 --replace '"scp"' '"${openssh}/bin/scp"'
20
21 substituteInPlace lib/ClusterShell/Worker/fastsubprocess.py \
22 --replace '"/bin/sh"' '"${bash}/bin/sh"'
23 '';
24
25 checkInputs = [ nose bc hostname coreutils gnused ];
26
27 # Many tests want to open network connections
28 # https://github.com/cea-hpc/clustershell#test-suite
29 #
30 # Several tests fail on Darwin
31 checkPhase = ''
32 for f in tests/*; do
33 substituteInPlace $f \
34 --replace '/bin/hostname' '${hostname}/bin/hostname' \
35 --replace '/bin/sleep' '${coreutils}/bin/sleep' \
36 --replace '"sleep' '"${coreutils}/bin/sleep' \
37 --replace '/bin/echo' '${coreutils}/bin/echo' \
38 --replace '/bin/uname' '${coreutils}/bin/uname' \
39 --replace '/bin/false' '${coreutils}/bin/false' \
40 --replace '/bin/true' '${coreutils}/bin/true' \
41 --replace '/usr/bin/printf' '${coreutils}/bin/printf' \
42 --replace '"sed' '"${gnused}/bin/sed' \
43 --replace ' sed ' ' ${gnused}/bin/sed '
44 done
45
46 rm tests/CLIClushTest.py
47 rm tests/TreeWorkerTest.py
48 rm tests/TaskDistantMixin.py
49 rm tests/TaskDistantTest.py
50 rm tests/TaskDistantPdshMixin.py
51 rm tests/TaskDistantPdshTest.py
52 rm tests/TaskRLimitsTest.py
53
54 nosetests -v \
55 -e test_channel_ctl_shell_remote1 \
56 -e test_channel_ctl_shell_remote2 \
57 -e test_fromall_grouplist \
58 -e test_rank_placeholder \
59 -e test_engine_on_the_fly_launch \
60 -e test_ev_pickup_fanout \
61 -e test_ev_pickup_fanout_legacy \
62 -e test_timeout \
63 -e test_008_broken_pipe_on_write \
64 -e testLocalBufferRCGathering \
65 -e testLocalBuffers \
66 -e testLocalErrorBuffers \
67 -e testLocalFanout \
68 -e testLocalRetcodes \
69 -e testLocalRCBufferGathering \
70 -e testLocalSingleLineBuffers \
71 -e testLocalWorkerFanout \
72 -e testSimpleMultipleCommands \
73 -e testClushConfigSetRlimit \
74 -e testTimerInvalidateInHandler \
75 -e testTimerSetNextFireInHandler \
76 -e test_channel_ctl_shell_mlocal1 \
77 -e test_channel_ctl_shell_mlocal2 \
78 -e test_channel_ctl_shell_mlocal3 \
79 -e test_node_placeholder \
80 tests/*.py
81 '';
82
83 meta = with stdenv.lib; {
84 description = "Scalable Python framework for cluster administration";
85 homepage = https://cea-hpc.github.io/clustershell;
86 license = licenses.lgpl21;
87 maintainers = [ maintainers.alexvorobiev ];
88 };
89}