Skip to content

Extend coverage to the contents of /etc/my.cnf. #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions spec/system/mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,56 @@ class { 'mysql::server': }
r.exit_code.should be_zero
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

describe package(package_name) do
it { should be_installed }
describe 'my.cnf' do
it 'should contain sensible values' do
pp = <<-EOS
class { 'mysql::server': }
EOS
puppet_apply(pp) do |r|
r.exit_code.should_not == 1
end
end

describe file('/etc/my.cnf') do
it { should contain 'key_buffer = 16M' }
it { should contain 'max_binlog_size = 100M' }
it { should contain 'query_cache_size = 16M' }
end
end

describe service(service_name) do
it { should be_running }
it { should be_enabled }
describe 'my.cnf changes' do
it 'sets values' do
pp = <<-EOS
class { 'mysql::server':
override_options => { 'mysqld' =>
{ 'key_buffer' => '32M',
'max_binlog_size' => '200M',
'query_cache_size' => '32M',
}
}
}
EOS
puppet_apply(pp) do |r|
r.exit_code.should_not == 1
end
end

describe file('/etc/my.cnf') do
it { should contain 'key_buffer = 32M' }
it { should contain 'max_binlog_size = 200M' }
it { should contain 'query_cache_size = 32M' }
end
end

end