7c7195ba33
The current MySQL module is hard to modify, test, and drop in replacement components to. This work starts out by refactoring the bindings support in MySQL to a completely seperate bindings class in order to reduce the amount of parameters in the main class for a feature that is infrequently used. In addition to this start the movement of client configuration and packages to the mysql::client::* namespace.
40 lines
877 B
Ruby
40 lines
877 B
Ruby
require 'spec_helper_system'
|
|
|
|
describe 'mysql class' do
|
|
case node.facts['osfamily']
|
|
when 'RedHat'
|
|
package_name = 'mysql-server'
|
|
service_name = 'mysqld'
|
|
when 'Suse'
|
|
package_name = 'mysql-community-server'
|
|
service_name = 'mysql'
|
|
when 'Debian'
|
|
package_name = 'mysql-server'
|
|
service_name = 'mysql'
|
|
end
|
|
|
|
describe 'running puppet code' do
|
|
# Using puppet_apply as a helper
|
|
it 'should work with no errors' do
|
|
pp = <<-EOS
|
|
class { 'mysql::server': }
|
|
EOS
|
|
|
|
# Run it twice and test for idempotency
|
|
puppet_apply(pp) do |r|
|
|
r.exit_code.should_not == 1
|
|
r.refresh
|
|
r.exit_code.should be_zero
|
|
end
|
|
end
|
|
end
|
|
|
|
describe package(package_name) do
|
|
it { should be_installed }
|
|
end
|
|
|
|
describe service(service_name) do
|
|
it { should be_running }
|
|
it { should be_enabled }
|
|
end
|
|
end
|