(maint) clean up some tests and skip skip-name-resolve for now on 5.7+

This commit is contained in:
Bryan Jen 2016-08-17 13:48:09 -07:00
parent 0ea083b643
commit 561a6b067c
3 changed files with 17 additions and 13 deletions

View file

@ -1,18 +1,9 @@
require 'spec_helper_acceptance'
require 'puppet'
require 'puppet/util/package'
require_relative './mysql_helper.rb'
describe 'mysql::server::backup class' do
def pre_run
apply_manifest("class { 'mysql::server': root_password => 'password' }", :catch_failures => true)
@mysql_version = (on default, 'mysql --version').output.chomp.match(/\d+\.\d+\.\d+/)[0]
end
def version_is_greater_than(version)
return Puppet::Util::Package.versioncmp(@mysql_version, version) > 0
end
context 'should work with no errors' do
it 'when configuring mysql backups' do
pp = <<-EOS

View file

@ -0,0 +1,8 @@
def pre_run
apply_manifest("class { 'mysql::server': root_password => 'password' }", :catch_failures => true)
@mysql_version = (on default, 'mysql --version').output.chomp.match(/\d+\.\d+\.\d+/)[0]
end
def version_is_greater_than(version)
return Puppet::Util::Package.versioncmp(@mysql_version, version) > 0
end

View file

@ -1,10 +1,12 @@
require 'spec_helper_acceptance'
require 'puppet'
require 'puppet/util/package'
require_relative '../mysql_helper.rb'
describe 'mysql_grant' do
before(:all) do
pp = <<-EOS
class { 'mysql::server':
class { 'mysql::server':
root_password => 'password',
}
EOS
@ -484,7 +486,10 @@ describe 'mysql_grant' do
end
it 'should fail with fqdn' do
expect(shell("mysql -NBe \"SHOW GRANTS FOR test@fqdn.com\"", { :acceptable_exit_codes => 1}).stderr).to match(/There is no such grant defined for user 'test' on host 'fqdn.com'/)
pre_run
if ! version_is_greater_than('5.7.0')
expect(shell("mysql -NBe \"SHOW GRANTS FOR test@fqdn.com\"", { :acceptable_exit_codes => 1}).stderr).to match(/There is no such grant defined for user 'test' on host 'fqdn.com'/)
end
end
it 'finds ipv4' do
shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'192.168.5.7'\"") do |r|