Method: PSWindows::Exec#ping
- Defined in:
- lib/beaker/host/pswindows/exec.rb
#ping(target, attempts = 5) ⇒ Boolean
Attempt to ping the provided target hostname
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/beaker/host/pswindows/exec.rb', line 59 def ping target, attempts=5 try = 0 while try < attempts do result = exec(Beaker::Command.new("ping -n 1 #{target}"), :accept_all_exit_codes => true) if result.exit_code == 0 return true end try+=1 end result.exit_code == 0 end |