puppet-zaqar/spec/defines/zaqar_server_instance_spec.rb
Tobias Urdin ce76a91f62 Convert all class usage to relative names
Change-Id: Ieb9a1d2c1dcef360ca7a323fe4f6cdbb61feecfe
2019-12-08 23:26:05 +01:00

52 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'zaqar::server_instance' do
shared_examples_for 'zaqar::server_instance' do
let(:title) { '1' }
let :pre_condition do
"class { 'zaqar::keystone::authtoken':
password =>'foo',
}
class {'::zaqar': }"
end
let :params do
{
:transport => 'websocket'
}
end
describe 'with a websocket server instance 1' do
it { is_expected.to contain_service("#{platform_params[:zaqar_service_name]}@1").with(
:ensure => 'running',
:enable => true
)}
it { is_expected.to contain_file('/etc/zaqar/1.conf') }
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_instance'
end
end
end