Sha256: b9b98998c644d0643fb85d8e2ea5052ba622763de8aba3ee63d36746a661c84a

Contents?: true

Size: 846 Bytes

Versions: 52

Compression:

Stored size: 846 Bytes

Contents

class Specinfra::Command::Linux::Base::Interface < Specinfra::Command::Base::Interface
  class << self
    def check_exists(name)
      "ip link show #{name}"
    end

    def get_speed_of(name)
      "cat /sys/class/net/#{name}/speed"
    end

    def check_has_ipv4_address(interface, ip_address)
      ip_address = ip_address.dup
      if ip_address =~ /\/\d+$/
        ip_address << " "
      else
        ip_address << "/"
      end
      ip_address.gsub!(".", "\\.")
      "ip addr show #{interface} | grep 'inet #{ip_address}'"
    end

    def check_has_ipv6_address(interface, ip_address)
      ip_address = ip_address.dup
      if ip_address =~ /\/\d+$/
        ip_address << " "
      else
        ip_address << "/"
      end
      ip_address.downcase!
      "ip addr show #{interface} | grep 'inet6 #{ip_address}'"
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
specinfra-2.30.4 lib/specinfra/command/linux/base/interface.rb
specinfra-2.30.3 lib/specinfra/command/linux/base/interface.rb
specinfra-2.30.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.30.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.30.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.29.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.28.4 lib/specinfra/command/linux/base/interface.rb
specinfra-2.28.3 lib/specinfra/command/linux/base/interface.rb
specinfra-2.28.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.28.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.28.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.27.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.27.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.26.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.26.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.25.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.25.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.24.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.24.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.24.0 lib/specinfra/command/linux/base/interface.rb