Merge pull request #848 from bmjen/fix-backup
Skips mysqlbackup.sh tests on MySQL 5.7+
This commit is contained in:
commit
269c913b66
5 changed files with 58 additions and 29 deletions
|
@ -1,6 +1,6 @@
|
||||||
fixtures:
|
fixtures:
|
||||||
repositories:
|
repositories:
|
||||||
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib"
|
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib"
|
||||||
"staging": "https://github.com/nanliu/puppet-staging"
|
"staging": "https://github.com/voxpupuli/puppet-staging"
|
||||||
symlinks:
|
symlinks:
|
||||||
"mysql": "#{source_dir}"
|
"mysql": "#{source_dir}"
|
||||||
|
|
|
@ -908,14 +908,16 @@ loopback interfaces. Because those nodes aren't connected to the outside world,
|
||||||
This module has been tested on:
|
This module has been tested on:
|
||||||
|
|
||||||
* RedHat Enterprise Linux 5, 6, 7
|
* RedHat Enterprise Linux 5, 6, 7
|
||||||
* Debian 6, 7
|
* Debian 6, 7, 8
|
||||||
* CentOS 5, 6, 7
|
* CentOS 5, 6, 7
|
||||||
* Ubuntu 10.04, 12.04, 14.04
|
* Ubuntu 10.04, 12.04, 14.04, 16.04
|
||||||
* Scientific Linux 5, 6
|
* Scientific Linux 5, 6
|
||||||
* SLES 11
|
* SLES 11
|
||||||
|
|
||||||
Testing on other platforms has been minimal and cannot be guaranteed.
|
Testing on other platforms has been minimal and cannot be guaranteed.
|
||||||
|
|
||||||
|
**Note:** The mysqlbackup.sh does not work and is not supported on MySQL 5.7 and greater.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Puppet Labs modules on the Puppet Forge are open projects, and community
|
Puppet Labs modules on the Puppet Forge are open projects, and community
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
|
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"},
|
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"},
|
||||||
{"name":"nanliu/staging","version_requirement":">= 1.0.1 < 2.0.0"}
|
{"name":"puppet/staging","version_requirement":">= 1.0.1 < 2.0.0"}
|
||||||
],
|
],
|
||||||
"operatingsystem_support": [
|
"operatingsystem_support": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,28 +47,40 @@ describe 'mysql::server::backup class' do
|
||||||
|
|
||||||
describe 'mysqlbackup.sh' do
|
describe 'mysqlbackup.sh' do
|
||||||
it 'should run mysqlbackup.sh with no errors' do
|
it 'should run mysqlbackup.sh with no errors' do
|
||||||
shell("/usr/local/sbin/mysqlbackup.sh") do |r|
|
pre_run
|
||||||
expect(r.stderr).to eq("")
|
if ! version_is_greater_than('5.7.0')
|
||||||
|
shell("/usr/local/sbin/mysqlbackup.sh") do |r|
|
||||||
|
expect(r.stderr).to eq("")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should dump all databases to single file' do
|
it 'should dump all databases to single file' do
|
||||||
shell('ls -l /tmp/backups/mysql_backup_*-*.sql.bz2 | wc -l') do |r|
|
pre_run
|
||||||
expect(r.stdout).to match(/1/)
|
if ! version_is_greater_than('5.7.0')
|
||||||
expect(r.exit_code).to be_zero
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'should create one file per database per run' do
|
context 'should create one file per database per run' do
|
||||||
it 'executes mysqlbackup.sh a second time' do
|
it 'executes mysqlbackup.sh a second time' do
|
||||||
shell('sleep 1')
|
pre_run
|
||||||
shell('/usr/local/sbin/mysqlbackup.sh')
|
if ! version_is_greater_than('5.7.0')
|
||||||
|
shell('sleep 1')
|
||||||
|
shell('/usr/local/sbin/mysqlbackup.sh')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates at least one backup tarball' do
|
it 'creates at least one backup tarball' do
|
||||||
shell('ls -l /tmp/backups/mysql_backup_*-*.sql.bz2 | wc -l') do |r|
|
pre_run
|
||||||
expect(r.stdout).to match(/2/)
|
if ! version_is_greater_than('5.7.0')
|
||||||
expect(r.exit_code).to be_zero
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -110,31 +122,43 @@ describe 'mysql::server::backup class' do
|
||||||
|
|
||||||
describe 'mysqlbackup.sh' do
|
describe 'mysqlbackup.sh' do
|
||||||
it 'should run mysqlbackup.sh with no errors without root credentials' do
|
it 'should run mysqlbackup.sh with no errors without root credentials' do
|
||||||
shell("HOME=/tmp/dontreadrootcredentials /usr/local/sbin/mysqlbackup.sh") do |r|
|
pre_run
|
||||||
expect(r.stderr).to eq("")
|
if ! version_is_greater_than('5.7.0')
|
||||||
|
shell("HOME=/tmp/dontreadrootcredentials /usr/local/sbin/mysqlbackup.sh") do |r|
|
||||||
|
expect(r.stderr).to eq("")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should create one file per database' do
|
it 'should create one file per database' do
|
||||||
['backup1', 'backup2'].each do |database|
|
pre_run
|
||||||
shell("ls -l /tmp/backups/mysql_backup_#{database}_*-*.sql.bz2 | wc -l") do |r|
|
if ! version_is_greater_than('5.7.0')
|
||||||
expect(r.stdout).to match(/1/)
|
['backup1', 'backup2'].each do |database|
|
||||||
expect(r.exit_code).to be_zero
|
shell("ls -l /tmp/backups/mysql_backup_#{database}_*-*.sql.bz2 | wc -l") do |r|
|
||||||
|
expect(r.stdout).to match(/1/)
|
||||||
|
expect(r.exit_code).to be_zero
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'should create one file per database per run' do
|
context 'should create one file per database per run' do
|
||||||
it 'executes mysqlbackup.sh a second time' do
|
it 'executes mysqlbackup.sh a second time' do
|
||||||
shell('sleep 1')
|
pre_run
|
||||||
shell('HOME=/tmp/dontreadrootcredentials /usr/local/sbin/mysqlbackup.sh')
|
if ! version_is_greater_than('5.7.0')
|
||||||
|
shell('sleep 1')
|
||||||
|
shell('HOME=/tmp/dontreadrootcredentials /usr/local/sbin/mysqlbackup.sh')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has one file per database per run' do
|
it 'has one file per database per run' do
|
||||||
['backup1', 'backup2'].each do |database|
|
pre_run
|
||||||
shell("ls -l /tmp/backups/mysql_backup_#{database}_*-*.sql.bz2 | wc -l") do |r|
|
if ! version_is_greater_than('5.7.0')
|
||||||
expect(r.stdout).to match(/2/)
|
['backup1', 'backup2'].each do |database|
|
||||||
expect(r.exit_code).to be_zero
|
shell("ls -l /tmp/backups/mysql_backup_#{database}_*-*.sql.bz2 | wc -l") do |r|
|
||||||
|
expect(r.stdout).to match(/2/)
|
||||||
|
expect(r.exit_code).to be_zero
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -179,8 +203,11 @@ describe 'mysql::server::backup class' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should run mysqlbackup.sh with no errors' do
|
it 'should run mysqlbackup.sh with no errors' do
|
||||||
shell("/usr/local/sbin/mysqlbackup.sh") do |r|
|
pre_run
|
||||||
expect(r.stderr).to eq("")
|
if ! version_is_greater_than('5.7.0')
|
||||||
|
shell("/usr/local/sbin/mysqlbackup.sh") do |r|
|
||||||
|
expect(r.stderr).to eq("")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,7 +49,7 @@ RSpec.configure do |c|
|
||||||
else
|
else
|
||||||
on host, puppet('module','install','puppetlabs-stdlib','--version','3.2.0')
|
on host, puppet('module','install','puppetlabs-stdlib','--version','3.2.0')
|
||||||
on host, puppet('module','install','stahnma/epel')
|
on host, puppet('module','install','stahnma/epel')
|
||||||
on host, puppet('module','install','nanliu/staging')
|
on host, puppet('module','install','puppet/staging')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue