Sha256: 5a4e36d0c29cdc09854c9e2424874ec5756e51cef2872e0fceed0e2ed8428294

Contents?: true

Size: 732 Bytes

Versions: 19

Compression:

Stored size: 732 Bytes

Contents

require 'spec_helper'

include Serverspec::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

19 entries across 17 versions & 1 rubygems

Version Path
serverspec-0.11.5 spec/redhat/interface_spec.rb
serverspec-0.11.4 spec/redhat/interface_spec.rb
serverspec-0.11.3 spec/redhat/interface_spec.rb
serverspec-0.11.2 spec/redhat/interface_spec.rb
serverspec-0.9.4 spec/redhat/interface_spec.rb
serverspec-0.9.3 spec/redhat/interface_spec.rb
serverspec-0.9.3 spec/aix/interface_spec.rb
serverspec-0.9.2 spec/redhat/interface_spec.rb
serverspec-0.9.2 spec/aix/interface_spec.rb
serverspec-0.9.1 spec/redhat/interface_spec.rb
serverspec-0.9.0 spec/redhat/interface_spec.rb
serverspec-0.8.1 spec/redhat/interface_spec.rb
serverspec-0.8.0 spec/redhat/interface_spec.rb
serverspec-0.7.13 spec/redhat/interface_spec.rb
serverspec-0.7.12 spec/redhat/interface_spec.rb
serverspec-0.7.11 spec/redhat/interface_spec.rb
serverspec-0.7.10 spec/redhat/interface_spec.rb
serverspec-0.7.9 spec/redhat/interface_spec.rb
serverspec-0.7.8 spec/redhat/interface_spec.rb