fuel-library/deployment/puppet/galera/spec/unit/classes/init_spec.rb
Alex Schultz 143d574edf Rewrite service override to use policy-rc.d
The override file in Debian based systems will only prevent the service
from being started if the service has a configuration file[0] in
/etc/init. Since not all services may have a config file, the better
way to prevent services from starting as part of the installation
process is to use a policy-rc.d file[1]. This change replaces the use
of /etc/init/<servicename>.override with the creation of a
/usr/sbin/policy-rc.d file durring the installation process.

This change also includes an update to the galera module where we were
previously utilizing the policy-rc.d method for mysql server.

[0] http://manpages.ubuntu.com/manpages/trusty/man5/init.5.html
[1] https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt

Change-Id: I8e09e1403c554b2b8fae6fe915590d7235ce9b99
Closes-Bug: #1532331
Related-Blueprint: deploy-with-uca-packages
2016-01-08 15:56:36 -07:00

88 lines
2.4 KiB
Ruby

require 'spec_helper.rb'
require 'shared-examples'
describe 'galera', :type => :class do
context 'Defaults on CentOS' do
let(:facts) { Facts.centos_facts }
it_behaves_like 'galera-init'
end
context 'Defaults on Ubuntu' do
let(:facts) { Facts.ubuntu_facts }
it_behaves_like 'galera-init'
end
context 'Percona on CentOS' do
let(:facts) { Facts.centos_facts }
p = {
:use_percona => true,
:use_percona_packages => false
}
# we only test compile and packages because this configuration should
# result in a puppet error indicating no support
it_behaves_like 'compile', p
it_behaves_like 'test-packages', p
end
context 'Percona on Ubuntu' do
let(:facts) { Facts.ubuntu_facts }
p = {
:use_percona => true,
:use_percona_packages => false
}
it_behaves_like 'galera-init', p
# these are extra things that should be expected on Ubuntu to work around
# the package installation on Ubuntu
let(:params) { p }
it {
should contain_exec('rm-99tmp')
}
end
context 'Percona Packages on CentOS' do
let(:facts) { Facts.centos_facts }
p = {
:use_percona => true,
:use_percona_packages => true
}
it_behaves_like 'galera-init', p
end
context 'Percona Packages on Ubuntu' do
let(:facts) { Facts.ubuntu_facts }
p = {
:use_percona => true,
:use_percona_packages => true
}
it_behaves_like 'galera-init', p
# these are extra things that should be expected on Ubuntu to work around
# the package installation on Ubuntu
let(:params) { p }
it {
should contain_exec('rm-99tmp')
}
end
context 'Primary Controller on CentOS' do
let(:facts) { Facts.centos_facts }
p = { :primary_controller => true }
it_behaves_like 'galera-init', p
end
context 'Primary Controller on Ubuntu' do
let(:facts) { Facts.ubuntu_facts }
p = { :primary_controller => true }
it_behaves_like 'galera-init', p
end
context 'wsrep_sst_method mysqldump on CentOS' do
let(:facts) { Facts.centos_facts }
p = { :wsrep_sst_method => 'undef' }
it_behaves_like 'galera-init', p
end
context 'wsrep_sst_method mysqldump on Ubuntu' do
let(:facts) { Facts.ubuntu_facts }
p = { :wsrep_sst_method => 'mysqldump' }
it_behaves_like 'galera-init', p
end
end
# vim: set ts=2 sw=2 et :