Sha256: 70f96ced9d313109acb1f88ef133a359bbd6f5a38daaa549a95b722993ce5d01

Contents?: true

Size: 1.48 KB

Versions: 23

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

include SpecInfra::Helper::Debian

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 -w 5 -c 2" }
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 -w 1 -c 2" }
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 127.0.0.1 22 -w 1" }
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 127.0.0.1 53 -w 1" }
end

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
serverspec-1.1.0 spec/debian/host_spec.rb
serverspec-1.0.0 spec/debian/host_spec.rb
serverspec-0.16.0 spec/debian/host_spec.rb
serverspec-0.15.5 spec/debian/host_spec.rb
serverspec-0.15.4 spec/debian/host_spec.rb
serverspec-0.15.3 spec/debian/host_spec.rb
serverspec-0.15.2 spec/debian/host_spec.rb
serverspec-0.15.1 spec/debian/host_spec.rb
serverspec-0.15.0 spec/debian/host_spec.rb
serverspec-0.14.4 spec/debian/host_spec.rb
serverspec-0.14.3 spec/debian/host_spec.rb
serverspec-0.14.2 spec/debian/host_spec.rb
serverspec-0.14.1 spec/debian/host_spec.rb
serverspec-0.14.0 spec/debian/host_spec.rb
serverspec-0.13.7 spec/debian/host_spec.rb
serverspec-0.13.6 spec/debian/host_spec.rb
serverspec-0.13.5 spec/debian/host_spec.rb
serverspec-0.13.4 spec/debian/host_spec.rb
serverspec-0.13.3 spec/debian/host_spec.rb
serverspec-0.13.2 spec/debian/host_spec.rb