File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ class { 'mysql::server': }
2525 default_params
2626 end
2727
28+ it 'does not contain the touch command' do
29+ is_expected . to contain_file ( 'xtrabackup.sh' ) . without_content (
30+ %r{(^\s +touch\s +$)} ,
31+ )
32+ end
33+
2834 it 'contains the wrapper script' do
2935 is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
3036 %r{(\n *^xtrabackup\s +.*\$ @)} ,
@@ -304,6 +310,18 @@ class { 'mysql::server': }
304310 )
305311 end
306312 end
313+
314+ context 'with backup_success_file_path' do
315+ let ( :params ) do
316+ { backup_success_file_path : '/tmp/backup_success' } . merge ( default_params )
317+ end
318+
319+ it 'contain the touch /tmp/backup_success command' do
320+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
321+ %r{(^\s +touch /tmp/backup_success$)} ,
322+ )
323+ end
324+ end
307325 end
308326 end
309327 # 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