Expect python3 client package in CentOS8
In CentOS, we expect to have python3 client 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. Note that this patch also removes broken unit tests which overrides os release information to test el6 and el7. Change-Id: I3692a2015ccaa79acd69679e0c749d9d6fa78bcb
This commit is contained in:
parent
16d279e21e
commit
5bd1ee6bc7
|
@ -47,30 +47,6 @@ describe 'glance::backend::rbd' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'glance::backend::rbd on RedHat' do
|
|
||||||
context 'when el6' do
|
|
||||||
before do
|
|
||||||
facts.merge!( :operatingsystemrelease => '6.5' )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_package('python-ceph').with(
|
|
||||||
:name => 'python-ceph',
|
|
||||||
:ensure => 'present'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when el7' do
|
|
||||||
before do
|
|
||||||
facts.merge!( :operatingsystemrelease => '7.0' )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_package('python-ceph').with(
|
|
||||||
:name => 'python-rbd',
|
|
||||||
:ensure => 'present'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
:supported_os => OSDefaults.get_supported_os
|
:supported_os => OSDefaults.get_supported_os
|
||||||
}).each do |os,facts|
|
}).each do |os,facts|
|
||||||
|
@ -88,15 +64,19 @@ describe 'glance::backend::rbd' do
|
||||||
{ :pyceph_package_name => 'python3-rbd' }
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
end
|
end
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{ :pyceph_package_name => 'python-rbd' }
|
if facts[:operatingsystem] == 'Fedora'
|
||||||
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
|
else
|
||||||
|
if facts[:operatingsystemmajrelease] > '7'
|
||||||
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
|
else
|
||||||
|
{ :pyceph_package_name => 'python-rbd' }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'glance::backend::rbd'
|
it_behaves_like 'glance::backend::rbd'
|
||||||
|
|
||||||
if facts[:osfamily] == 'RedHat'
|
|
||||||
it_behaves_like 'glance::backend::rbd on RedHat'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,7 +29,11 @@ describe 'glance::client' do
|
||||||
if facts[:operatingsystem] == 'Fedora'
|
if facts[:operatingsystem] == 'Fedora'
|
||||||
{ :client_package_name => 'python3-glanceclient' }
|
{ :client_package_name => 'python3-glanceclient' }
|
||||||
else
|
else
|
||||||
{ :client_package_name => 'python-glanceclient' }
|
if facts[:operatingsystemmajrelease] > '7'
|
||||||
|
{ :client_package_name => 'python3-glanceclient' }
|
||||||
|
else
|
||||||
|
{ :client_package_name => 'python-glanceclient' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,30 +69,6 @@ describe 'glance::backend::multistore::rbd' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'glance::backend::multistore::rbd on RedHat' do
|
|
||||||
context 'when el6' do
|
|
||||||
before do
|
|
||||||
facts.merge!( :operatingsystemrelease => '6.5' )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_package('python-ceph').with(
|
|
||||||
:name => 'python-ceph',
|
|
||||||
:ensure => 'present'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when el7' do
|
|
||||||
before do
|
|
||||||
facts.merge!( :operatingsystemrelease => '7.0' )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_package('python-ceph').with(
|
|
||||||
:name => 'python-rbd',
|
|
||||||
:ensure => 'present'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
:supported_os => OSDefaults.get_supported_os
|
:supported_os => OSDefaults.get_supported_os
|
||||||
}).each do |os,facts|
|
}).each do |os,facts|
|
||||||
|
@ -110,15 +86,19 @@ describe 'glance::backend::multistore::rbd' do
|
||||||
{ :pyceph_package_name => 'python3-rbd' }
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
end
|
end
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{ :pyceph_package_name => 'python-rbd' }
|
if facts[:operatingsystem] == 'Fedora'
|
||||||
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
|
else
|
||||||
|
if facts[:operatingsystemmajrelease] > '7'
|
||||||
|
{ :pyceph_package_name => 'python3-rbd' }
|
||||||
|
else
|
||||||
|
{ :pyceph_package_name => 'python-rbd' }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'glance::backend::multistore::rbd'
|
it_behaves_like 'glance::backend::multistore::rbd'
|
||||||
|
|
||||||
if facts[:osfamily] == 'RedHat'
|
|
||||||
it_behaves_like 'glance::backend::multistore::rbd on RedHat'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue