puppet-manila/spec/classes/manila_client_spec.rb
Thomas Goirand ca0953a22e Debian is using Python 3
Change-Id: I4a32824613ff50a5d620f78d2a637669d537bfab
2018-04-10 20:58:42 +02:00

45 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'manila::client' do
shared_examples_for 'manila client' do
it { is_expected.to contain_class('manila::deps') }
it { is_expected.to contain_class('manila::params') }
it 'installs manila client package' do
is_expected.to contain_package('python-manilaclient').with(
:ensure => 'present',
:name => platform_params[:client_package],
:tag => ['openstack', 'manila-support-package']
)
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 => 'python3-manilaclient' }
else
{ :client_package => 'python-manilaclient' }
end
when 'RedHat'
{ :client_package => 'python-manilaclient' }
end
end
it_behaves_like 'manila client'
end
end
end