duncs / clusterssh

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

./Build test fail as root with 4.03_02 #13

Closed levaidaniel closed 9 years ago

levaidaniel commented 10 years ago

Hi!

./Build test passes fine when running as a normal user, but sudo ./Build test gives me this:

Generating: ccon
Generating: crsh
Generating: cssh
Generating: ctel
t/00-load.t ....... ok   
t/01l10n.t ........ ok   
t/02base.t ........ ok     
t/05getopts.t ..... ok     
t/10host.t ........ ok     
t/15config.t ...... 1/? 
#   Failed test 'died ok'
#   at t/15config.t line 479.
#          got: 'return'
#     expected: 'die'
#   Failed test 'Expecting no STDERR'
#   at t/15config.t line 482.
#          got: 'Moved $HOME/.csshrc to $HOME/.csshrc.DISABLED
# Created new configuration file within $HOME/.clusterssh/
# '
#     expected: ''
#   Failed test 'Expected die msg Moved $HOME/.csshrc to $HOME/.csshrc.DISABLED
# Created new configuration file within $HOME/.clusterssh/
# '
#   at t/15config.t line 483.
#          got: undef
#     expected: 'Unable to create directory $HOME/.clusterssh: Permission denied
# '
# Looks like you failed 3 tests of 155.
t/15config.t ...... Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/155 subtests 
t/20helper.t ...... ok    
t/30cluster.t ..... ok    
t/80clusterssh.t .. ok   
t/boilerplate.t ... ok   
t/changes.t ....... ok   
t/manifest.t ...... ok   
t/pod-coverage.t .. ok   
t/pod.t ........... ok     
Test Summary Report
-------------------
t/15config.t    (Wstat: 768 Tests: 155 Failed: 3)
  Failed tests:  142, 145-146
  Non-zero exit status: 3
Files=14, Tests=1566,  3 wallclock secs ( 0.18 usr  0.01 sys +  2.04 cusr  0.11 csys =  2.34 CPU)
Result: FAIL
Failed 1/14 test programs. 3/1566 subtests failed.

Here is a bit more verbose output, calling t/15config.t directly:

ok 1 - use App::ClusterSSH::Config;
ok 2 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 3 - default config is correct
ok 4 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 5 - got correct error message
ok 6 - Picked up unknown config array
ok 7 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 8 - validated ok
ok 9 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 10 - default config is correct
ok 11 - An object of class 'App::ClusterSSH::Exception::LoadFile' isa 'App::ClusterSSH::Exception::LoadFile'
ok 12 - got correct error message
# using /mnt/gyalu/slackbuilds/tmp/App-ClusterSSH-4.03_02/t/15config.t.file1
ok 13 - returned ok
ok 14 - returned ok
ok 15 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 16 - Expecting no STDOUT
ok 17 - Expecting no STDERR
ok 18 - amended config is correct
# using /mnt/gyalu/slackbuilds/tmp/App-ClusterSSH-4.03_02/t/15config.t.file2
ok 19 - died ok
ok 20 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 21 - die message correct
ok 22 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 23 - Expecting no STDOUT
ok 24 - Expecting no STDERR
ok 25 - amended config is correct
# using /mnt/gyalu/slackbuilds/tmp/App-ClusterSSH-4.03_02/t/15config.t.file3
ok 26 - returned ok
ok 27 - returned ok
ok 28 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 29 - Expecting no STDOUT
ok 30 - Expecting no STDERR
# find_binary tests
ok 31 - died ok
ok 32 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 33 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 34 - die message correct
ok 35 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 36 - Expecting no STDOUT
ok 37 - Expecting no STDERR
ok 38 - amended config is correct
ok 39 - died ok
ok 40 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 41 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 42 - die message correct
ok 43 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 44 - Expecting no STDOUT
ok 45 - Expecting no STDERR
ok 46 - amended config is correct
ok 47 - returned ok
ok 48 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 49 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 50 - Expecting no STDOUT
ok 51 - Expecting no STDERR
ok 52 - amended config is correct
ok 53 - Found correct path to "ls"
ok 54 - returned ok
ok 55 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 56 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 57 - Expecting no STDOUT
ok 58 - Expecting no STDERR
ok 59 - amended config is correct
ok 60 - Found correct path to "ls"
ok 61 - No change made from find_binary
ok 62 - returned ok
ok 63 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 64 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 65 - Expecting no STDOUT
ok 66 - Expecting no STDERR
ok 67 - amended config is correct
ok 68 - Found correct path to "ls"
ok 69 - No change made from find_binary
# Checks on loading configs
# empty dir
ok 70 - returned ok
ok 71 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 72 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 73 - die message correct
ok 74 - Expecting no STDOUT
ok 75 - Got correct STDERR output for .csshrc
ok 76 - .clusterssh dir exists
ok 77 - .clusterssh config file exists
ok 78 - amended config is correct
# .csshrc warning
ok 79 - returned ok
ok 80 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 81 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 82 - die message correct
ok 83 - Expecting no STDOUT
ok 84 - Got correct STDERR output for .csshrc
ok 85 - .clusterssh dir exists
ok 86 - .clusterssh config file exists
ok 87 - amended config is correct
# .csshrc warning and .clusterssh dir plus config
ok 88 - returned ok
ok 89 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 90 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 91 - die message correct
ok 92 - Expecting no STDOUT
ok 93 - Got correct STDERR output for .csshrc
ok 94 - .clusterssh dir exists
ok 95 - .clusterssh config file exists
ok 96 - amended config is correct
# no .csshrc warning and .clusterssh dir
ok 97 - returned ok
ok 98 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 99 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 100 - die message correct
ok 101 - Expecting no STDOUT
ok 102 - Expecting no STDERR
ok 103 - .clusterssh dir exists
ok 104 - .clusterssh config file exists
ok 105 - amended config is correct
# no .csshrc warning, .clusterssh dir plus config + extra config
ok 106 - returned ok
ok 107 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 108 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 109 - die message correct
ok 110 - Expecting no STDOUT
ok 111 - Expecting no STDERR
ok 112 - .clusterssh dir exists
ok 113 - .clusterssh config file exists
ok 114 - amended config is correct
# no .csshrc warning, .clusterssh dir plus config + more extra configs
ok 115 - returned ok
ok 116 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 117 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 118 - die message correct
ok 119 - Expecting no STDOUT
ok 120 - Expecting no STDERR
ok 121 - .clusterssh dir exists
ok 122 - .clusterssh config file exists
ok 123 - amended config is correct
# check .clusterssh file is an error
ok 124 - died ok
ok 125 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 126 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 127 - die message correct
ok 128 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 129 - Expecting no STDOUT
ok 130 - Expecting no STDERR
# check failure to write default config is caught
ok 131 - died ok
ok 132 - An object of class 'App::ClusterSSH::Exception::Config' isa 'App::ClusterSSH::Exception::Config'
ok 133 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 134 - die message correct
ok 135 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 136 - Expecting no STDOUT
ok 137 - Expecting no STDERR
# check .clusterssh errors via load_configs are not fatal
ok 138 - died ok
ok 139 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 140 - Expecting no STDOUT
ok 141 - Expecting no STDERR
# move of .csshrc failure
not ok 142 - died ok
#   Failed test 'died ok'
#   at 15config.t line 479.
#          got: 'return'
#     expected: 'die'
ok 143 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 144 - Expecting no STDOUT
not ok 145 - Expecting no STDERR
#   Failed test 'Expecting no STDERR'
#   at 15config.t line 482.
#          got: 'Moved $HOME/.csshrc to $HOME/.csshrc.DISABLED
# Created new configuration file within $HOME/.clusterssh/
# '
#     expected: ''
not ok 146 - Expected die msg Moved $HOME/.csshrc to $HOME/.csshrc.DISABLED
# Created new configuration file within $HOME/.clusterssh/
# 
#   Failed test 'Expected die msg Moved $HOME/.csshrc to $HOME/.csshrc.DISABLED
# Created new configuration file within $HOME/.clusterssh/
# '
#   at 15config.t line 483.
#          got: undef
#     expected: 'Unable to create directory $HOME/.clusterssh: Permission denied
# '
# check failure to write default config is caught
ok 147 - returned ok
ok 148 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 149 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 150 - Expecting no STDOUT
ok 151 - Expecting no STDERR
# Checking dump
ok 152 - An object of class 'App::ClusterSSH::Config' isa 'App::ClusterSSH::Config'
ok 153 - die message correct
ok 154 - Expecting no STDOUT
ok 155 - Expecting no STDERR
1..155
# Looks like you failed 3 tests of 155.

Daniel

duncs commented 9 years ago

Fixed and pushed to repo as per #11