Sha256: af6588425aaf7733a35fecc69f37da831fdd831cfdc1fc9a051ccbed16e7a029

Contents?: true

Size: 1.49 KB

Versions: 20

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

RSpec.configure do |c|
  c.os = 'RedHat'
end

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

20 entries across 20 versions & 1 rubygems

Version Path
serverspec-0.11.1 spec/redhat/host_spec.rb
serverspec-0.11.0 spec/redhat/host_spec.rb
serverspec-0.10.13 spec/redhat/host_spec.rb
serverspec-0.10.12 spec/redhat/host_spec.rb
serverspec-0.10.11 spec/redhat/host_spec.rb
serverspec-0.10.10 spec/redhat/host_spec.rb
serverspec-0.10.9 spec/redhat/host_spec.rb
serverspec-0.10.8 spec/redhat/host_spec.rb
serverspec-0.10.7 spec/redhat/host_spec.rb
serverspec-0.10.6 spec/redhat/host_spec.rb
serverspec-0.10.5 spec/redhat/host_spec.rb
serverspec-0.10.4 spec/redhat/host_spec.rb
serverspec-0.10.3 spec/redhat/host_spec.rb
serverspec-0.10.2 spec/redhat/host_spec.rb
serverspec-0.10.1 spec/redhat/host_spec.rb
serverspec-0.10.0 spec/redhat/host_spec.rb
serverspec-0.9.8 spec/redhat/host_spec.rb
serverspec-0.9.7 spec/redhat/host_spec.rb
serverspec-0.9.6 spec/redhat/host_spec.rb
serverspec-0.9.5 spec/redhat/host_spec.rb