Skip to content

Commit 8a3782a

Browse files
authored
Merge pull request #876 from DavidS/test-service_manage
(MODULES-3702) add tests proving that service_manage is working
2 parents c12a8fb + 92ee684 commit 8a3782a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
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/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)