Skip to content

Commit b54ccd4

Browse files
committed
tests to verify ssl options are filtered out from my.cnf when ssl is disabled
1 parent 6cfcdbd commit b54ccd4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/classes/mycnf_template_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,28 @@
4747
it { is_expected.to contain_file('mysql-config-file').with_content(%r{ssl = false}) }
4848
end
4949

50+
describe 'ssl set to false filters out ssl options' do
51+
let(:params) { { override_options: { 'mysqld' => { 'ssl' => false, 'ssl-disable' => false, 'ssl-key' => '/etc/key.pem' } } } }
52+
53+
it { is_expected.to contain_file('mysql-config-file').with_content(%r{ssl = false}) }
54+
it { is_expected.to contain_file('mysql-config-file').without_content(%r{ssl-key}) }
55+
end
56+
5057
# ssl-disable (and ssl) are special cased within mysql.
5158
describe 'possibility of disabling ssl completely' do
5259
let(:params) { { override_options: { 'mysqld' => { 'ssl' => true, 'ssl-disable' => true } } } }
5360

5461
it { is_expected.to contain_file('mysql-config-file').without_content(%r{ssl = true}) }
5562
end
5663

64+
describe 'ssl-disable filters other ssl options' do
65+
let(:params) { { override_options: { 'mysqld' => { 'ssl' => true, 'ssl-disable' => true, 'ssl-key' => '/etc/key.pem' } } } }
66+
67+
it { is_expected.to contain_file('mysql-config-file').without_content(%r{ssl = true}) }
68+
it { is_expected.to contain_file('mysql-config-file').without_content(%r{ssl-disable}) }
69+
it { is_expected.to contain_file('mysql-config-file').without_content(%r{ssl-key}) }
70+
end
71+
5772
describe 'a non ssl option set to true' do
5873
let(:params) { { override_options: { 'mysqld' => { 'test' => true } } } }
5974

0 commit comments

Comments
 (0)