forked from jhoblitt/puppet-pureftpd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing configuration options/params to pureftpd::config + rspec
- Loading branch information
Joshua Hoblitt
committed
Aug 5, 2013
1 parent
d7ebceb
commit d50e2af
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
require 'spec_helper' | ||
|
||
config_options = [ | ||
'IPV4Only', | ||
'IPV6Only', | ||
'ChrootEveryone', | ||
'BrokenClientsCompatibility', | ||
'Daemonize', | ||
'VerboseLog', | ||
'DisplayDotFiles', | ||
'AnonymousOnly', | ||
'NoAnonymous', | ||
'DontResolve', | ||
'AnonymousCanCreateDirs', | ||
'NATmode', | ||
'CallUploadScript', | ||
'AntiWarez', | ||
'AllowUserFXP', | ||
'AllowAnonymousFXP', | ||
'ProhibitDotFilesWrite', | ||
'ProhibitDotFilesRead', | ||
'AllowDotFiles', | ||
'AutoRename', | ||
'AnonymousCantUpload', | ||
'LogPID', | ||
'NoChmod', | ||
'KeepAllFiles', | ||
'CreateHomeDir', | ||
'NoRename', | ||
'CustomerProof', | ||
'NoTruncate', | ||
'FileSystemCharset', | ||
'ClientCharset', | ||
'SyslogFacility', | ||
'FortunesFile', | ||
'ForcePassiveIP', | ||
'Bind', | ||
'AnonymousBandwidth', | ||
'UserBandwidth', | ||
'TrustedIP', | ||
'AltLog', | ||
'PIDFile', | ||
'MaxIdleTime', | ||
'MaxDiskUsage', | ||
'TrustedGID', | ||
'MaxClientsNumber', | ||
'MaxClientsPerIP', | ||
'MaxLoad', | ||
'MinUID', | ||
'TLS', | ||
'LimitRecursion', | ||
'PassivePortRange', | ||
'AnonymousRatio', | ||
'UserRatio', | ||
'Umask', | ||
'Quota', | ||
'PerUserLimits', | ||
'LDAPConfigFile', | ||
'MySQLConfigFile', | ||
'PGSQLConfigFile', | ||
'PureDB', | ||
'ExtAuth', | ||
] | ||
|
||
describe 'pureftpd::config' do | ||
|
||
shared_examples 'config' do |params, content| | ||
let(:facts) {{ :osfamily=> 'RedHat' }} | ||
let(:params) { params } | ||
|
||
it do | ||
should include_class('pureftpd::config') | ||
should contain_file('/etc/pure-ftpd/pure-ftpd.conf') \ | ||
.with_ensure('file') \ | ||
.with_content(content) | ||
end | ||
end | ||
|
||
all_params = {} | ||
all_content = '' | ||
value = 'xxx' | ||
|
||
# accumutate all of the params and content strings as we test each individual | ||
# option so we can use them for the next test | ||
config_options.each do |option| | ||
params = {} | ||
params[option.downcase.to_sym] = value | ||
content = sprintf("%-19s %s\n", option, value) | ||
|
||
all_params.merge!(params) | ||
all_content += content | ||
|
||
it_behaves_like 'config', params, content | ||
end | ||
|
||
# test all of the known options at once this works because the ordering of | ||
# options values in the output file is fixed | ||
context 'all parameters' do | ||
it_behaves_like 'config', all_params, all_content | ||
end | ||
|
||
end |