Sha256: 34686b221154840139ecb534fc7dc720d9558d2a581bba5cbeecc3000a18eb4b
Contents?: true
Size: 1.66 KB
Versions: 19
Compression:
Stored size: 1.66 KB
Contents
require 'spec_helper' include SpecInfra::Helper::RedHat 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 -w 5 -c 2 -n 127.0.0.1" } 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 -w 1 -c 2 -n 127.0.0.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 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 describe host('example.jp') do let(:stdout) { "1.2.3.4\r\n" } its(:ipaddress) { should eq '1.2.3.4' } its(:command) { should eq "getent hosts example.jp | awk '{print $1}'" } end
Version data entries
19 entries across 19 versions & 1 rubygems