From 904cefa39f9a3971f37f710789e9cfef8e10c683 Mon Sep 17 00:00:00 2001 From: Brian Skarda Date: Wed, 27 Sep 2017 17:50:57 -0400 Subject: [PATCH] Fix chefspec tests The removed end tag in the logback config was added in https://github.com/michaelklishin/cassandra-chef-cookbook/commit/4ed5a7d59a246980f686d4b87da9294eb824e89e through a revert that ended up with two end tags. Also fixes #359 --- spec/opscenter_agent_datastax_spec.rb | 2 +- spec/rendered_templates/cassandra-env.sh | 1 + templates/default/logback.xml.erb | 1 - .../serverspec/opscenter_datastax_agent_spec.rb | 5 +---- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/opscenter_agent_datastax_spec.rb b/spec/opscenter_agent_datastax_spec.rb index f6f64f4d..258e6c20 100644 --- a/spec/opscenter_agent_datastax_spec.rb +++ b/spec/opscenter_agent_datastax_spec.rb @@ -15,7 +15,7 @@ end it 'installs the agent package' do - expect(chef_run).to install_package('datastax-agent').with(options: ['--always-have-options']) + expect(chef_run).to install_package('datastax-agent').with(options: '--always-have-options') end it 'starts & enables the service' do diff --git a/spec/rendered_templates/cassandra-env.sh b/spec/rendered_templates/cassandra-env.sh index 4a8cb9ce..34daf055 100644 --- a/spec/rendered_templates/cassandra-env.sh +++ b/spec/rendered_templates/cassandra-env.sh @@ -300,6 +300,7 @@ JVM_OPTS="$JVM_OPTS -XX:+CMSClassUnloadingEnabled" + JVM_OPTS="$JVM_OPTS $MX4J_ADDRESS" JVM_OPTS="$JVM_OPTS $MX4J_PORT" JVM_OPTS="$JVM_OPTS $JVM_EXTRA_OPTS" diff --git a/templates/default/logback.xml.erb b/templates/default/logback.xml.erb index e5eeecd1..5dbddab2 100644 --- a/templates/default/logback.xml.erb +++ b/templates/default/logback.xml.erb @@ -67,7 +67,6 @@ <%= node['cassandra']['logback']['debug']['pattern'] %> - <% end -%> diff --git a/test/integration/opscenter-agent-datastax/serverspec/opscenter_datastax_agent_spec.rb b/test/integration/opscenter-agent-datastax/serverspec/opscenter_datastax_agent_spec.rb index ea845997..58682368 100644 --- a/test/integration/opscenter-agent-datastax/serverspec/opscenter_datastax_agent_spec.rb +++ b/test/integration/opscenter-agent-datastax/serverspec/opscenter_datastax_agent_spec.rb @@ -1,16 +1,13 @@ require 'spec_helper' describe 'opscenter-datastax-agent' do - it 'installs, enables & runs the agent' do + context 'installs, enables & runs the agent' do describe package('datastax-agent') do it { should be_installed } end describe service('datastax-agent') do it { should be_enabled } - end - - describe service('datastax-agent') do it { should be_running } end end