Skip to content

Commit

Permalink
Add custom pid spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Van Gestel committed Jan 15, 2024
1 parent 7dd1d59 commit 9797ddc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/classes/varnish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
it { is_expected.to contain_file('varnish-conf').with_content(%r{VARNISH_TTL=120}) }
it { is_expected.to contain_file('varnish-conf').with_content(%r{DAEMON_OPTS="-a :6081 }) }
it { is_expected.not_to contain_file('varnish-conf').with_content(%r{-a /tmp/varnish.sock,PROXY,user=varnish,group=varnish,mode=666}) }
it { is_expected.not_to contain_file('varnish-conf').with_content(%r{-P /run/varnishd.pid}) }

it {
is_expected.to contain_file('storage-dir').with(
Expand Down Expand Up @@ -134,6 +135,15 @@
}
end

context 'with custom pid file' do
let :params do
{ varnish_pid_file_path: '/run/varnishd.pid' }
end

it { is_expected.to compile }
it { is_expected.to contain_file('varnish-conf').with_content(%r{-P /run/varnishd.pid}) }
end

context 'without shmlog_tempfs' do
let :params do
{ shmlog_tempfs: false }
Expand Down

0 comments on commit 9797ddc

Please sign in to comment.