diff --git a/spec/classes/glare_backend_rbd_spec.rb b/spec/classes/glare_backend_rbd_spec.rb index 5c792ac..cccb997 100644 --- a/spec/classes/glare_backend_rbd_spec.rb +++ b/spec/classes/glare_backend_rbd_spec.rb @@ -47,30 +47,6 @@ describe 'glare::backend::rbd' do end end - shared_examples 'glare::backend::rbd on RedHat' do - context 'with el6' do - before do - facts.merge!( :operatingsystemrelease => '6.5' ) - end - - it { should contain_package('python-ceph').with( - :name => 'python-ceph', - :ensure => 'present' - )} - end - - context 'with 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({ :supported_os => OSDefaults.get_supported_os }).each do |os,facts| @@ -87,21 +63,21 @@ describe 'glare::backend::rbd' do else pyceph_pkg = 'python-ceph' end - { - :pyceph_package_name => pyceph_pkg, - } + { :pyceph_package_name => pyceph_pkg, } 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 it_behaves_like 'glare::backend::rbd' - - if facts[:osfamily] == 'RedHat' - it_behaves_like 'glare::backend::rbd on RedHat' - end end end end diff --git a/spec/classes/glare_client_spec.rb b/spec/classes/glare_client_spec.rb index 6c40ae9..7bd1f04 100644 --- a/spec/classes/glare_client_spec.rb +++ b/spec/classes/glare_client_spec.rb @@ -29,7 +29,15 @@ describe 'glare::client' do when 'Debian' { :client_package_name => 'python3-glareclient' } when 'RedHat' - { :client_package_name => 'python-glareclient' } + if facts[:operatingsystem] == 'Fedora' + { :client_package_name => 'python3-glareclient' } + else + if facts[:operatingsystemmajrelease] > '7' + { :client_package_name => 'python3-glareclient' } + else + { :client_package_name => 'python-glareclient' } + end + end end end