Module: OmfRc::ResourceProxy::CM

Includes:
OmfRc::ResourceProxyDSL
Defined in:
lib/nitos_testbed_rc/cm.rb

Constant Summary collapse

@@timeout =
@config[:timeout]

Instance Method Summary collapse

Instance Method Details

#wait_until_ping(res, ip) ⇒ Object

this is used by other methods in this scope



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/nitos_testbed_rc/cm.rb', line 425

def wait_until_ping(res, ip)
  t = 0
  resp = false
  loop do
    sleep 2
    status = system("ping #{ip} -c 2 -w 2")
    if t < @@timeout
      if status == true
        resp = true
        break
      end
    else
      resp = false
      break
    end
    t += 2
  end
  resp
end