File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ class { 'mysql::server': }
25
25
default_params
26
26
end
27
27
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
+
28
34
it 'contains the wrapper script' do
29
35
is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
30
36
%r{(\n *^xtrabackup\s +.*\$ @)} ,
@@ -304,6 +310,18 @@ class { 'mysql::server': }
304
310
)
305
311
end
306
312
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
307
325
end
308
326
end
309
327
# rubocop:enable RSpec/NestedGroups
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ cleanup
59
59
<% unless @delete_before_dump -%>
60
60
if [ $? -eq 0 ] ; then
61
61
cleanup
62
+ <% if @backup_success_file_path -%>
62
63
touch <%= @backup_success_file_path %>
64
+ <% end -%>
63
65
fi
64
66
<% end -%>
65
67
You can’t perform that action at this time.
0 commit comments