puppet-nova/spec/classes/nova_compute_libvirt_services_spec.rb
Emilien Macchi 050c1926fb Enable compute node micro-services
nova::compute::libvirt was a class that deployed both libvirt (+
external services related to it) and nova-compute bits (mainly
configuration).

In the micro-services use-case, we want individual services, that can
run alone in containers. To allow it, we need to split the nova compute
configuration when libvirt is configured and the libvirt deployment.

This patch aims to create nova::compute::libvirt::services that contain
the bits from nova::compute::libvirt that used to deploy Libvirt and
some other packages / services related to it.

We keep backward compatibility by declaring the new class in
nova::compute::libvirt but allow to disable it and select what we
actually need thanks to parameters (we support hiera & non-hiera, see
code for comments that document it).

This is a first iteration of micro services for Compute nodes, soon
we'll also work on nova::migration class to separate nova-compute &
libvirt bits again.

Change-Id: Ib0d3111560af5af451e522c6dc3b3918d0463e7d
2016-06-14 19:08:11 -04:00

37 lines
899 B
Ruby

require 'spec_helper'
describe 'nova::compute::libvirt::services' do
shared_examples_for 'nova compute libvirt services' do
context 'with default parameters' do
it 'deploys libvirt packages and services' do
is_expected.to contain_package('libvirt')
is_expected.to contain_service('libvirt')
end
end
context 'with overridden parameters' do
let :params do
{ :libvirt_service_name => false }
end
it 'disable libvirt service' do
is_expected.not_to contain_package('libvirt')
is_expected.not_to contain_service('libvirt')
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_configures 'nova compute libvirt services'
end
end
end