Fix unit test for neutron::client class

Change-Id: I23313bcdca32489f8e3f9fa12afcc41171e087bc
This commit is contained in:
ZhongShengping
2017-08-03 10:20:58 +08:00
parent 342cc06f52
commit 93774ca24f

View File

@@ -2,30 +2,34 @@ require 'spec_helper'
describe 'neutron::client' do describe 'neutron::client' do
let :test_facts do shared_examples_for 'neutron client' do
{ :operatingsystem => 'default',
:operatingsystemrelease => 'default'
}
end
context 'on Debian platforms' do it { is_expected.to contain_class('neutron::deps') }
let :facts do it { is_expected.to contain_class('neutron::params') }
@default_facts.merge(test_facts.merge({
:osfamily => 'Debian' it 'installs neutron client package' do
})) is_expected.to contain_package('python-neutronclient').with(
:ensure => 'present',
:name => platform_params[:client_package],
:tag => ['neutron-support-package', 'openstack']
)
end end
it { is_expected.to contain_class('neutron::client') }
end end
context 'on RedHat platforms' do on_supported_os({
let :facts do :supported_os => OSDefaults.get_supported_os
@default_facts.merge(test_facts.merge({ }).each do |os,facts|
:osfamily => 'RedHat', context "on #{os}" do
:operatingsystemrelease => '7' let (:facts) do
})) facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :client_package => 'python-neutronclient' }
end
it_behaves_like 'neutron client'
end end
it { is_expected.to contain_class('neutron::client') }
end end
end end