2c381ff80b
Make nova user configuration before ceilometer/compute task since ceilometer-common package reset shell of nova user to /bin/false back. Change-Id: I92be4cb23ad4ffe2cbd52562b40e336a1ad1e352 Closes-Bug: #1660981
56 lines
1.5 KiB
Ruby
56 lines
1.5 KiB
Ruby
# ROLE: compute
|
|
|
|
require 'spec_helper'
|
|
require 'shared-examples'
|
|
manifest = 'roles/enable_compute.pp'
|
|
|
|
describe manifest do
|
|
shared_examples 'catalog' do
|
|
|
|
it 'should contain nova-compute service' do
|
|
service_name = case facts[:operatingsystem]
|
|
when 'Ubuntu'
|
|
'nova-compute'
|
|
when 'CentOS'
|
|
'openstack-nova-compute'
|
|
else
|
|
'nova-compute'
|
|
end
|
|
|
|
is_expected.to contain_service('nova-compute').with(
|
|
:ensure => 'running',
|
|
:name => service_name,
|
|
:enable => true,
|
|
:hasstatus => true,
|
|
:hasrestart => true,
|
|
)
|
|
end
|
|
|
|
if Noop.hiera('use_ovs') && Noop.hiera('role') == 'compute'
|
|
neutron_integration_bridge = 'br-int'
|
|
bridge_exists_check = "ovs-vsctl br-exists #{neutron_integration_bridge}"
|
|
|
|
it 'should contain wait-for-int-br exec' do
|
|
is_expected.to contain_exec('wait-for-int-br').with(
|
|
:command => bridge_exists_check,
|
|
:unless => bridge_exists_check,
|
|
:try_sleep => 6,
|
|
:tries => 10,
|
|
).that_comes_before('Service[nova-compute]')
|
|
end
|
|
end
|
|
|
|
it 'should contain migration basics' do
|
|
is_expected.to contain_install_ssh_keys('nova_ssh_key_for_migration')
|
|
is_expected.to contain_file('/var/lib/nova/.ssh/config')
|
|
is_expected.to contain_user('nova').with(
|
|
:ensure => 'present',
|
|
:shell => '/bin/rbash',
|
|
)
|
|
end
|
|
|
|
end
|
|
|
|
test_ubuntu_and_centos manifest
|
|
end
|