@@ -28,13 +28,13 @@ class { 'mysql::server': }
28
28
it { is_expected . to contain_class ( 'mysql::params' ) }
29
29
30
30
it 'does not contain the touch command' do
31
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . without_content (
31
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . without_content (
32
32
%r{(^\s +touch\s +$)} ,
33
33
)
34
34
end
35
35
36
36
it 'contains the wrapper script' do
37
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
37
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
38
38
%r{(\n *^xtrabackup\s +.*\$ @)} ,
39
39
)
40
40
end
@@ -61,7 +61,7 @@ class { 'mysql::server': }
61
61
end
62
62
63
63
it 'contains the weekly cronjob' do
64
- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
64
+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
65
65
. with (
66
66
ensure : 'present' ,
67
67
command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup' ,
@@ -80,7 +80,7 @@ class { 'mysql::server': }
80
80
else
81
81
'$(date -d "last sunday" +\%F)_full'
82
82
end
83
- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' )
83
+ is_expected . to contain_cron ( 'xtrabackup-daily' )
84
84
. with (
85
85
ensure : 'present' ,
86
86
command : "/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp/#{ dateformat } --target-dir=/tmp/$(date +\\ %F_\\ %H-\\ %M-\\ %S) --backup" ,
@@ -100,14 +100,14 @@ class { 'mysql::server': }
100
100
end
101
101
102
102
it 'contains the defined mysql user' do
103
- expect ( subject ) . to contain_mysql_user ( 'backupuser@localhost' )
103
+ is_expected . to contain_mysql_user ( 'backupuser@localhost' )
104
104
. with (
105
105
ensure : 'present' ,
106
106
password_hash : '*4110E08DF51E70A4BA1D4E33A84205E38CF3FE58' ,
107
107
)
108
108
. that_requires ( 'Class[mysql::server::root_password]' )
109
109
110
- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
110
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
111
111
. with (
112
112
ensure : 'present' ,
113
113
user : 'backupuser@localhost' ,
@@ -129,9 +129,9 @@ class { 'mysql::server': }
129
129
end
130
130
131
131
it {
132
- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
133
- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
134
- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/*.*' )
132
+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
133
+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
134
+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/*.*' )
135
135
. with (
136
136
ensure : 'present' ,
137
137
user : 'backupuser@localhost' ,
@@ -150,7 +150,7 @@ class { 'mysql::server': }
150
150
end
151
151
152
152
it {
153
- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
153
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
154
154
. with (
155
155
ensure : 'present' ,
156
156
user : 'backupuser@localhost' ,
@@ -164,7 +164,7 @@ class { 'mysql::server': }
164
164
end ,
165
165
)
166
166
. that_requires ( 'Mysql_user[backupuser@localhost]' )
167
- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
167
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
168
168
. with (
169
169
ensure : 'present' ,
170
170
user : 'backupuser@localhost' ,
@@ -174,7 +174,7 @@ class { 'mysql::server': }
174
174
)
175
175
. that_requires ( 'Mysql_user[backupuser@localhost]' )
176
176
177
- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
177
+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
178
178
. with (
179
179
ensure : 'present' ,
180
180
user : 'backupuser@localhost' ,
@@ -221,7 +221,7 @@ class { 'mysql::server': }
221
221
end
222
222
223
223
it 'contains the weekly cronjob' do
224
- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
224
+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
225
225
. with (
226
226
ensure : 'present' ,
227
227
command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup --skip-ssl' ,
@@ -234,7 +234,7 @@ class { 'mysql::server': }
234
234
end
235
235
236
236
it 'contains the daily cronjob for weekdays 1-6' do
237
- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' )
237
+ is_expected . to contain_cron ( 'xtrabackup-daily' )
238
238
. with (
239
239
ensure : 'present' ,
240
240
command : "/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp/#{ dateformat } --target-dir=/tmp/$(date +\\ %F_\\ %H-\\ %M-\\ %S) --backup --skip-ssl" ,
@@ -253,11 +253,11 @@ class { 'mysql::server': }
253
253
end
254
254
255
255
it 'not contains the weekly cronjob' do
256
- expect ( subject ) . not_to contain_cron ( 'xtrabackup-weekly' )
256
+ is_expected . not_to contain_cron ( 'xtrabackup-weekly' )
257
257
end
258
258
259
259
it 'contains the daily cronjob with all weekdays' do
260
- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' ) . with (
260
+ is_expected . to contain_cron ( 'xtrabackup-daily' ) . with (
261
261
ensure : 'present' ,
262
262
command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup' ,
263
263
user : 'root' ,
@@ -275,7 +275,7 @@ class { 'mysql::server': }
275
275
end
276
276
277
277
it 'contains the prescript' do
278
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
278
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
279
279
%r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
280
280
)
281
281
end
@@ -288,7 +288,7 @@ class { 'mysql::server': }
288
288
end
289
289
290
290
it 'contains the prostscript' do
291
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
291
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
292
292
%r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
293
293
)
294
294
end
@@ -301,7 +301,7 @@ class { 'mysql::server': }
301
301
end
302
302
303
303
it 'contain the mariabackup executor' do
304
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
304
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
305
305
%r{(\n *^mariabackup\s +.*\$ @)} ,
306
306
)
307
307
end
@@ -313,7 +313,7 @@ class { 'mysql::server': }
313
313
end
314
314
315
315
it 'contain the touch /tmp/backup_success command' do
316
- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
316
+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
317
317
%r{(^\s +touch /tmp/backup_success$)} ,
318
318
)
319
319
end
0 commit comments