Fixes to various failing tests.
This commit is contained in:
parent
90c5abc4bb
commit
7224f12c25
3 changed files with 11 additions and 7 deletions
|
@ -4,7 +4,7 @@ describe 'mysql::server::backup class' do
|
|||
context 'should work with no errors' do
|
||||
it 'when configuring mysql backups' do
|
||||
pp = <<-EOS
|
||||
class { 'mysql::server': override_options => { 'root_password' => 'password' } }
|
||||
class { 'mysql::server': root_password => 'password' }
|
||||
mysql::db { 'backup1':
|
||||
user => 'backup',
|
||||
password => 'secret',
|
||||
|
@ -31,13 +31,14 @@ describe 'mysql::server::backup class' do
|
|||
describe 'mysqlbackup.sh' do
|
||||
it 'should run mysqlbackup.sh with no errors' do
|
||||
shell("/usr/local/sbin/mysqlbackup.sh") do |r|
|
||||
expect(r.stderr).to eq("")
|
||||
expect(r.stderr).to eq("-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.\n")
|
||||
end
|
||||
end
|
||||
|
||||
it 'should dump all databases to single file' do
|
||||
shell('ls /tmp/backups/ | grep -c "mysql_backup_backup1_[0-9][0-9]*-[0-9][0-9]*.sql.bz2"') do |r|
|
||||
expect(r.stdout).to match(/\d*[13579]/)
|
||||
shell('ls -l /tmp/backups/mysql_backup_*-*.sql.bz2 | wc -l') do |r|
|
||||
expect(r.stdout).to match(/1/)
|
||||
expect(r.exit_code).to be_zero
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -48,7 +49,10 @@ describe 'mysql::server::backup class' do
|
|||
end
|
||||
|
||||
it 'creates at least one backup tarball' do
|
||||
expect(shell('ls /tmp/backups/ | grep -c "mysql_backup_backup1_[0-9][0-9]*-[0-9][0-9]*.sql.bz2"').stdout).to match(/\d*[02468]/)
|
||||
shell('ls -l /tmp/backups/mysql_backup_*-*.sql.bz2 | wc -l') do |r|
|
||||
expect(r.stdout).to match(/2/)
|
||||
expect(r.exit_code).to be_zero
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ describe 'mysql::db define' do
|
|||
# Using puppet_apply as a helper
|
||||
it 'should work with no errors' do
|
||||
pp = <<-EOS
|
||||
class { 'mysql::server': override_options => { 'root_password' => 'password' } }
|
||||
class { 'mysql::server': root_password => 'password' }
|
||||
mysql::db { 'spec1':
|
||||
user => 'root1',
|
||||
password => 'password',
|
||||
|
|
|
@ -26,7 +26,7 @@ RSpec.configure do |c|
|
|||
end
|
||||
|
||||
shell('/bin/touch /etc/puppet/hiera.yaml')
|
||||
shell('puppet module install puppetlabs-stdlib --version 2.2.1', { :acceptable_exit_codes => [0,1] })
|
||||
shell('puppet module install puppetlabs-stdlib --version 3.2.0', { :acceptable_exit_codes => [0,1] })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue