2013-06-05 13:06:05 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'keystone::client' do
|
2019-01-28 16:08:55 +01:00
|
|
|
shared_examples 'keystone::client' do
|
2019-05-20 11:03:20 +08:00
|
|
|
|
|
|
|
it { is_expected.to contain_class('keystone::deps') }
|
|
|
|
|
2019-01-28 16:08:55 +01:00
|
|
|
context 'with default parameters' do
|
|
|
|
it { should contain_package('python-keystoneclient').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:name => platform_params[:client_package_name],
|
|
|
|
:tag => 'openstack',
|
|
|
|
)}
|
2013-06-05 13:06:05 -04:00
|
|
|
|
2019-01-28 16:08:55 +01:00
|
|
|
it { should contain_class('openstacklib::openstackclient') }
|
|
|
|
end
|
2016-04-21 14:46:13 -04:00
|
|
|
|
2019-01-28 16:08:55 +01:00
|
|
|
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',
|
|
|
|
)}
|
2013-06-05 13:06:05 -04:00
|
|
|
|
2019-01-28 16:08:55 +01:00
|
|
|
it { should contain_class('openstacklib::openstackclient') }
|
2013-06-05 13:06:05 -04:00
|
|
|
end
|
2019-01-28 16:08:55 +01:00
|
|
|
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
|
2013-06-05 13:06:05 -04:00
|
|
|
|
2019-01-28 16:08:55 +01:00
|
|
|
let (:platform_params) do
|
2023-03-02 11:10:02 +09:00
|
|
|
case facts[:os]['family']
|
2019-01-28 16:08:55 +01:00
|
|
|
when 'Debian'
|
|
|
|
{ :client_package_name => 'python3-keystoneclient' }
|
|
|
|
when 'RedHat'
|
2021-05-21 11:43:14 +02:00
|
|
|
{ :client_package_name => 'python3-keystoneclient' }
|
2019-01-28 16:08:55 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'keystone::client'
|
|
|
|
end
|
2013-06-05 13:06:05 -04:00
|
|
|
end
|
|
|
|
end
|