
In CentOS, we expect to have python3 client package in 8.x while we expect to have python2 in 7.x . Fix unit tests to expect the correct version according to os major version. Change-Id: Ic89bf2514d82676ee8fde95284a3414bd51d5af1
49 lines
1.3 KiB
Ruby
49 lines
1.3 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'
|
|
{ :client_package_name => 'python3-cloudkittyclient' }
|
|
when 'RedHat'
|
|
if facts[:operatingsystem] == 'Fedora'
|
|
{ :client_package_name => 'python3-cloudkittyclient' }
|
|
else
|
|
if facts[:operatingsystemmajrelease] > '7'
|
|
{ :client_package_name => 'python3-cloudkittyclient' }
|
|
else
|
|
{ :client_package_name => 'python-cloudkittyclient' }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
it_configures 'cloudkitty client'
|
|
end
|
|
end
|
|
|
|
end
|