puppet-zaqar/spec/classes/zaqar_server_spec.rb
ZhongShengping 7cf66df9e1 Add support for Debian system
We can add suport for Debian system due to have the
zaqar package in Debian system.
The Debian system does not support the use of services to run
a second instance, because there is no zaqar-server@.service
in zaqar package, so do not test it. I will Re-test it after
the zaqar package solve the problem.

Change-Id: I026b7d8f2b5994114d5a319200ed7c7d099b4fb5
2016-11-29 12:53:23 +08:00

42 lines
953 B
Ruby

require 'spec_helper'
describe 'zaqar::server' do
shared_examples_for 'zaqar::server' do
describe 'with a zaqar server enabled' do
let :pre_condition do
"class { '::zaqar::keystone::authtoken':
password =>'foo',
}
class {'::zaqar': }"
end
it { is_expected.to contain_service(platform_params[:zaqar_service_name]).with(
:ensure => 'running',
:enable => true
)}
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
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :zaqar_service_name => 'zaqar-server' }
when 'RedHat'
{ :zaqar_service_name => 'openstack-zaqar' }
end
end
it_configures 'zaqar::server'
end
end
end