RexOps / Rex

Rex, the friendly automation framework
https://www.rexify.org
717 stars 223 forks source link

Failed test 'get connection type for ssh' #823

Closed niceperl closed 8 years ago

niceperl commented 9 years ago

When I install Rex on Windows with perl strawberry 5.20.2, it shows me an error:

"C:\perl\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/commands/*.t
t/0.31.t ......................... ok
t/0.54.t ......................... ok
t/01.t ........................... ok
t/args.t ......................... ok
t/auth.t ......................... ok
t/author-critic.t ................ skipped: these tests are for testing by the author
El sistema no puede encontrar la ruta especificada.
t/base.t ......................... ok
t/base_virt.t .................... ok
t/can_run.t ...................... ok
t/case.t ......................... ok
t/cmdb.t ......................... ok
t/commands.t ..................... ok
t/commands/evaluate_hostnames.t .. ok
t/commands_file_template.t ....... ok
t/config-ssh.t ................... ok
t/config.t ....................... ok
t/cron.t ......................... ok
t/db.t ........................... skipped: Could not load Test::mysqld module
t/df.t ........................... ok
t/dmi.t .......................... ok
t/env.t .......................... ok
t/file.t ......................... ok
t/fs.t ........................... ok
t/fs_files.t ..................... ok
t/group.t ........................ ok
t/helper_hash.t .................. ok
t/helper_path.t .................. ok
t/host.t ......................... ok
t/ini.t .......................... ok
t/interface_fs_local.t ........... ok
t/iptables.t ..................... ok
t/issue_539.t .................... ok
t/last_command_output.t .......... ok
t/logger.t ....................... ok
t/md5.t .......................... ok
t/needs.t ........................ ok
t/net_interface_centos7.t ........ ok
t/network_linux.t ................ ok
t/no_tty.t ....................... ok
t/package.t ...................... ok
t/path.t ......................... ok
t/release-minimum-version.t ...... skipped: these tests are for release candidate testing
t/release-pod-syntax.t ........... skipped: these tests are for release candidate testing
El sistema no puede encontrar la ruta especificada.
tmp\report\_local_\2.yml - El proceso no tiene acceso al archivo porque est  siendo utilizado por otro proceso.
t/report.t ....................... ok
t/shared.t ....................... ok

#   Failed test 'get connection type for ssh'
#   at t/task.t line 50.
#          got: 'SSH'
#     expected: 'OpenSSH'

#   Failed test 'get connection type for ssh'
#   at t/task.t line 61.
#          got: 'SSH'
#     expected: 'OpenSSH'
# Looks like you failed 2 tests of 33.
t/task.t ......................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/33 subtests 
t/task_hosts.t ................... ok
t/template.t ..................... ok
t/template_ng.t .................. ok
t/url_encode.t ................... ok
t/virtualization.t ............... ok
t/xml.t .......................... ok

Test Summary Report
-------------------
t/task.t                       (Wstat: 512 Tests: 33 Failed: 2)
  Failed tests:  8, 13
  Non-zero exit status: 2
Files=52, Tests=1187, 27 wallclock secs ( 0.20 usr +  0.16 sys =  0.36 CPU)
Result: FAIL
Failed 1/52 test programs. 2/1187 subtests failed.
dmake.exe:  Error code 255, while making 'test_dynamic'
-> FAIL Installing Rex failed. See ...\.cpanm\work\1446540516.10144\build.log for details. Retry with --force to force install it.
krimdomu commented 9 years ago

Hi @niceperl thanks for the report. There is already a pull request open to fix this: #822 ( duplicates: #821 )

ferki commented 9 years ago

I'm not 100% sure if they are the same issue. The failing tests on this issue are expecting a connection type of OpenSSH, and they do that if Net::OpenSSH is installed - which should not be the case on Windows, because Net::OpenSSH doesn't work on Windows.

Can it be that Net::OpenSSH is now installable on Windows? Or maybe it was force installed?

niceperl commented 9 years ago

I had that issue (#821), and I installed Net::OpenSSH on Windows with cpanm Net::OpenSSH (yes, it works). Then cpanm Rexgave me the error I reported

krimdomu commented 9 years ago

okay, then we should extend #822 with an additional detect. If it runs on windows, it must use Net::SSH2 because Net::OpenSSH doesn't run on windows. (At least that says the documentation)

https://metacpan.org/pod/Net::OpenSSH#Known-issues

Net::OpenSSH does not work on Windows. OpenSSH multiplexing feature requires passing file handles through sockets, something that is not supported by any version of Windows.
ferki commented 8 years ago

I think #965 was a duplicate of this, but that is already resolved by #1011. Sorry for the delay. Feel free to reopen if it's still the case with current development branch.