Debian Codegraph @

spec/classes/ceph_profile_params_spec.rb

raw
1 #
2 # Copyright (C) 2015 iWeb Technologies Inc.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # Author: David Moreau Simard <[email protected]>
17 #
18 require 'spec_helper'
19
20 describe 'ceph::profile::params' do
21
22 shared_examples 'ceph profile params' do
23 describe "should fail when client_keys is not a hash" do
24
25 let :pre_condition do
26 "class { 'ceph::profile::params':
27 client_keys => 'client.admin'
28 }"
29 end
30
31 it { should raise_error(Puppet::Error) }
32 end
33
34 describe "should fail when using cephx without client_keys" do
35
36 let :pre_condition do
37 "class { 'ceph::profile::params':
38 authentication_type => 'cephx',
39 client_keys => {}
40 }"
41 end
42
43 it { should raise_error Puppet::Error,
44 /client_keys must be provided when using authentication_type = 'cephx'/
45 }
46 end
47 end
48
49 on_supported_os.each do |os, facts|
50 context "on #{os}" do
51 let(:facts) do
52 facts.merge({})
53 end
54
55 it_behaves_like 'ceph profile params'
56 end
57 end
58 end