2017-08-03 09:33:52 +08:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'watcher::client' do
|
|
|
|
|
|
|
|
shared_examples_for 'watcher client' do
|
|
|
|
|
|
|
|
it { is_expected.to contain_class('watcher::deps') }
|
|
|
|
it { is_expected.to contain_class('watcher::params') }
|
|
|
|
|
|
|
|
it 'installs watcher client package' do
|
|
|
|
is_expected.to contain_package('python-watcherclient').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
|
|
|
|
|
2018-04-12 11:48:31 +08:00
|
|
|
let(:platform_params) do
|
2023-03-02 12:46:00 +09:00
|
|
|
case facts[:os]['family']
|
2018-04-12 11:48:31 +08:00
|
|
|
when 'Debian'
|
2019-01-17 22:09:32 +01:00
|
|
|
{ :client_package_name => 'python3-watcherclient' }
|
2018-04-12 11:48:31 +08:00
|
|
|
when 'RedHat'
|
2021-06-14 09:42:17 +02:00
|
|
|
{ :client_package_name => 'python3-watcherclient' }
|
2018-04-12 11:48:31 +08:00
|
|
|
end
|
2017-08-03 09:33:52 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'watcher client'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|