Debian Codegraph @

spec/classes/ceph_mons_spec.rb

raw
1 #
2 # Copyright (C) 2013 Cloudwatt <[email protected]>
3 # Copyright (C) 2014 Nine Internet Solutions AG
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # Author: Loic Dachary <[email protected]>
18 # Author: David Gurtner <[email protected]>
19 #
20 require 'spec_helper'
21
22 describe 'ceph::mons' do
23
24 shared_examples 'ceph mons' do
25 let :params do
26 {
27 :args => {
28 'A' => {
29 'public_addr' => '1.2.3.4',
30 'authentication_type' => 'none',
31 },
32 'B' => {
33 'public_addr' => '1.2.3.4',
34 'authentication_type' => 'none',
35 },
36 },
37 :defaults => {
38 'cluster' => 'CLUSTER',
39 },
40 }
41 end
42
43 it {
44 should contain_service('ceph-mon-A').with('ensure' => "running")
45 should contain_service('ceph-mon-B').with('ensure' => "running")
46 }
47 end
48
49 on_supported_os({
50 :supported_os => OSDefaults.get_supported_os
51 }).each do |os,facts|
52 context "on #{os}" do
53 let (:facts) do
54 facts.merge!(OSDefaults.get_facts())
55 end
56
57 it_behaves_like 'ceph mons'
58 end
59 end
60
61 end