@@ -28,13 +28,13 @@ class{'mysql::server': }
2828it { is_expected . to contain_class ( 'mysql::params' ) }
2929
3030it '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 (
3232%r{(^\s +touch\s +$)} ,
3333)
3434end
3535
3636it '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 (
3838%r{(\n *^xtrabackup\s +.*\$ @)} ,
3939)
4040end
@@ -61,7 +61,7 @@ class{'mysql::server': }
6161end
6262
6363it 'contains the weekly cronjob' do
64- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
64+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
6565. with (
6666ensure : 'present' ,
6767command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup' ,
@@ -80,7 +80,7 @@ class{'mysql::server': }
8080else
8181'$(date -d "last sunday" +\%F)_full'
8282end
83- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' )
83+ is_expected . to contain_cron ( 'xtrabackup-daily' )
8484. with (
8585ensure : 'present' ,
8686command : "/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': }
100100end
101101
102102it 'contains the defined mysql user' do
103- expect ( subject ) . to contain_mysql_user ( 'backupuser@localhost' )
103+ is_expected . to contain_mysql_user ( 'backupuser@localhost' )
104104. with (
105105ensure : 'present' ,
106106password_hash : '*4110E08DF51E70A4BA1D4E33A84205E38CF3FE58' ,
107107)
108108. that_requires ( 'Class[mysql::server::root_password]' )
109109
110- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
110+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
111111. with (
112112ensure : 'present' ,
113113user : 'backupuser@localhost' ,
@@ -129,9 +129,9 @@ class{'mysql::server': }
129129end
130130
131131it {
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/*.*' )
135135. with (
136136ensure : 'present' ,
137137user : 'backupuser@localhost' ,
@@ -150,7 +150,7 @@ class{'mysql::server': }
150150end
151151
152152it {
153- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
153+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
154154. with (
155155ensure : 'present' ,
156156user : 'backupuser@localhost' ,
@@ -164,7 +164,7 @@ class{'mysql::server': }
164164end ,
165165)
166166. 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' )
168168. with (
169169ensure : 'present' ,
170170user : 'backupuser@localhost' ,
@@ -174,7 +174,7 @@ class{'mysql::server': }
174174)
175175. that_requires ( 'Mysql_user[backupuser@localhost]' )
176176
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' )
178178. with (
179179ensure : 'present' ,
180180user : 'backupuser@localhost' ,
@@ -221,7 +221,7 @@ class{'mysql::server': }
221221end
222222
223223it 'contains the weekly cronjob' do
224- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
224+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
225225. with (
226226ensure : 'present' ,
227227command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup --skip-ssl' ,
@@ -234,7 +234,7 @@ class{'mysql::server': }
234234end
235235
236236it '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' )
238238. with (
239239ensure : 'present' ,
240240command : "/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': }
253253end
254254
255255it 'not contains the weekly cronjob' do
256- expect ( subject ) . not_to contain_cron ( 'xtrabackup-weekly' )
256+ is_expected . not_to contain_cron ( 'xtrabackup-weekly' )
257257end
258258
259259it '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 (
261261ensure : 'present' ,
262262command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup' ,
263263user : 'root' ,
@@ -275,7 +275,7 @@ class{'mysql::server': }
275275end
276276
277277it 'contains the prescript' do
278- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
278+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
279279%r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
280280)
281281end
@@ -288,7 +288,7 @@ class{'mysql::server': }
288288end
289289
290290it 'contains the prostscript' do
291- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
291+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
292292%r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
293293)
294294end
@@ -301,7 +301,7 @@ class{'mysql::server': }
301301end
302302
303303it '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 (
305305%r{(\n *^mariabackup\s +.*\$ @)} ,
306306)
307307end
@@ -313,7 +313,7 @@ class{'mysql::server': }
313313end
314314
315315it '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 (
317317%r{(^\s +touch /tmp/backup_success$)} ,
318318)
319319end
0 commit comments