| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::client' do |
| 4 |
|
| 5 |
shared_examples_for 'nova client' do |
| 6 |
|
| 7 |
it { is_expected.to contain_class('nova::deps') } |
| 8 |
it { is_expected.to contain_class('nova::params') } |
| 9 |
|
| 10 |
it 'installs nova client package' do |
| 11 |
is_expected.to contain_package('python-novaclient').with( |
| 12 |
:ensure => 'present', |
| 13 |
:name => platform_params[:client_package_name], |
| 14 |
:tag => 'openstack', |
| 15 |
) |
| 16 |
end |
| 17 |
end |
| 18 |
|
| 19 |
on_supported_os({ |
| 20 |
:supported_os => OSDefaults.get_supported_os |
| 21 |
}).each do |os,facts| |
| 22 |
context "on #{os}" do |
| 23 |
let (:facts) do |
| 24 |
facts.merge!(OSDefaults.get_facts()) |
| 25 |
end |
| 26 |
|
| 27 |
let(:platform_params) do |
| 28 |
case facts[:os]['family'] |
| 29 |
when 'Debian' |
| 30 |
{ :client_package_name => 'python3-novaclient' } |
| 31 |
when 'RedHat' |
| 32 |
{ :client_package_name => 'python3-novaclient' } |
| 33 |
end |
| 34 |
end |
| 35 |
|
| 36 |
it_behaves_like 'nova client' |
| 37 |
end |
| 38 |
end |
| 39 |
|
| 40 |
end |