Class: Serverspec::Type::Interface
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::Interface
show all
- Defined in:
- lib/serverspec/type/interface.rb
Instance Attribute Summary
Attributes inherited from Base
#name
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #inspect, #to_ary, #to_s
Instance Method Details
#exists? ⇒ Boolean
3
4
5
|
# File 'lib/serverspec/type/interface.rb', line 3
def exists?
@runner.check_interface_exists(@name)
end
|
#has_ipv4_address?(ip_address) ⇒ Boolean
14
15
16
|
# File 'lib/serverspec/type/interface.rb', line 14
def has_ipv4_address?(ip_address)
@runner.check_interface_has_ipv4_address(@name, ip_address)
end
|
#has_ipv6_address?(ip_address) ⇒ Boolean
18
19
20
|
# File 'lib/serverspec/type/interface.rb', line 18
def has_ipv6_address?(ip_address)
@runner.check_interface_has_ipv6_address(@name, ip_address)
end
|
#speed ⇒ Object
7
8
9
10
11
12
|
# File 'lib/serverspec/type/interface.rb', line 7
def speed
ret = @runner.get_interface_speed_of(@name)
val = ret.stdout.strip
val = val.to_i if val.match(/^\d+$/)
val
end
|
#up? ⇒ Boolean
22
23
24
25
|
# File 'lib/serverspec/type/interface.rb', line 22
def up?
ret = @runner.get_interface_link_state(@name)
ret.stdout.strip == 'up'
end
|