File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 47
47
it { is_expected . to contain_file ( 'mysql-config-file' ) . with_content ( %r{ssl = false} ) }
48
48
end
49
49
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
+
50
57
# ssl-disable (and ssl) are special cased within mysql.
51
58
describe 'possibility of disabling ssl completely' do
52
59
let ( :params ) { { override_options : { 'mysqld' => { 'ssl' => true , 'ssl-disable' => true } } } }
53
60
54
61
it { is_expected . to contain_file ( 'mysql-config-file' ) . without_content ( %r{ssl = true} ) }
55
62
end
56
63
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
+
57
72
describe 'a non ssl option set to true' do
58
73
let ( :params ) { { override_options : { 'mysqld' => { 'test' => true } } } }
59
74
Original file line number Diff line number Diff line change 4
4
<% if v.is_a?(Hash) -%>
5
5
[<%= k %> ]
6
6
<% 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) -%>
8
8
<% next %>
9
9
<% elsif vi == true or vi == '' -%>
10
10
<%= ki %>
You can’t perform that action at this time.
0 commit comments