mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
add linux tests for host
This commit is contained in:
parent
5a70133330
commit
2176039120
3 changed files with 21 additions and 0 deletions
1
test/unit/mock/cmd/getent-hosts-example.com
Normal file
1
test/unit/mock/cmd/getent-hosts-example.com
Normal file
|
@ -0,0 +1 @@
|
|||
2606:2800:220:1:248:1893:25c8:1946 example.com
|
6
test/unit/mock/cmd/ping-example.com
Normal file
6
test/unit/mock/cmd/ping-example.com
Normal file
|
@ -0,0 +1,6 @@
|
|||
PING example.com (93.184.216.34) 56(84) bytes of data.
|
||||
64 bytes from 93.184.216.34: icmp_seq=1 ttl=61 time=172 ms
|
||||
|
||||
--- example.com ping statistics ---
|
||||
1 packets transmitted, 1 received, 0% packet loss, time 0ms
|
||||
rtt min/avg/max/mdev = 172.585/172.585/172.585/0.000 ms
|
|
@ -7,6 +7,20 @@ require 'vulcano/resource'
|
|||
|
||||
describe 'Vulcano::Resources::Host' do
|
||||
|
||||
it 'check host on ubuntu' do
|
||||
resource = MockLoader.new(:ubuntu1404).load_resource('host', 'example.com')
|
||||
_(resource.resolvable?).must_equal true
|
||||
_(resource.reachable?).must_equal true
|
||||
_(resource.ipaddress).must_equal ['2606:2800:220:1:248:1893:25c8:1946']
|
||||
end
|
||||
|
||||
it 'check host on centos 7' do
|
||||
resource = MockLoader.new(:centos7).load_resource('host', 'example.com')
|
||||
_(resource.resolvable?).must_equal true
|
||||
_(resource.reachable?).must_equal true
|
||||
_(resource.ipaddress).must_equal ['2606:2800:220:1:248:1893:25c8:1946']
|
||||
end
|
||||
|
||||
it 'check host on windows' do
|
||||
resource = MockLoader.new(:windows).load_resource('host', 'microsoft.com')
|
||||
_(resource.resolvable?).must_equal true
|
||||
|
|
Loading…
Add table
Reference in a new issue