83 lines
2.0 KiB
Ruby
83 lines
2.0 KiB
Ruby
![]() |
#
|
||
|
# Copyright (C) 2014 eNovance SAS <licensing@etrovence.com>
|
||
|
#
|
||
|
# Author: Emilien Macchi <emilien.macchi@etrovence.com>
|
||
|
#
|
||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||
|
# not use this file except in compliance with the License. You may obtain
|
||
|
# a copy of the License at
|
||
|
#
|
||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
#
|
||
|
# Unless required by applicable law or agreed to in writing, software
|
||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||
|
# License for the specific language governing permissions and limitations
|
||
|
# under the License.
|
||
|
#
|
||
|
# Unit tests for trove::api
|
||
|
#
|
||
|
require 'spec_helper'
|
||
|
|
||
|
describe 'trove::api' do
|
||
|
|
||
|
let :pre_condition do
|
||
|
"class {'trove':}"
|
||
|
end
|
||
|
|
||
|
let :params do
|
||
|
{ :keystone_password => 'passw0rd' }
|
||
|
end
|
||
|
|
||
|
let :facts do
|
||
|
{ :processorcount => 5 }
|
||
|
end
|
||
|
|
||
|
shared_examples 'trove-api' do
|
||
|
|
||
|
context 'with default parameters' do
|
||
|
|
||
|
it 'installs trove-api package and service' do
|
||
|
should contain_service('trove-api').with(
|
||
|
:name => platform_params[:api_service_name],
|
||
|
:ensure => 'running',
|
||
|
:hasstatus => true,
|
||
|
:enable => true
|
||
|
)
|
||
|
should contain_package('trove-api').with(
|
||
|
:name => platform_params[:api_package_name],
|
||
|
:ensure => 'present',
|
||
|
:notify => 'Service[trove-api]'
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
context 'on Debian platforms' do
|
||
|
let :facts do
|
||
|
{ :osfamily => 'Debian' }
|
||
|
end
|
||
|
|
||
|
let :platform_params do
|
||
|
{ :api_package_name => 'trove-api',
|
||
|
:api_service_name => 'trove-api' }
|
||
|
end
|
||
|
|
||
|
it_configures 'trove-api'
|
||
|
end
|
||
|
|
||
|
context 'on RedHat platforms' do
|
||
|
let :facts do
|
||
|
{ :osfamily => 'RedHat' }
|
||
|
end
|
||
|
|
||
|
let :platform_params do
|
||
|
{ :api_package_name => 'openstack-trove-api',
|
||
|
:api_service_name => 'openstack-trove-api' }
|
||
|
end
|
||
|
|
||
|
it_configures 'trove-api'
|
||
|
end
|
||
|
|
||
|
end
|