Method: Windows::Exec#ping
- Defined in:
- lib/beaker/host/windows/exec.rb
#ping(target, attempts = 5) ⇒ Boolean
Attempt to ping the provided target hostname
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/beaker/host/windows/exec.rb', line 51 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 |