Files
puppet-placement/spec/classes/placement_client_spec.rb
Takashi Kajinami 4eb7e9ba22 Use new openstackclient tag
The new openstackclient tag was added so that we can get all resources
about openstack CLI more easily. This adds this tag to osc-placement
because the plugin provides some sub-commands.

This also removes the support package tag because the plguin is not
at all used by placement itself.

Depends-on: https://review.opendev.org/899594
Change-Id: I77f261c060e8c3fe982deb1f442f47df6bf01310
2023-11-20 00:47:57 +09:00

44 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'placement::client' do
shared_examples_for 'placement client' do
it { is_expected.to contain_class('placement::deps') }
it { is_expected.to contain_class('placement::params') }
it 'installs placement client package' do
is_expected.to contain_package('python-osc-placement').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => ['openstack', 'openstackclient']
)
end
it { is_expected.to contain_class('openstacklib::openstackclient') }
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[:os]['family']
when 'Debian'
{ :client_package_name => 'python3-osc-placement' }
when 'RedHat'
{ :client_package_name => 'python3-osc-placement' }
end
end
it_behaves_like 'placement client'
end
end
end