Skip to content

Commit 92ee684

Browse files
committed
(MODULES-3702) add tests proving that service_manage is working
1 parent d5d9d2a commit 92ee684

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

spec/acceptance/mysql_server_spec.rb

+29
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,35 @@ class { 'mysql::server':
5151
it_behaves_like "a idempotent resource"
5252
end
5353

54+
describe 'minimal config' do
55+
before(:all) do
56+
@tmpdir = default.tmpdir('mysql')
57+
end
58+
let(:pp) do
59+
<<-EOS
60+
class { 'mysql::server':
61+
config_file => '#{@tmpdir}/my.cnf',
62+
includedir => '#{@tmpdir}/include',
63+
manage_config_file => 'false',
64+
override_options => { 'mysqld' => { 'key_buffer_size' => '32M' }},
65+
package_ensure => 'present',
66+
purge_conf_dir => 'false',
67+
remove_default_accounts => 'false',
68+
restart => 'false',
69+
root_group => 'root',
70+
root_password => 'test',
71+
service_enabled => 'false',
72+
service_manage => 'false',
73+
users => {},
74+
grants => {},
75+
databases => {},
76+
}
77+
EOS
78+
end
79+
80+
it_behaves_like "a idempotent resource"
81+
end
82+
5483
describe 'syslog configuration' do
5584
let(:pp) do
5685
<<-EOS

spec/acceptance/nodesets/centos-7-x64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HOSTS:
33
roles:
44
- agent
55
- default
6-
platform: redhat-7-x86_64
6+
platform: el-7-x86_64
77
hypervisor: vagrant
88
box: puppetlabs/centos-7.2-64-nocm
99
CONFIG:

spec/classes/mysql_server_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
it { is_expected.to compile.with_all_deps }
2828
end
2929

30+
context 'when not managing the service' do
31+
let(:params) {{ :service_manage => false }}
32+
it { is_expected.to compile.with_all_deps }
33+
it { is_expected.not_to contain_service('mysqld') }
34+
end
35+
3036
context 'mysql::server::install' do
3137
it 'contains the package by default' do
3238
is_expected.to contain_package('mysql-server').with({

0 commit comments

Comments
 (0)