Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9124260
unit_file_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
unit_file_spec.rb
View Options
require
'spec_helper'
describe
'systemd::unit_file'
do
let
(
:facts
)
{
{
:path
=>
'/usr/bin'
,
}
}
context
'default params'
do
let
(
:title
)
{
'fancy.service'
}
it
'creates the unit file'
do
should
contain_file
(
'/etc/systemd/system/fancy.service'
)
.
with
({
'ensure'
=>
'file'
,
'owner'
=>
'root'
,
'group'
=>
'root'
,
'mode'
=>
'0444'
,
})
end
it
'triggers systemd daemon-reload'
do
should
contain_class
(
'systemd'
)
should
contain_file
(
'/etc/systemd/system/fancy.service'
)
.
with_notify
(
"Exec[systemctl-daemon-reload]"
)
end
end
context
'with params'
do
let
(
:title
)
{
'fancy.service'
}
let
(
:params
)
{
{
:ensure
=>
'absent'
,
:path
=>
'/usr/lib/systemd/system'
,
:content
=>
'some-content'
,
:source
=>
'some-source'
,
:target
=>
'some-target'
,
}
}
it
'creates the unit file'
do
should
contain_file
(
'/usr/lib/systemd/system/fancy.service'
)
.
with
({
'ensure'
=>
'absent'
,
'content'
=>
'some-content'
,
'source'
=>
'some-source'
,
'target'
=>
'some-target'
,
})
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 6:54 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3422938
Attached To
R139 puppet-camptocamp-systemd
Event Timeline
Log In to Comment