2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
20 describe 'openstacklib::service_validation' do
22 let (:title) { 'nova-api' }
24 let :required_params do
25 { :command => 'nova list' }
28 shared_examples 'openstacklib::service_validation examples' do
30 context 'with only required parameters' do
35 it { is_expected.to contain_exec("execute #{title} validation").with(
36 :path => '/usr/bin:/bin:/usr/sbin:/sbin',
38 :command => 'nova list',
43 it { is_expected.to contain_anchor("create #{title} anchor").with(
44 :require => "Exec[execute #{title} validation]",
49 context 'when omitting a required parameter command' do
51 required_params.delete(:command)
53 it { expect { is_expected.to raise_error(Puppet::Error) } }
58 context 'on a Debian osfamily' do
60 { :osfamily => "Debian" }
63 include_examples 'openstacklib::service_validation examples'
66 context 'on a RedHat osfamily' do
68 { :osfamily => 'RedHat' }
71 include_examples 'openstacklib::service_validation examples'