Sha256: cc006b4623331f34ea480e91d223fddc9553595d8e1967ba8178e0bba00619b0

Contents?: true

Size: 1.91 KB

Versions: 145

Compression:

Stored size: 1.91 KB

Contents

require 'spec_helper'

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

describe get_command(:get_interface_speed_of, 'vio0') do
  it { should eq "ifconfig vio0 | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'" }
end

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

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

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

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

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

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

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

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

describe get_command(:get_interface_link_state, 'vio0') do
  it do should eq %Q{ifconfig vio0 2>&1 | awk -v s=down -F '[:<>,]' } +
                  %Q{'NR == 1 && $3 == "UP" { s="up" }; /status:/ && $2 != " active" { s="down" }; END{ print s }'}
  end
end

Version data entries

145 entries across 145 versions & 1 rubygems

Version Path
specinfra-2.82.5 spec/command/openbsd/interface_spec.rb
specinfra-2.82.4 spec/command/openbsd/interface_spec.rb
specinfra-2.82.3 spec/command/openbsd/interface_spec.rb
specinfra-2.82.2 spec/command/openbsd/interface_spec.rb
specinfra-2.82.1 spec/command/openbsd/interface_spec.rb
specinfra-2.82.0 spec/command/openbsd/interface_spec.rb
specinfra-2.81.0 spec/command/openbsd/interface_spec.rb
specinfra-2.80.0 spec/command/openbsd/interface_spec.rb
specinfra-2.79.0 spec/command/openbsd/interface_spec.rb
specinfra-2.78.2 spec/command/openbsd/interface_spec.rb
specinfra-2.78.1 spec/command/openbsd/interface_spec.rb
specinfra-2.78.0 spec/command/openbsd/interface_spec.rb
specinfra-2.77.3 spec/command/openbsd/interface_spec.rb
specinfra-2.77.2 spec/command/openbsd/interface_spec.rb
specinfra-2.77.1 spec/command/openbsd/interface_spec.rb
specinfra-2.77.0 spec/command/openbsd/interface_spec.rb
specinfra-2.76.9 spec/command/openbsd/interface_spec.rb
specinfra-2.76.8 spec/command/openbsd/interface_spec.rb
specinfra-2.76.7 spec/command/openbsd/interface_spec.rb
specinfra-2.76.6 spec/command/openbsd/interface_spec.rb