Merge pull request #648 from cmurphy/fix_tests
Fix acceptance tests from #641
This commit is contained in:
commit
d5defe2535
1 changed files with 55 additions and 22 deletions
|
@ -1,32 +1,65 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'mysql_plugin' do
|
# Different operating systems (and therefore different versions/forks
|
||||||
describe 'setup' do
|
# of mysql) have varying levels of support for plugins and have
|
||||||
it 'should work with no errors' do
|
# different plugins available. Choose a plugin that works or don't try
|
||||||
pp = <<-EOS
|
# to test plugins if not available.
|
||||||
class { 'mysql::server': }
|
if fact('osfamily') =~ /RedHat/
|
||||||
EOS
|
if fact('operatingsystemrelease') =~ /^5\./
|
||||||
|
plugin = nil # Plugins not supported on mysql on RHEL 5
|
||||||
apply_manifest(pp, :catch_failures => true)
|
elsif fact('operatingsystemrelease') =~ /^6\./
|
||||||
end
|
plugin = 'example'
|
||||||
|
plugin_lib = 'ha_example.so'
|
||||||
|
elsif fact('operatingsystemrelease') =~ /^7\./
|
||||||
|
plugin = 'pam'
|
||||||
|
plugin_lib = 'auth_pam.so'
|
||||||
end
|
end
|
||||||
|
elsif fact('osfamily') =~ /Debian/
|
||||||
|
if fact('operatingsystem') =~ /Debian/
|
||||||
|
if fact('operatingsystemrelease') =~ /^6\./
|
||||||
|
# Only available plugin is innodb which is already loaded and not unload- or reload-able
|
||||||
|
plugin = nil
|
||||||
|
elsif fact('operatingsystemrelease') =~ /^7\./
|
||||||
|
plugin = 'example'
|
||||||
|
plugin_lib = 'ha_example.so'
|
||||||
|
end
|
||||||
|
elsif fact('operatingsystem') =~ /Ubuntu/
|
||||||
|
plugin = 'example'
|
||||||
|
plugin_lib = 'ha_example.so'
|
||||||
|
end
|
||||||
|
elsif fact('osfamily') =~ /Suse/
|
||||||
|
plugin = nil # Plugin library path is broken on Suse http://lists.opensuse.org/opensuse-bugs/2013-08/msg01123.html
|
||||||
|
end
|
||||||
|
|
||||||
describe 'load plugin' do
|
describe 'mysql_plugin' do
|
||||||
it 'should work without errors' do
|
if plugin # if plugins are supported
|
||||||
pp = <<-EOS
|
describe 'setup' do
|
||||||
mysql_plugin { 'auth_socket':
|
it 'should work with no errors' do
|
||||||
ensure => present,
|
pp = <<-EOS
|
||||||
soname => 'auth_socket.so',
|
class { 'mysql::server': }
|
||||||
}
|
EOS
|
||||||
EOS
|
|
||||||
|
|
||||||
apply_manifest(pp, :catch_failures => true)
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should find the plugin' do
|
describe 'load plugin' do
|
||||||
shell("mysql -NBe \"select plugin_name from information_schema.plugins where plugin_name='auth_socket'\"") do |r|
|
it 'should work without errors' do
|
||||||
expect(r.stdout).to match(/^auth_socket$/)
|
pp = <<-EOS
|
||||||
expect(r.stderr).to be_empty
|
mysql_plugin { #{plugin}:
|
||||||
|
ensure => present,
|
||||||
|
soname => '#{plugin_lib}',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should find the plugin' do
|
||||||
|
shell("mysql -NBe \"select plugin_name from information_schema.plugins where plugin_name='#{plugin}'\"") do |r|
|
||||||
|
expect(r.stdout).to match(/^#{plugin}$/i)
|
||||||
|
expect(r.stderr).to be_empty
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue