X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fsystemd%2Fspec%2Fdefines%2Fdropin_file_spec.rb;fp=3rdparty%2Fmodules%2Fsystemd%2Fspec%2Fdefines%2Fdropin_file_spec.rb;h=0000000000000000000000000000000000000000;hb=c7e7bcc28cc5dc48a7e284a3c82f33df27d1f57d;hp=a4e87455e220f291f1334f02482985e3d2f7023c;hpb=f89d8091bbf5a7bd8f86ee80abb03c729cea8d74;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/systemd/spec/defines/dropin_file_spec.rb b/3rdparty/modules/systemd/spec/defines/dropin_file_spec.rb deleted file mode 100644 index a4e87455e..000000000 --- a/3rdparty/modules/systemd/spec/defines/dropin_file_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -require 'spec_helper' - -describe 'systemd::dropin_file' do - context 'supported operating systems' do - on_supported_os.each do |os, facts| - context "on #{os}" do - let(:facts) { facts } - - let(:title) { 'test.conf' } - - let(:params) {{ - :unit => 'test.service', - :content => 'random stuff' - }} - - it { is_expected.to compile.with_all_deps } - - it { is_expected.to create_file("/etc/systemd/system/#{params[:unit]}.d").with( - :ensure => 'directory', - ) } - - it { is_expected.to create_file("/etc/systemd/system/#{params[:unit]}.d/#{title}").with( - :ensure => 'file', - :content => /#{params[:content]}/, - :mode => '0444' - ) } - - it { is_expected.to create_file("/etc/systemd/system/#{params[:unit]}.d/#{title}").that_notifies('Class[systemd::systemctl::daemon_reload]') } - - context 'with a bad unit type' do - let(:title) { 'test.badtype' } - - it { - expect{ - is_expected.to compile.with_all_deps - }.to raise_error(/expects a match for Systemd::Dropin/) - } - end - - context 'with another drop-in file with the same filename (and content)' do - let(:default_params) {{ - :filename => 'longer-timeout.conf', - :content => 'random stuff' - }} - # Create drop-in file longer-timeout.conf for unit httpd.service - let :pre_condition do - "systemd::dropin_file { 'httpd_longer-timeout': - filename => '#{default_params[:filename]}', - unit => 'httpd.service', - content => '#{default_params[:context]}', - }" - end - # - # Create drop-in file longer-timeout.conf for unit ftp.service - let (:title) {'ftp_longer-timeout'} - let :params do - default_params.merge({ - :unit => 'ftp.service' - }) - end - - it { is_expected.to create_file("/etc/systemd/system/#{params[:unit]}.d/#{params[:filename]}").with( - :ensure => 'file', - :content => /#{params[:content]}/, - :mode => '0444' - ) } - end - end - end - end -end