Sha256: 791ccfe1cccbcccb681dbc8fb14aa8f09c2eb217997f6fe704ca56fbfaef3cfb

Contents?: true

Size: 731 Bytes

Versions: 42

Compression:

Stored size: 731 Bytes

Contents

require 'spec_helper'

include SpecInfra::Helper::RedHat

describe interface('eth0') do
  let(:stdout) { '1000' }
  its(:speed) { should eq 1000 }
  its(:command) { should eq "ethtool eth0 | grep Speed | gawk '{print gensub(/Speed: ([0-9]+)Mb\\/s/,\"\\\\1\",\"\")}'" }
end

describe interface('eth0') do
  it { should have_ipv4_address("192.168.10.10") }
  its(:command) { should eq "ip addr show eth0 | grep 'inet 192\\.168\\.10\\.10/'" }
end

describe interface('eth0') do
  it { should have_ipv4_address("192.168.10.10/24") }
  its(:command) { should eq "ip addr show eth0 | grep 'inet 192\\.168\\.10\\.10/24 '" }
end

describe interface('invalid-interface') do
  let(:stdout) { '1000' }
  its(:speed) { should_not eq 100 }
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
serverspec-1.0.0 spec/redhat/interface_spec.rb
serverspec-0.16.0 spec/redhat/interface_spec.rb
serverspec-0.15.5 spec/redhat/interface_spec.rb
serverspec-0.15.4 spec/redhat/interface_spec.rb
serverspec-0.15.3 spec/redhat/interface_spec.rb
serverspec-0.15.2 spec/redhat/interface_spec.rb
serverspec-0.15.1 spec/redhat/interface_spec.rb
serverspec-0.15.0 spec/redhat/interface_spec.rb
serverspec-0.14.4 spec/redhat/interface_spec.rb
serverspec-0.14.3 spec/redhat/interface_spec.rb
serverspec-0.14.2 spec/redhat/interface_spec.rb
serverspec-0.14.1 spec/redhat/interface_spec.rb
serverspec-0.14.0 spec/redhat/interface_spec.rb
serverspec-0.13.7 spec/redhat/interface_spec.rb
serverspec-0.13.6 spec/redhat/interface_spec.rb
serverspec-0.13.5 spec/redhat/interface_spec.rb
serverspec-0.13.4 spec/redhat/interface_spec.rb
serverspec-0.13.3 spec/redhat/interface_spec.rb
serverspec-0.13.2 spec/redhat/interface_spec.rb
serverspec-0.13.1 spec/redhat/interface_spec.rb