From df20c08345fba0b43833eef47c4da2fdd78523e9 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 27 Jun 2018 22:57:38 -0700 Subject: Automatic update of rubocop violations Add exclusions for: Layout/IndentHeredoc, Metrics/BlockNesting: Metrics/LineLength: Style/AccessorMethodName: Style/DoubleNegation: Style/MultipleComparison: Style/NumericPredicate: Style/PredicateName: Style/SignalException: Style/VariableName: SignalException is disabled because Puppet::Type#fail overrides Kernel#fail, and we really do want fail and not raise. --- spec/acceptance/puppet.rb | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'spec/acceptance/puppet.rb') diff --git a/spec/acceptance/puppet.rb b/spec/acceptance/puppet.rb index 10fb159..048a3db 100644 --- a/spec/acceptance/puppet.rb +++ b/spec/acceptance/puppet.rb @@ -1,14 +1,13 @@ -test_name "Augeas puppet configuration" do - +test_name 'Augeas puppet configuration' do tag 'risk:medium', 'audit:medium', 'audit:acceptance', - 'audit:refactor' # move to types test dir + 'audit:refactor' # move to types test dir skip_test 'requires augeas which is included in AIO' if @options[:type] != 'aio' - confine :except, :platform => 'windows' - confine :to, {}, hosts.select { |host| ! host[:roles].include?('master') } + confine :except, platform: 'windows' + confine :to, {}, hosts.reject { |host| host[:roles].include?('master') } teardown do agents.each do |agent| @@ -17,17 +16,17 @@ test_name "Augeas puppet configuration" do end agents.each do |agent| - step "Backup the puppet config" do + step 'Backup the puppet config' do on agent, "mv #{agent.puppet['confdir']}/puppet.conf /tmp/puppet.conf.bak" end - step "Create a new puppet config that has a master and agent section" do + step 'Create a new puppet config that has a master and agent section' do puppet_conf = <<-CONF [main] CONF on agent, "echo \"#{puppet_conf}\" >> #{agent.puppet['confdir']}/puppet.conf" end - step "Modify the puppet.conf file" do + step 'Modify the puppet.conf file' do manifest = <<-EOF augeas { 'puppet agent noop mode': context => "/files#{agent.puppet['confdir']}/puppet.conf/agent", @@ -36,11 +35,9 @@ test_name "Augeas puppet configuration" do changes => 'set noop true', } EOF - on agent, puppet_apply('--verbose'), :stdin => manifest + on agent, puppet_apply('--verbose'), stdin: manifest on agent, "grep 'noop=true' #{agent.puppet['confdir']}/puppet.conf" end - end - end -- cgit v1.2.3