Skip to content

Commit

Permalink
Merge pull request #758 from steventwheeler/feature/add-mysql-wsrepst…
Browse files Browse the repository at this point in the history
…ats-tests

Fix the MySQL plugin's WsrepStats parameter
  • Loading branch information
juniorsysadmin committed Mar 3, 2018
2 parents 432313e + b3775b0 commit 4d7bc0c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions spec/defines/collectd_plugin_mysql_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,39 @@
is_expected.to contain_file('test.conf').without_content(%r{Socket})
end
end

context 'without wsrepstats enabled' do
let(:title) { 'test' }
let :params do
{ wsrepstats: :undef }
end

it "Will create #{options[:plugin_conf_dir]}/mysql-test.conf" do
is_expected.to contain_file('test.conf').without_content(%r{WsrepStats})
end
end

context 'with wsrepstats enabled' do
let(:title) { 'test' }
let :params do
{ wsrepstats: true }
end

it "Will create #{options[:plugin_conf_dir]}/mysql-test.conf" do
is_expected.to contain_file('test.conf').with_content(%r{WsrepStats true})
end
end

context 'with wsrepstats disabled' do
let(:title) { 'test' }
let :params do
{ wsrepstats: false }
end

it "Will create #{options[:plugin_conf_dir]}/mysql-test.conf" do
is_expected.to contain_file('test.conf').with_content(%r{WsrepStats false})
end
end
end
end
end
2 changes: 1 addition & 1 deletion templates/mysql-database.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
InnodbStats <%= @innodbstats %>
<%- end -%>
<%- if not @wsrepstats.nil? -%>
WsrepStatsStats <%= @WsrepStats %>
WsrepStats <%= @wsrepstats %>
<%- end -%>
<%- end -%>
<%- if not @slavenotifications.nil? -%>
Expand Down

0 comments on commit 4d7bc0c

Please sign in to comment.