Debian Codegraph @

spec/classes/ceph_osds_spec.rb

raw
1 #
2 # Copyright (C) 2014 Nine Internet Solutions AG
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 Gurtner <[email protected]>
17 #
18 require 'spec_helper'
19
20 describe 'ceph::osds' do
21
22 shared_examples 'ceph osds' do
23 let :params do
24 {
25 :args => {
26 '/dev/sdb' => {
27 'journal' => '/srv/journal',
28 },
29 '/srv/data' => {
30 },
31 },
32 :defaults => {
33 'cluster' => 'CLUSTER',
34 },
35 }
36 end
37
38 it {
39 should contain_ceph__osd('/dev/sdb').with(
40 :ensure => 'present',
41 :journal => '/srv/journal',
42 :cluster => 'CLUSTER')
43 should contain_ceph__osd('/srv/data').with(
44 :ensure => 'present',
45 :cluster => 'CLUSTER')
46 should_not contain_sysctl__value('kernel.pid_max')
47 }
48 end
49
50 context 'sets pid_max when enabled' do
51 let :params do
52 {
53 :pid_max => 123456,
54 }
55 end
56 it do
57 should contain_sysctl__value('kernel.pid_max').with_value(123456)
58 end
59 end
60
61 on_supported_os({
62 :supported_os => OSDefaults.get_supported_os
63 }).each do |os,facts|
64 context "on #{os}" do
65 let (:facts) do
66 facts.merge!(OSDefaults.get_facts())
67 end
68
69 it_behaves_like 'ceph osds'
70 end
71 end
72
73 end