Sha256: 716553f6fdb6263a501e67e61c91d454df0f5a38282572947250c36b8653edb8

Contents?: true

Size: 1.47 KB

Versions: 42

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

include SpecInfra::Helper::Solaris11

describe host('127.0.0.1') do
  it { should be_resolvable }
  its(:command) { should eq "getent hosts 127.0.0.1" }
end

describe host('invalid-name') do
  it { should_not be_resolvable }
end

describe host('127.0.0.1') do
  it { should be_resolvable.by('hosts') }
  its(:command) { should eq "grep -w -- 127.0.0.1 /etc/hosts" }
end

describe host('invalid-name') do
  it { should_not be_resolvable.by('hosts') }
end

describe host('127.0.0.1') do
  it { should be_resolvable.by('dns') }
  its(:command) { should eq "nslookup -timeout=1 127.0.0.1" }
end

describe host('invalid-name') do
  it { should_not be_resolvable.by('dns') }
end

describe host('127.0.0.1') do
  it { should be_reachable }
  its(:command) { should eq "ping -n 127.0.0.1 5" }
end

describe host('invalid-host') do
  it { should_not be_reachable }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "icmp", :timeout=> 1) }
  its(:command) { should eq "ping -n 127.0.0.1 1" }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "tcp", :port => 22, :timeout=> 1) }
  its(:command) { should eq "nc -vvvvzt -w 1 127.0.0.1 22" }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
  its(:command) { should eq "nc -vvvvzu -w 1 127.0.0.1 53" }
end

describe host('invalid-host') do
  it { should_not be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
serverspec-1.16.0 spec/solaris11/host_spec.rb
serverspec-1.15.0 spec/solaris11/host_spec.rb
serverspec-1.14.0 spec/solaris11/host_spec.rb
serverspec-1.13.0 spec/solaris11/host_spec.rb
serverspec-1.12.0 spec/solaris11/host_spec.rb
serverspec-1.11.0 spec/solaris11/host_spec.rb
serverspec-1.10.0 spec/solaris11/host_spec.rb
serverspec-1.9.1 spec/solaris11/host_spec.rb
serverspec-1.9.0 spec/solaris11/host_spec.rb
serverspec-1.8.0 spec/solaris11/host_spec.rb
serverspec-1.7.1 spec/solaris11/host_spec.rb
serverspec-1.7.0 spec/solaris11/host_spec.rb
serverspec-1.6.0 spec/solaris11/host_spec.rb
serverspec-1.5.0 spec/solaris11/host_spec.rb
serverspec-1.4.2 spec/solaris11/host_spec.rb
serverspec-1.4.1 spec/solaris11/host_spec.rb
serverspec-1.4.0 spec/solaris11/host_spec.rb
serverspec-1.3.0 spec/solaris11/host_spec.rb
serverspec-1.2.0 spec/solaris11/host_spec.rb
serverspec-1.1.0 spec/solaris11/host_spec.rb