File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 44<% if v.is_a?(Hash) -%>
55[<%= k %> ]
66<% v.sort.map do |ki, vi| -%>
7- <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%>
7+ <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) or (ki =~ /^ssl-/ and v['ssl'] == false) -%>
88<% next %>
99<% elsif vi == true or vi == '' -%>
1010<%= ki %>
You can’t perform that action at this time.
0 commit comments