diff --git a/spec/acceptance/cs_commit_spec.rb b/spec/acceptance/cs_commit_spec.rb index dff1f2b9..550735df 100644 --- a/spec/acceptance/cs_commit_spec.rb +++ b/spec/acceptance/cs_commit_spec.rb @@ -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 @@ -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 @@ -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 @@ -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' @@ -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' diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 00177b0d..1eae24b2 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -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