Skip to content

Commit

Permalink
fix: cs_commit_spec.rb default provider on ubuntu not detected correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeier committed Oct 13, 2024
1 parent 48a1154 commit 13fc08f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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'
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: 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

0 comments on commit 13fc08f

Please sign in to comment.