Files
puppet-gnocchi/spec/classes/gnocchi_client_spec.rb
ZhongShengping 3854d2f531 Add openstackclient installation to the client class
The repo is inside the openstackclient plugin commands[1].

[1]https://docs.openstack.org/python-openstackclient/latest/cli/plugin-commands.html

Change-Id: I3748cb4266b0d9c59bdcf4574b3755f2d897fc96
2019-05-17 16:31:16 +08:00

38 lines
979 B
Ruby

require 'spec_helper'
describe 'gnocchi::client' do
shared_examples 'gnocchi::client' do
it { is_expected.to contain_class('gnocchi::deps') }
it { is_expected.to contain_class('gnocchi::params') }
it { should contain_package('python-gnocchiclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)}
it { is_expected.to contain_class('openstacklib::openstackclient') }
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[:osfamily]
when 'Debian'
{ :client_package_name => 'python3-gnocchiclient' }
when 'RedHat'
{ :client_package_name => 'python-gnocchiclient' }
end
end
it_behaves_like 'gnocchi::client'
end
end
end