File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ class { 'mysql::server': }
2424 let ( :params ) do
2525 default_params
2626 end
27+ it 'does not contain the touch /tmp/backup_success command' do
28+ is_expected . to contain_file ( 'xtrabackup.sh' ) . without_content (
29+ %r{(^\s +touch\s +$)} ,
30+ )
31+ end
2732
2833 it 'contains the wrapper script' do
2934 is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
@@ -304,6 +309,18 @@ class { 'mysql::server': }
304309 )
305310 end
306311 end
312+
313+ context 'with backup_success_file_path' do
314+ let ( :params ) do
315+ { backup_success_file_path : '/tmp/backup_success' } . merge ( default_params )
316+ end
317+
318+ it 'contain the touch /tmp/backup_success command' do
319+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
320+ %r{(^\s +touch /tmp/backup_success$)} ,
321+ )
322+ end
323+ end
307324 end
308325 end
309326 # rubocop:enable RSpec/NestedGroups
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ cleanup
5959<% unless @delete_before_dump -%>
6060if [ $? -eq 0 ] ; then
6161 cleanup
62+ <% if @backup_success_file_path -%>
6263 touch <%= @backup_success_file_path %>
64+ <% end -%>
6365fi
6466<% end -%>
6567
You can’t perform that action at this time.
0 commit comments