puppet-openstacklib/spec/classes/openstacklib_openstackclient_spec.rb
Tobias Urdin 709b28006b openstacklib::openstackclient Debian python3
This change adds support for installing the
python3-openstackclient package on Debian.

On Ubuntu and RedHat based the package name
is still python-openstackclient.

Change-Id: I8a0c5dfa9274dca167ad3bb33ab151fb693f5d4d
2018-04-24 15:54:35 +02:00

40 lines
1010 B
Ruby

require 'spec_helper'
describe 'openstacklib::openstackclient' do
shared_examples_for 'openstacklib::openstackclient' do
context 'with default params' do
it 'installs openstackclient' do
is_expected.to contain_package(platform_params[:openstackclient_package_name]).with(
:ensure => 'present',
:tag => 'openstack'
)
end
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
if facts[:os_package_type] == 'debian' then
openstackclient_package_name = 'python3-openstackclient'
else
openstackclient_package_name = 'python-openstackclient'
end
{
:openstackclient_package_name => openstackclient_package_name
}
end
it_behaves_like 'openstacklib::openstackclient'
end
end
end