duncs / clusterssh

Cluster SSH - Cluster Admin Via SSH
https://github.com/duncs/clusterssh/wiki
897 stars 79 forks source link

t/30cluster.t fails on freebsd systems (related to bash location?) #60

Closed eserte closed 8 years ago

eserte commented 8 years ago

On my freebsd smokers t/30cluster.t fails:

/bin/bash: not found

#   Failed test 'glob1 expansion, words'
#   at t/30cluster.t line 268.
#     Structures begin differing at:
#          $got->[0] = Does not exist
#     $expected->[0] = 'aa'
/bin/bash: not found

#   Failed test 'glob2 expansion, words'
#   at t/30cluster.t line 274.
#     Structures begin differing at:
#          $got->[0] = Does not exist
#     $expected->[0] = 'ax'
... etc. ...

Maybe the failure is related to the error message about bash not eing found. bash is installed on this system, but in the location /usr/local/bin/bash (like probably on most non-linux systems). And bash is not part of a default freebsd install, so it may be missing completely (like probably on other non-linux systems, too). Maybe better to use /bin/sh instead?

duncs commented 8 years ago

I blieve this is now fixed in git - are you able to clone/pull the repo and run a test to make sure all is okay?

Thanks

Duncs

eserte commented 8 years ago

I tried 08d7fead038270fa6772946b1df890d720e080e9 on a freebsd 9.2 machine and tests are fine.

However I don't have a system without bash installed at all, so cannot comment how t/30cluster.t would behave on such a system...

cqexbesd commented 8 years ago

I have a FreeBSD system (10.3-PRERELEASE) without bash installed. The tests fail differently:

t/30cluster.t ..... 1/? Odd number of elements in hash assignment at t/30cluster.t line 25.
t/30cluster.t ..... 65/? "shell_expansion" binary not found - please amend $PATH or the cssh config file
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 78.
t/30cluster.t ..... Dubious, test returned 2 (wstat 512, 0x200)

which bash in https://github.com/duncs/clusterssh/blob/master/t/30cluster.t#L60 returns undef causing the first warning and I would guess the second.

If bash is a requirement then it should be listed as a dependency but I think it would be better to get things working with a POSIX Bourne shell or better yet, just in Perl. Is the only real use of it expand_glob?

duncs commented 8 years ago

Okay, i'll rework this code.

I'm using bash as File::Glob does not do numeric expansions, e.g. {1..4} == '1 2 3 4', but bash does (other shells do not do this either). However, I am not happy relying on an external tool so I will reinvestigate other ways of doing this in perl that I might have missed before.

duncs commented 8 years ago

I have reworked and committed the code and uploaded 4.07