Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use chomp instead of chop #555

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-02-20 13:57:00 UTC using RuboCop version 1.50.2.
# on 2024-04-08 21:01:49 UTC using RuboCop version 1.60.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -15,6 +15,7 @@ Lint/DuplicateBranch:
- 'spec/spec_helper_corosync.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
Expand Down Expand Up @@ -51,10 +52,24 @@ RSpec/RepeatedExampleGroupBody:
- 'spec/acceptance/corosync_class_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
# AllowedMethods: ==, equal?, eql?
Style/ClassEqualityComparison:
Exclude:
- 'lib/puppet/provider/cs_primitive/crm.rb'
- 'lib/puppet/provider/cs_primitive/pcs.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'lib/puppet/provider/cs_group/crm.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantLineContinuation:
Exclude:
- 'spec/unit/puppet/type/cs_clone_spec.rb'
2 changes: 1 addition & 1 deletion lib/puppet/provider/cs_clone/pcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def change_clone_id(type, primitive, id, cib)
return unless doc.root.attributes['id'] != id

doc.root.attributes['id'] = id
cmd = [command(:cibadmin), '--replace', '--xpath', xpath, '--xml-text', doc.to_s.chop]
cmd = [command(:cibadmin), '--replace', '--xpath', xpath, '--xml-text', doc.to_s.chomp]
self.class.run_command_in_cib(cmd, cib)
end

Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/provider/cs_group/crm.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
Expand Down
10 changes: 5 additions & 5 deletions spec/acceptance/cs_commit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class { 'corosync':
end

it 'creates the vip resource in the cib' do
command = if fact('default_provider') == 'pcs'
command = if fact('default_provider') == 'pcs' && fact('os.name') != 'Ubuntu'
TheMeier marked this conversation as resolved.
Show resolved Hide resolved
if Gem::Version.new(fact('pcs_version')) < Gem::Version.new('0.10.0')
'pcs resource show'
else
Expand Down Expand Up @@ -139,7 +139,7 @@ class { 'corosync':
end

it 'creates the vip resource in the shadow cib' do
command = if fact('default_provider') == 'pcs'
command = if fact('default_provider') == 'pcs' && fact('os.name') != 'Ubuntu'
if Gem::Version.new(fact('pcs_version')) < Gem::Version.new('0.10.0')
"pcs resource show -f #{pcs_shadow_cib}"
else
Expand All @@ -154,7 +154,7 @@ class { 'corosync':
end

it 'creates the service resource in the shadow cib' do
command = if fact('default_provider') == 'pcs'
command = if fact('default_provider') == 'pcs' && fact('os.name') != 'Ubuntu'
if Gem::Version.new(fact('pcs_version')) < Gem::Version.new('0.10.0')
"pcs resource show -f #{pcs_shadow_cib}"
else
Expand All @@ -169,7 +169,7 @@ class { 'corosync':
end

it 'creates the colocation in the shadow cib and apache2_vip is the "with" resource' do
command = if fact('default_provider') == 'pcs'
command = if fact('default_provider') == 'pcs' && fact('os.name') != 'Ubuntu'
"pcs cluster cib -f #{pcs_shadow_cib} | grep apache2_vip_with_service"
else
'CIB_shadow=puppet cibadmin --query | grep apache2_vip_with_service'
Expand All @@ -180,7 +180,7 @@ class { 'corosync':
end

it 'creates the colocation in the shadow cib and apache2_service is the main resource' do
command = if fact('default_provider') == 'pcs'
command = if fact('default_provider') == 'pcs' && fact('os.name') != 'Ubuntu'
"pcs cluster cib -f #{pcs_shadow_cib} | grep apache2_vip_with_service"
else
'CIB_shadow=puppet cibadmin --query | grep apache2_vip_with_service'
Expand Down
4 changes: 3 additions & 1 deletion spec/acceptance/cs_location_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
# rubocop:disable Style/FrozenStringLiteralComment

require 'spec_helper_acceptance'

Expand Down Expand Up @@ -60,7 +60,7 @@
it { is_expected.to be_running }
end

it 'creates a location' do

Check failure on line 63 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172150944.3a4HIr.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.66 seconds

Check failure on line 63 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172133330.diaChE.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.61 seconds
pp = <<-EOS
cs_location { 'duncan_vip_there':
primitive => 'duncan_vip',
Expand Down Expand Up @@ -88,7 +88,7 @@
end
end

it 'creates a location with resource-discovery parameter' do

Check failure on line 91 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync creates a location with resource-discovery parameter Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172158572.HX55hL.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.67 seconds

Check failure on line 91 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync creates a location with resource-discovery parameter Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172140609.f0bK0E.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.61 seconds
pp = <<-EOS
cs_location { 'duncan_vip_there':
primitive => 'duncan_vip',
Expand All @@ -105,14 +105,14 @@
end

# this requires pacemaker >= 1.1.13. All tested distributions have higher versions than 1.1.13
it 'creates a location with resource-discovery=exclusive' do

Check failure on line 108 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync creates a location with resource-discovery=exclusive Failure/Error: shell('cibadmin --query | grep duncan_vip_there') do |r| expect(r.stdout).to match(%r{resource-discovery="exclusive"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 1 running: cibadmin --query | grep duncan_vip_there Last 10 lines of output were:

Check failure on line 108 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync creates a location with resource-discovery=exclusive Failure/Error: shell('cibadmin --query | grep duncan_vip_there') do |r| expect(r.stdout).to match(%r{resource-discovery="exclusive"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 1 running: cibadmin --query | grep duncan_vip_there Last 10 lines of output were:
shell('cibadmin --query | grep duncan_vip_there') do |r|
expect(r.stdout).to match(%r{resource-discovery="exclusive"})
end
end

context 'with one rule' do
it 'creates a location' do

Check failure on line 115 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with one rule creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172201227.tKyit9.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.66 seconds

Check failure on line 115 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with one rule creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172143109.37FE6P.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.61 seconds
pp = <<-EOS
cs_location { 'duncan_vip_not_in_container':
primitive => 'duncan_vip',
Expand All @@ -135,25 +135,25 @@
end

# attribute order in XML might be non-deterministic
it 'contains the score attribute' do

Check failure on line 138 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with one rule contains the score attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<rule .*score="-INFINITY"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address

Check failure on line 138 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with one rule contains the score attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<rule .*score="-INFINITY"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
expect(r.stdout).to match(%r{<rule .*score="-INFINITY"})
end
end

it 'contains the attribute attribute' do

Check failure on line 144 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with one rule contains the attribute attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*attribute="#kind"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address

Check failure on line 144 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with one rule contains the attribute attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*attribute="#kind"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
expect(r.stdout).to match(%r{<expression .*attribute="#kind"})
end
end

it 'contains the operation atribute' do

Check failure on line 150 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with one rule contains the operation atribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*operation="eq"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address

Check failure on line 150 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with one rule contains the operation atribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*operation="eq"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
expect(r.stdout).to match(%r{<expression .*operation="eq"})
end
end

it 'contains the value attribute' do

Check failure on line 156 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with one rule contains the value attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*value="container"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address

Check failure on line 156 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with one rule contains the value attribute Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*value="container"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
expect(r.stdout).to match(%r{<expression .*value="container"})
end
Expand All @@ -161,7 +161,7 @@
end

context 'with two rules' do
it 'creates a location' do

Check failure on line 164 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with two rules creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172203983.qlJ34u.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.66 seconds

Check failure on line 164 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with two rules creates a location Failure/Error: apply_manifest(pp, catch_failures: true, debug: false, trace: true) Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --trace --detailed-exitcodes /tmp/apply_manifest_172145704.pywMvY.pp Last 10 lines of output were: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:212:in `main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:182:in `run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:756:in `exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute' /opt/puppetlabs/puppet/bin/puppet:5:in `<main>' �[mNotice: Applied catalog in 0.61 seconds
pp = <<-EOS
cs_location { 'duncan_vip_not_in_container':
primitive => 'duncan_vip',
Expand Down Expand Up @@ -194,7 +194,7 @@
end

# attribute order in XML might be non-deterministic
it 'contains the value attribute for duncan_vip_not_in_container-rule' do

Check failure on line 197 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

corosync with two rules contains the value attribute for duncan_vip_not_in_container-rule Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*value="container"}) end Beaker::Host::CommandFailure: Host 'ubuntu2004-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address

Check failure on line 197 in spec/acceptance/cs_location_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

corosync with two rules contains the value attribute for duncan_vip_not_in_container-rule Failure/Error: shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r| expect(r.stdout).to match(%r{<expression .*value="container"}) end Beaker::Host::CommandFailure: Host 'ubuntu2204-64-puppet7.example.com' exited with 105 running: cibadmin --query --xpath "//rule[@id='duncan_vip_not_in_container-rule']" Last 10 lines of output were: Call cib_query failed (-6): No such device or address
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
expect(r.stdout).to match(%r{<expression .*value="container"})
end
Expand Down Expand Up @@ -243,3 +243,5 @@
end
end
end

# rubocop:enable Style/FrozenStringLiteralComment
4 changes: 3 additions & 1 deletion spec/acceptance/cs_order_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
# rubocop:disable Style/FrozenStringLiteralComment

require 'spec_helper_acceptance'

Expand Down Expand Up @@ -173,3 +173,5 @@ class { 'corosync':
end
end
end

# rubocop:enable Style/FrozenStringLiteralComment
4 changes: 2 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
# On Debian-based, service state transitions (restart, stop) hang indefinitely and
# lead to test timeouts if there is a service unit of Type=notify involved.
# Use Type=simple as a workaround. See issue 455.
if host[:hypervisor] =~ %r{docker} && fact_on(host, 'os.family') == 'Debian'
if host[:hypervisor] =~ %r{(vagrant|docker|container_other)} && fact_on(host, 'os.family') == 'Debian'
on host, 'mkdir /etc/systemd/system/corosync.service.d'
on host, 'echo -e "[Service]\nType=simple" > /etc/systemd/system/corosync.service.d/10-type-simple.conf'
end
# Issue 455: On Centos-based there are recurring problems with the pacemaker systemd service
# refusing to stop its crmd subprocess leading to test timeouts. Force a fast SigKill here.
if host[:hypervisor] =~ %r{docker} && fact_on(host, 'os.family') == 'RedHat' && fact_on(host, 'os.release.major') == '7'
if host[:hypervisor] =~ %r{(vagrant|docker|container_other)} && fact_on(host, 'os.family') == 'RedHat' && fact_on(host, 'os.release.major') == '7'
on host, 'mkdir /etc/systemd/system/pacemaker.service.d'
on host, 'echo -e "[Service]\nSendSIGKILL=yes\nTimeoutStopSec=60s" > /etc/systemd/system/pacemaker.service.d/10-timeout.conf'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/cs_clone_pcs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def clone_xml(name)
Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--query', '--xpath', xpath], failonfail: true, combine: true).at_least_once.returns(
Puppet::Util::Execution::ProcessOutput.new(clone_xml('apache_service-clone'), 0)
)
Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--replace', '--xpath', xpath, '--xml-text', clone_xml('apache_service-newclone').chop], failonfail: true, combine: true).at_least_once.returns(
Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--replace', '--xpath', xpath, '--xml-text', clone_xml('apache_service-newclone').chomp], failonfail: true, combine: true).at_least_once.returns(
Puppet::Util::Execution::ProcessOutput.new('', 0)
)
instance.change_clone_id('primitive', 'apache_service', 'apache_service-newclone', nil)
Expand Down
Loading