Class: Serverspec::Type::Interface

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/interface.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#has_ipv4_address?(ip_address) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/serverspec/type/interface.rb', line 11

def has_ipv4_address?(ip_address)
  backend.check_ipv4_address(@name, ip_address)
end

#speedObject



4
5
6
7
8
9
# File 'lib/serverspec/type/interface.rb', line 4

def speed
  ret = backend.run_command(commands.get_interface_speed_of(@name))
  val = ret.stdout.strip
  val = val.to_i if val.match(/^\d+$/)
  val
end