Sha256: 2cc8844e1128d864acb63ae5503ab2826e0aa8086fc7087e6af64675ae8839db

Contents?: true

Size: 742 Bytes

Versions: 20

Compression:

Stored size: 742 Bytes

Contents

require 'spec_helper'

RSpec.configure do |c|
  c.os = 'Debian'
end

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

20 entries across 20 versions & 1 rubygems

Version Path
serverspec-0.11.1 spec/debian/interface_spec.rb
serverspec-0.11.0 spec/debian/interface_spec.rb
serverspec-0.10.13 spec/debian/interface_spec.rb
serverspec-0.10.12 spec/debian/interface_spec.rb
serverspec-0.10.11 spec/debian/interface_spec.rb
serverspec-0.10.10 spec/debian/interface_spec.rb
serverspec-0.10.9 spec/debian/interface_spec.rb
serverspec-0.10.8 spec/debian/interface_spec.rb
serverspec-0.10.7 spec/debian/interface_spec.rb
serverspec-0.10.6 spec/debian/interface_spec.rb
serverspec-0.10.5 spec/debian/interface_spec.rb
serverspec-0.10.4 spec/debian/interface_spec.rb
serverspec-0.10.3 spec/debian/interface_spec.rb
serverspec-0.10.2 spec/debian/interface_spec.rb
serverspec-0.10.1 spec/debian/interface_spec.rb
serverspec-0.10.0 spec/debian/interface_spec.rb
serverspec-0.9.8 spec/debian/interface_spec.rb
serverspec-0.9.7 spec/debian/interface_spec.rb
serverspec-0.9.6 spec/debian/interface_spec.rb
serverspec-0.9.5 spec/debian/interface_spec.rb