Files
puppet-openstacklib/spec/classes/openstacklib_openstackclient_spec.rb
Takashi Kajinami f0b36283fe Drop Fedora support
Fedora support is never tested, and has been unmaintained for a while.
Because we don't expect any actual user using OpenStack on Fedora, this
change drops support for Fedora directly.

Change-Id: I63c96cd92bad210c0a9527c59f8e1347967172a3
2021-05-26 23:06:00 +09:00

52 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'openstacklib::openstackclient' do
shared_examples_for 'openstacklib::openstackclient' do
context 'with default params' do
it { should contain_package(platform_params[:openstackclient_package_name]).with(
:ensure => 'present',
:tag => 'openstack'
)}
end
context 'with non default package name' do
let :params do
{
:package_name => 'my-openstackclient'
}
end
it { should contain_package('my-openstackclient').with(
:ensure => 'present',
: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'
{ :openstackclient_package_name => 'python3-openstackclient' }
when 'RedHat'
if facts[:operatingsystemmajrelease] > '7'
{ :openstackclient_package_name => 'python3-openstackclient' }
else
{ :openstackclient_package_name => 'python-openstackclient' }
end
end
end
it_behaves_like 'openstacklib::openstackclient'
end
end
end