summaryrefslogtreecommitdiff
path: root/puppet/modules/systemd/spec/defines/tmpfile_spec.rb
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-01-16 14:39:14 +0100
committervarac <varacanero@zeromail.org>2017-01-18 18:44:21 +0100
commit0117808a130c36f14f5b86879b52ed7ce2fa6d57 (patch)
treee26d0aec9b57eb3dd2b3544534e0d2c0a11cdf93 /puppet/modules/systemd/spec/defines/tmpfile_spec.rb
parentb4df96ee1d654b4f56fe901e548e4a80207b60d9 (diff)
git subrepo clone --force https://leap.se/git/puppet_systemd puppet/modules/systemd
subrepo: subdir: "puppet/modules/systemd" merged: "f3c4059" upstream: origin: "https://leap.se/git/puppet_systemd" branch: "master" commit: "f3c4059" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "841aa43"
Diffstat (limited to 'puppet/modules/systemd/spec/defines/tmpfile_spec.rb')
-rw-r--r--puppet/modules/systemd/spec/defines/tmpfile_spec.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/puppet/modules/systemd/spec/defines/tmpfile_spec.rb b/puppet/modules/systemd/spec/defines/tmpfile_spec.rb
new file mode 100644
index 00000000..4eb22acd
--- /dev/null
+++ b/puppet/modules/systemd/spec/defines/tmpfile_spec.rb
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+describe 'systemd::tmpfile' do
+
+ let(:facts) { {
+ :path => '/usr/bin',
+ } }
+
+ context 'default params' do
+
+ let(:title) { 'fancy.conf' }
+
+ it 'creates the tmpfile' do
+ should contain_file('/etc/tmpfiles.d/fancy.conf').with({
+ 'ensure' => 'file',
+ 'owner' => 'root',
+ 'group' => 'root',
+ 'mode' => '0444',
+ })
+ end
+
+ it 'triggers systemd daemon-reload' do
+ should contain_class('systemd')
+ should contain_file('/etc/tmpfiles.d/fancy.conf').with_notify("Exec[systemd-tmpfiles-create]")
+ end
+ end
+
+ context 'with params' do
+ let(:title) { 'fancy.conf' }
+
+ let(:params) { {
+ :ensure => 'absent',
+ :path => '/etc/tmpfiles.d/foo',
+ :content => 'some-content',
+ :source => 'some-source',
+ } }
+
+ it 'creates the unit file' do
+ should contain_file('/etc/tmpfiles.d/foo/fancy.conf').with({
+ 'ensure' => 'absent',
+ 'content' => 'some-content',
+ 'source' => 'some-source',
+ })
+ end
+
+ end
+
+end