Files
puppet-cloudkitty/spec/classes/cloudkitty_client_spec.rb
Thomas Goirand e7e366c118 Debian is using Python 3
Change-Id: I98d1a456cad73c83f13a08b42fcf363fea87c66d
2018-04-10 12:12:10 +02:00

45 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'cloudkitty::client' do
shared_examples_for 'cloudkitty client' do
it { is_expected.to contain_class('cloudkitty::deps') }
it { is_expected.to contain_class('cloudkitty::params') }
it 'installs cloudkitty client package' do
is_expected.to contain_package('python-cloudkittyclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
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[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian'
{ :client_package_name => 'python3-cloudkittyclient' }
else
{ :client_package_name => 'python-cloudkittyclient' }
end
when 'RedHat'
{ :client_package_name => 'python-cloudkittyclient' }
end
end
it_configures 'cloudkitty client'
end
end
end