mirror of
https://github.com/inspec/inspec
synced 2024-11-22 20:53:11 +00:00
add unit test for inetd_conf
This commit is contained in:
parent
0d7d01efbd
commit
fb3b4b1369
3 changed files with 20 additions and 1 deletions
|
@ -15,7 +15,8 @@ def loadResource (resource, *args)
|
|||
'/etc/passwd' => IO::File.join(scriptpath, '/unit/mock/files/passwd'),
|
||||
'/etc/ntp.conf' => IO::File.join(scriptpath, '/unit/mock/files/ntp.conf'),
|
||||
'/etc/login.defs' => IO::File.join(scriptpath, '/unit/mock/files/login.defs'),
|
||||
'/etc/security/limits.conf' => IO::File.join(scriptpath, '/unit/mock/files/limits.conf')
|
||||
'/etc/security/limits.conf' => IO::File.join(scriptpath, '/unit/mock/files/limits.conf'),
|
||||
'/etc/inetd.conf' => IO::File.join(scriptpath, '/unit/mock/files/inetd.conf')
|
||||
}
|
||||
|
||||
@cmd_mapping = {
|
||||
|
|
2
test/unit/mock/files/inetd.conf
Normal file
2
test/unit/mock/files/inetd.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
|
||||
#:BSD: Shell, login, exec and talk are BSD protocols.
|
16
test/unit/resource_inetd_conf_test.rb
Normal file
16
test/unit/resource_inetd_conf_test.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'helper'
|
||||
require 'vulcano/resource'
|
||||
|
||||
describe 'Vulcano::Resources::InetdConf' do
|
||||
describe 'inetd_config' do
|
||||
let(:resource) { loadResource('inetd_config') }
|
||||
|
||||
it 'verify limits.conf config parsing' do
|
||||
_(resource.send('shell')).must_equal nil
|
||||
_(resource.send('login')).must_equal nil
|
||||
_(resource.send('ftp')).must_equal %w{stream tcp nowait root /usr/sbin/in.ftpd in.ftpd}
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue