mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
23 lines
652 B
Ruby
23 lines
652 B
Ruby
# encoding: utf-8
|
|
|
|
require 'helper'
|
|
require 'vulcano/resource'
|
|
|
|
describe 'Vulcano::Resources::Port' do
|
|
|
|
it 'verify port on Ubuntu 14.04' do
|
|
resource = MockLoader.new(:ubuntu1404).load_resource('port', 22)
|
|
_(resource.listening?).must_equal true
|
|
_(resource.protocol).must_equal 'tcp'
|
|
_(resource.pid).must_equal 1
|
|
_(resource.process).must_equal 'sshd'
|
|
end
|
|
|
|
it 'verify running on undefined' do
|
|
resource = MockLoader.new(:undefined).load_resource('port', 22)
|
|
_(resource.listening?).must_equal false
|
|
_(resource.protocol).must_equal nil
|
|
_(resource.pid).must_equal nil
|
|
_(resource.process).must_equal nil
|
|
end
|
|
end
|