Sha256: 779d34a09e2ddd4b55d5d76bd5d00435d56ab9b7dfd080e5eafaec6baa8f773c

Contents?: true

Size: 612 Bytes

Versions: 19

Compression:

Stored size: 612 Bytes

Contents

module Serverspec::Type
  class Interface < Base
    def exists?
      @runner.check_interface_exists(@name)
    end

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

    def has_ipv4_address?(ip_address)
      @runner.check_interface_has_ipv4_address(@name, ip_address)
    end

    def has_ipv6_address?(ip_address)
      @runner.check_interface_has_ipv6_address(@name, ip_address)
    end

    def up?
      ret = @runner.get_interface_link_state(@name)
      ret.stdout.strip == 'up'
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
serverspec-ruby19-2.24.3 lib/serverspec/type/interface.rb
serverspec-2.27.0 lib/serverspec/type/interface.rb
serverspec-2.26.0 lib/serverspec/type/interface.rb
serverspec-2.25.0 lib/serverspec/type/interface.rb
serverspec-2.24.3 lib/serverspec/type/interface.rb
serverspec-2.24.2 lib/serverspec/type/interface.rb
serverspec-2.24.1 lib/serverspec/type/interface.rb
serverspec-2.24.0 lib/serverspec/type/interface.rb
serverspec-2.23.1 lib/serverspec/type/interface.rb
serverspec-2.23.0 lib/serverspec/type/interface.rb
serverspec-2.22.0 lib/serverspec/type/interface.rb
serverspec-2.21.1 lib/serverspec/type/interface.rb
serverspec-2.21.0 lib/serverspec/type/interface.rb
serverspec-2.20.0 lib/serverspec/type/interface.rb
serverspec-2.19.0 lib/serverspec/type/interface.rb
serverspec-2.18.0 lib/serverspec/type/interface.rb
serverspec-2.17.1 lib/serverspec/type/interface.rb
serverspec-2.17.0 lib/serverspec/type/interface.rb
serverspec-2.16.0 lib/serverspec/type/interface.rb