Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mirror
chef-ulimit
Commits
e6994873
Commit
e6994873
authored
Mar 13, 2020
by
Tim Smith
Browse files
Add some useful ChefSpec for the user_ulimit resource
Signed-off-by:
Tim Smith
<
tsmith@chef.io
>
parent
2496d1f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
spec/unit/recipes/default_spec.rb
deleted
100644 → 0
View file @
2496d1f7
require
'spec_helper'
describe
'custom resource test recipe on ubuntu 16.04'
do
let
(
:runner
)
{
ChefSpec
::
ServerRunner
.
new
(
platform:
'ubuntu'
,
version:
'16.04'
)
}
let
(
:chef_run
)
{
runner
.
converge
(
'test::default'
)
}
it
'converges successfully'
do
expect
{
:chef_run
}.
to_not
raise_error
end
end
spec/unit/recipes/user_ulimit.rb
0 → 100644
View file @
e6994873
require
'spec_helper'
describe
'user_ulimit resource'
do
step_into
:user_ulimit
platform
'ubuntu'
context
'without the filename specified'
do
recipe
do
user_ulimit
'tomcat'
do
filehandle_soft_limit
8192
end
end
it
{
is_expected
.
to
create_template
(
'/etc/security/limits.d/tomcat_limits.conf'
)
}
end
context
'with the filename specified and not ending in .conf'
do
recipe
do
user_ulimit
'tomcat'
do
filename
'foo'
filehandle_soft_limit
8192
end
end
it
{
is_expected
.
to
create_template
(
'/etc/security/limits.d/foo.conf'
)
}
end
context
'with the filename specified and ending in .conf'
do
recipe
do
user_ulimit
'tomcat'
do
filename
'foo.conf'
filehandle_soft_limit
8192
end
end
it
{
is_expected
.
to
create_template
(
'/etc/security/limits.d/foo.conf'
)
}
end
context
'with the username set to *'
do
recipe
do
user_ulimit
'tomcat'
do
username
'*'
filehandle_soft_limit
8192
end
end
it
{
is_expected
.
to
create_template
(
'/etc/security/limits.d/00_all_limits.conf'
)
}
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment