Sha256: 069152fd5ce552548bb590e3ecee084e66fd61f23c8ee3a689f4e47291a94bd3

Contents?: true

Size: 1.75 KB

Versions: 145

Compression:

Stored size: 1.75 KB

Contents

require 'spec_helper'

property[:os] = nil
set :os, :family => 'darwin'


describe get_command(:check_interface_exists, 'en0') do
  it { should eq "ifconfig en0" }
end

describe get_command(:check_interface_has_ipv6_address, 'en0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do
  it { should eq "ifconfig en0 inet6 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee '" }
end

describe get_command(:check_interface_has_ipv6_address, 'en0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee/64') do
  it { should eq "ifconfig en0 inet6 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee prefixlen 64'" }
end

describe get_command(:check_interface_has_ipv6_address, 'en0', 'fe80::5054:ff:fe01:10ee/64') do
  it { should eq "ifconfig en0 inet6 | grep 'inet6 fe80::5054:ff:fe01:10ee%en0 prefixlen 64'" }
end

describe get_command(:check_interface_has_ipv6_address, 'en0', 'fe80::5054:ff:fe01:10ee') do
  it { should eq "ifconfig en0 inet6 | grep 'inet6 fe80::5054:ff:fe01:10ee%en0 '" }
end

describe get_command(:check_interface_has_ipv4_address, 'en0', '192.168.0.123') do
  it { should eq "ifconfig en0 inet | grep 'inet 192\\.168\\.0\\.123 '" }
end

describe get_command(:check_interface_has_ipv4_address, 'en0', '192.168.0.123/24') do
  it { should eq "ifconfig en0 inet | grep 'inet 192\\.168\\.0\\.123 '" }
end

describe get_command(:get_interface_ipv4_address, 'en0') do
  it { should eq "ifconfig en0 inet | grep inet | awk '{print $2}'" }
end

describe get_command(:get_interface_ipv6_address, 'en0') do
  it { should eq "ifconfig en0 inet6 | grep inet6 | awk '{print $2$3$4}' | sed 's/prefixlen/\//'; exit" }
end

describe get_command(:get_interface_link_state, 'en0') do
  it { should eq %Q{ifconfig -u en0 2>&1 | awk -v s=up '/status:/ && $2 != "active" { s="down" }; END {print s}'} }
end

Version data entries

145 entries across 145 versions & 1 rubygems

Version Path
specinfra-2.91.0 spec/command/darwin/interface_spec.rb
specinfra-2.90.1 spec/command/darwin/interface_spec.rb
specinfra-2.90.0 spec/command/darwin/interface_spec.rb
specinfra-2.89.0 spec/command/darwin/interface_spec.rb
specinfra-2.88.2 spec/command/darwin/interface_spec.rb
specinfra-2.88.1 spec/command/darwin/interface_spec.rb
specinfra-2.88.0 spec/command/darwin/interface_spec.rb
specinfra-2.87.2 spec/command/darwin/interface_spec.rb
specinfra-2.87.1 spec/command/darwin/interface_spec.rb
specinfra-2.87.0 spec/command/darwin/interface_spec.rb
specinfra-2.86.0 spec/command/darwin/interface_spec.rb
specinfra-2.85.1 spec/command/darwin/interface_spec.rb
specinfra-2.85.0 spec/command/darwin/interface_spec.rb
specinfra-2.84.1 spec/command/darwin/interface_spec.rb
specinfra-2.84.0 spec/command/darwin/interface_spec.rb
specinfra-2.83.4 spec/command/darwin/interface_spec.rb
specinfra-2.83.3 spec/command/darwin/interface_spec.rb
specinfra-2.83.2 spec/command/darwin/interface_spec.rb
specinfra-2.83.1 spec/command/darwin/interface_spec.rb
specinfra-2.83.0 spec/command/darwin/interface_spec.rb