1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
require 'spec_helper'
describe 'keystone::client' do
shared_examples 'keystone::client' do
it { is_expected.to contain_class('keystone::deps') }
context 'with default parameters' do
it { should contain_package('python-keystoneclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)}
it { should contain_class('openstacklib::openstackclient') }
end
context 'with specified parameters' do
let :params do
{
:client_package_name => 'package_name',
:ensure => '1.2.3',
}
end
it { should contain_package('python-keystoneclient').with(
:ensure => '1.2.3',
:name => 'package_name',
:tag => 'openstack',
)}
it { should contain_class('openstacklib::openstackclient') }
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
let (:platform_params) do
case facts[:os]['family']
when 'Debian'
{ :client_package_name => 'python3-keystoneclient' }
when 'RedHat'
{ :client_package_name => 'python3-keystoneclient' }
end
end
it_behaves_like 'keystone::client'
end
end
end
|