Sha256: ee99a33c498a9ef5a878f7596ca78e0e45ab60d81750fd0eb01838aef0caf0e1

Contents?: true

Size: 730 Bytes

Versions: 42

Compression:

Stored size: 730 Bytes

Contents

require 'spec_helper'

include SpecInfra::Helper::Plamo

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.16.0 spec/plamo/interface_spec.rb
serverspec-1.15.0 spec/plamo/interface_spec.rb
serverspec-1.14.0 spec/plamo/interface_spec.rb
serverspec-1.13.0 spec/plamo/interface_spec.rb
serverspec-1.12.0 spec/plamo/interface_spec.rb
serverspec-1.11.0 spec/plamo/interface_spec.rb
serverspec-1.10.0 spec/plamo/interface_spec.rb
serverspec-1.9.1 spec/plamo/interface_spec.rb
serverspec-1.9.0 spec/plamo/interface_spec.rb
serverspec-1.8.0 spec/plamo/interface_spec.rb
serverspec-1.7.1 spec/plamo/interface_spec.rb
serverspec-1.7.0 spec/plamo/interface_spec.rb
serverspec-1.6.0 spec/plamo/interface_spec.rb
serverspec-1.5.0 spec/plamo/interface_spec.rb
serverspec-1.4.2 spec/plamo/interface_spec.rb
serverspec-1.4.1 spec/plamo/interface_spec.rb
serverspec-1.4.0 spec/plamo/interface_spec.rb
serverspec-1.3.0 spec/plamo/interface_spec.rb
serverspec-1.2.0 spec/plamo/interface_spec.rb
serverspec-1.1.0 spec/plamo/interface_spec.rb