add unit test for inetd_conf

This commit is contained in:
Christoph Hartmann 2015-09-05 21:23:21 +02:00 committed by Dominik Richter
parent 0d7d01efbd
commit fb3b4b1369
3 changed files with 20 additions and 1 deletions

View file

@ -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 = {

View 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.

View 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