2013-10-15 23:16:40 +02:00
|
|
|
require 'spec_helper_acceptance'
|
|
|
|
|
2014-02-26 18:54:48 +01:00
|
|
|
describe 'mysql::server::account_security class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
2013-10-15 23:16:40 +02:00
|
|
|
describe 'running puppet code' do
|
|
|
|
it 'should work with no errors' do
|
|
|
|
pp = <<-EOS
|
|
|
|
class { 'mysql::server': remove_default_accounts => true }
|
|
|
|
EOS
|
|
|
|
|
|
|
|
# Run it twice and test for idempotency
|
|
|
|
apply_manifest(pp, :catch_failures => true)
|
|
|
|
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'accounts' do
|
|
|
|
it 'should delete accounts' do
|
|
|
|
shell("mysql -e 'show grants for root@127.0.0.1;'", :acceptable_exit_codes => 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should delete databases' do
|
|
|
|
shell("mysql -e 'show databases;' |grep test", :acceptable_exit_codes => 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|