Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
mirror
rsyslog
Commits
452afcbc
Unverified
Commit
452afcbc
authored
Oct 09, 2019
by
Tim Smith
Committed by
GitHub
Oct 09, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #157 from Rudikza/fixing_spec_tests_travis
Fixes spec tests locally and on travis-ci
parents
ff941f4c
7a8ac09d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
35 deletions
+12
-35
kitchen.dokken.yml
kitchen.dokken.yml
+1
-1
spec/client_spec.rb
spec/client_spec.rb
+2
-2
spec/default_spec.rb
spec/default_spec.rb
+7
-30
spec/server_spec.rb
spec/server_spec.rb
+2
-2
No files found.
kitchen.dokken.yml
View file @
452afcbc
...
...
@@ -2,7 +2,6 @@ driver:
name
:
dokken
privileged
:
true
# because Docker and SystemD/Upstart
chef_version
:
<%= ENV['CHEF_VERSION'] || 'current' %>
chef_license
:
accept-no-persist
transport
:
name
:
dokken
...
...
@@ -10,6 +9,7 @@ transport:
provisioner
:
name
:
dokken
deprecations_as_errors
:
true
chef_license
:
accept-no-persist
verifier
:
name
:
inspec
...
...
spec/client_spec.rb
View file @
452afcbc
...
...
@@ -41,7 +41,7 @@ describe 'rsyslog::client' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
)
do
|
node
|
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
)
do
|
node
|
node
.
normal
[
'rsyslog'
][
'server_ip'
]
=
server_ip
node
.
normal
[
'rsyslog'
][
'custom_remote'
]
=
custom_remote
end
.
converge
(
described_recipe
)
...
...
@@ -84,7 +84,7 @@ describe 'rsyslog::client' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
)
do
|
node
|
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
)
do
|
node
|
node
.
normal
[
'rsyslog'
][
'server_ip'
]
=
server_ip
end
.
converge
(
described_recipe
)
end
...
...
spec/default_spec.rb
View file @
452afcbc
...
...
@@ -60,7 +60,7 @@ describe 'rsyslog::default' do
it
'exits fatally'
do
expect
do
chef_run
end
.
to
raise_error
end
.
to
raise_error
(
RuntimeError
)
end
end
end
...
...
@@ -84,7 +84,7 @@ describe 'rsyslog::default' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
).
converge
(
described_recipe
)
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
).
converge
(
described_recipe
)
end
let
(
:directory
)
{
chef_run
.
directory
(
'/opt/local/etc/rsyslog.d'
)
}
...
...
@@ -150,7 +150,7 @@ describe 'rsyslog::default' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
).
converge
(
described_recipe
)
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
).
converge
(
described_recipe
)
end
let
(
:template
)
{
chef_run
.
template
(
'/opt/local/etc/rsyslog.conf'
)
}
...
...
@@ -203,7 +203,7 @@ describe 'rsyslog::default' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
).
converge
(
described_recipe
)
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
).
converge
(
described_recipe
)
end
let
(
:template
)
{
chef_run
.
template
(
'/opt/local/etc/rsyslog.d/50-default.conf'
)
}
...
...
@@ -253,35 +253,12 @@ describe 'rsyslog::default' do
end
context
'system-log service'
do
{
'omnios'
=>
'151018'
,
'smartos'
=>
'joyent_20130111T180733Z'
}.
each
do
|
p
,
pv
|
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
p
,
version:
pv
).
converge
(
described_recipe
)
end
it
"stops the system-log service on
#{
p
}
"
do
expect
(
chef_run
).
to
disable_service
(
'system-log'
)
end
end
end
context
'on OmniOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'omnios'
,
version:
'151018'
).
converge
(
described_recipe
)
end
let
(
:template
)
{
chef_run
.
template
(
'/var/svc/manifest/system/rsyslogd.xml'
)
}
let
(
:execute
)
{
chef_run
.
execute
(
'import rsyslog manifest'
)
}
it
'creates the custom SMF manifest'
do
expect
(
chef_run
).
to
render_file
(
template
.
path
)
end
it
'notifies svccfg to import the manifest'
do
expect
(
template
).
to
notify
(
'execute[import rsyslog manifest]'
).
to
(
:run
)
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'5.11'
).
converge
(
described_recipe
)
end
it
'notifies rsyslog to restart when importing the manifest'
do
expect
(
execute
).
to
notify
(
'
service
[
system
/rsyslogd]'
).
to
(
:restart
)
it
"stops the system-log service on
#{
p
}
"
do
expect
(
chef_run
).
to
disable_
service
(
'
system
-log'
)
end
end
...
...
spec/server_spec.rb
View file @
452afcbc
...
...
@@ -56,7 +56,7 @@ describe 'rsyslog::server' do
context
'on SmartOS'
do
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
)
do
|
node
|
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
)
do
|
node
|
node
.
normal
[
'rsyslog'
][
'server'
]
=
false
end
.
converge
(
described_recipe
)
end
...
...
@@ -103,7 +103,7 @@ describe 'rsyslog::server' do
end
let
(
:chef_run
)
do
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
joyent_20130111T180733Z
'
)
do
|
node
|
ChefSpec
::
ServerRunner
.
new
(
platform:
'smartos'
,
version:
'
5.11
'
)
do
|
node
|
node
.
normal
[
'rsyslog'
][
'server'
]
=
false
end
.
converge
(
described_recipe
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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