diff --git a/manifests/params.pp b/manifests/params.pp index 5c021a2..b9d867c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,15 +4,17 @@ # class zaqar::params { include ::openstacklib::defaults - $client_package = 'python-zaqarclient' + + $client_package = 'python-zaqarclient' + case $::osfamily { 'RedHat': { $package_name = 'openstack-zaqar' $service_name = 'openstack-zaqar' } 'Debian': { - $package_name = 'zaqar' - $service_name = 'zaqar' + $package_name = 'zaqar-server' + $service_name = 'zaqar-server' } default: { fail("Unsupported osfamily: ${::osfamily} operatingsystem: \ diff --git a/spec/acceptance/zaqar_mongo_spec.rb b/spec/acceptance/zaqar_mongo_spec.rb index a5abd53..438da8d 100644 --- a/spec/acceptance/zaqar_mongo_spec.rb +++ b/spec/acceptance/zaqar_mongo_spec.rb @@ -24,32 +24,37 @@ describe 'basic zaqar' do class { '::mongodb::server': replset => 'zaqar', replset_members => ['127.0.0.1:27017'], + dbpath_fix => false, } $zaqar_mongodb_conn_string = 'mongodb://127.0.0.1:27017' - case $::osfamily { - 'Debian': { - warning('Zaqar is not yet packaged on Ubuntu systems.') + Mongodb_replset['zaqar'] -> Package['zaqar-common'] + + # TODO(zhongshengping): temporarily added this package + if $::osfamily == 'Debian' { + package { 'python-pymongo': + ensure => present, } - 'RedHat': { - Mongodb_replset['zaqar'] -> Package['zaqar-common'] - class {'::zaqar::management::mongodb': - uri => $zaqar_mongodb_conn_string - } - class {'::zaqar::messaging::mongodb': - uri => $zaqar_mongodb_conn_string - } - class {'::zaqar::keystone::authtoken': - password => 'a_big_secret', - } - class {'::zaqar': - unreliable => true, - } - include ::zaqar::server - # run a second instance using websockets - zaqar::server_instance{ '1': - transport => 'websocket' - } + } + + class {'::zaqar::management::mongodb': + uri => $zaqar_mongodb_conn_string + } + class {'::zaqar::messaging::mongodb': + uri => $zaqar_mongodb_conn_string + } + class {'::zaqar::keystone::authtoken': + password => 'a_big_secret', + } + class {'::zaqar': + unreliable => true, + } + include ::zaqar::server + # run a second instance using websockets, the Debian system does + # not support the use of services to run a second instance. + if $::osfamily == 'RedHat' { + zaqar::server_instance{ '1': + transport => 'websocket' } } EOS @@ -60,10 +65,8 @@ describe 'basic zaqar' do apply_manifest(pp, :catch_changes => true) end - if os[:family].casecmp('RedHat') == 0 - describe port(8888) do - it { is_expected.to be_listening.with('tcp') } - end + describe port(8888) do + it { is_expected.to be_listening.with('tcp') } end end diff --git a/spec/classes/zaqar_init_spec.rb b/spec/classes/zaqar_init_spec.rb index b5f8edc..746e35f 100644 --- a/spec/classes/zaqar_init_spec.rb +++ b/spec/classes/zaqar_init_spec.rb @@ -75,7 +75,7 @@ describe 'zaqar' do let(:platform_params) do case facts[:osfamily] when 'Debian' - { :zaqar_common_package => 'zaqar' } + { :zaqar_common_package => 'zaqar-server' } when 'RedHat' { :zaqar_common_package => 'openstack-zaqar' } end diff --git a/spec/classes/zaqar_server_spec.rb b/spec/classes/zaqar_server_spec.rb index 24d1042..aeda330 100644 --- a/spec/classes/zaqar_server_spec.rb +++ b/spec/classes/zaqar_server_spec.rb @@ -29,7 +29,7 @@ describe 'zaqar::server' do let(:platform_params) do case facts[:osfamily] when 'Debian' - { :zaqar_service_name => 'zaqar' } + { :zaqar_service_name => 'zaqar-server' } when 'RedHat' { :zaqar_service_name => 'openstack-zaqar' } end diff --git a/spec/defines/zaqar_server_instance_spec.rb b/spec/defines/zaqar_server_instance_spec.rb index f98fc45..8d77812 100644 --- a/spec/defines/zaqar_server_instance_spec.rb +++ b/spec/defines/zaqar_server_instance_spec.rb @@ -39,7 +39,7 @@ describe 'zaqar::server_instance' do let(:platform_params) do case facts[:osfamily] when 'Debian' - { :zaqar_service_name => 'zaqar' } + { :zaqar_service_name => 'zaqar-server' } when 'RedHat' { :zaqar_service_name => 'openstack-zaqar' } end