Expect python3 client/lib package in CentOS8

In CentOS, we expect to have python3 client/lib package in 8.x while
we expect to have python2 in 7.x .
Fix unit tests to expect the correct version according to os major
version.

Change-Id: I2974ea2e134c9e46e0c606c2810ff9259e13a43d
This commit is contained in:
Takashi Kajinami 2020-03-31 16:37:51 +09:00
parent a76f3b21de
commit 7020695920
6 changed files with 62 additions and 11 deletions

View File

@ -30,7 +30,7 @@ describe 'ironic::client' do
it 'installs ironic client package' do
is_expected.to contain_package('python-ironicclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:name => platform_params[:client_package],
:tag => ['openstack', 'ironic-support-package']
)
end
@ -49,9 +49,17 @@ describe 'ironic::client' do
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :client_package_name => 'python3-ironicclient' }
{ :client_package => 'python3-ironicclient' }
when 'RedHat'
{ :client_package_name => 'python-ironicclient' }
if facts[:operatingsystem] == 'Fedora'
{ :client_package => 'python3-ironicclient' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :client_package => 'python3-ironicclient' }
else
{ :client_package => 'python-ironicclient' }
end
end
end
end

View File

@ -46,7 +46,15 @@ describe 'ironic::drivers::drac' do
when 'Debian'
{ :dracclient_package_name => 'python3-dracclient' }
when 'RedHat'
{ :dracclient_package_name => 'python-dracclient' }
if facts[:operatingsystem] == 'Fedora'
{ :dracclient_package_name => 'python3-dracclient' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :dracclient_package_name => 'python3-dracclient' }
else
{ :dracclient_package_name => 'python-dracclient' }
end
end
end
end

View File

@ -71,7 +71,15 @@ describe 'ironic::drivers::ilo' do
when 'Debian'
{ :proliantutils_package_name => 'python3-proliantutils' }
when 'RedHat'
{ :proliantutils_package_name => 'python-proliantutils' }
if facts[:operatingsystem] == 'Fedora'
{ :proliantutils_package_name => 'python3-proliantutils' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :proliantutils_package_name => 'python3-proliantutils' }
else
{ :proliantutils_package_name => 'python-proliantutils' }
end
end
end
end

View File

@ -65,7 +65,15 @@ describe 'ironic::drivers::redfish' do
when 'Debian'
{ :sushy_package_name => 'python3-sushy' }
when 'RedHat'
{ :sushy_package_name => 'python-sushy' }
if facts[:operatingsystem] == 'Fedora'
{ :sushy_package_name => 'python3-sushy' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :sushy_package_name => 'python3-sushy' }
else
{ :sushy_package_name => 'python-sushy' }
end
end
end
end

View File

@ -281,8 +281,19 @@ describe 'ironic' do
{ :common_package_name => 'ironic-common',
:lib_package_name => 'python3-ironic-lib' }
when 'RedHat'
{ :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python-ironic-lib' }
if facts[:operatingsystem] == 'Fedora'
{ :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python3-ironic-lib' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python3-ironic-lib' }
else
{ :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python-ironic-lib' }
end
end
end
end

View File

@ -35,7 +35,7 @@ describe 'ironic::inspector::client' do
it 'installs ironic inspector client package' do
is_expected.to contain_package('python-ironic-inspector-client').with(
:ensure => 'present',
:name => platform_params[:ironic_inspector_client_package_name],
:name => platform_params[:inspector_client_package],
:tag => ['openstack', 'ironic-support-package'],
)
end
@ -54,9 +54,17 @@ describe 'ironic::inspector::client' do
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :ironic_inspector_client_package_name => 'python3-ironic-inspector-client' }
{ :inspector_client_package => 'python3-ironic-inspector-client' }
when 'RedHat'
{ :ironic_inspector_client_package_name => 'python-ironic-inspector-client' }
if facts[:operatingsystem] == 'Fedora'
{ :inspector_client_package => 'python3-ironic-inspector-client' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :inspector_client_package => 'python3-ironic-inspector-client' }
else
{ :inspector_client_package => 'python-ironic-inspector-client' }
end
end
end
end