| 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::profile::osd' do |
| 21 |
|
| 22 |
shared_examples 'ceph profile osd' do |
| 23 |
context 'with the default osd defined in common.yaml' do |
| 24 |
|
| 25 |
before :each do |
| 26 |
facts.merge!( :hostname => 'osd') |
| 27 |
end |
| 28 |
|
| 29 |
it { should contain_class('ceph::profile::client') } |
| 30 |
it { should contain_ceph__osd('/dev/sdc').with(:journal => '/dev/sdb') } |
| 31 |
it { should contain_ceph__osd('/dev/sdd').with(:journal => '/dev/sdb') } |
| 32 |
end |
| 33 |
|
| 34 |
context 'with the host specific first.yaml' do |
| 35 |
|
| 36 |
before :each do |
| 37 |
facts.merge!( :hostname => 'first') |
| 38 |
end |
| 39 |
|
| 40 |
it { should contain_class('ceph::profile::client') } |
| 41 |
it { should contain_ceph__osd('/dev/sdb').with( :journal => '/srv/journal') } |
| 42 |
end |
| 43 |
end |
| 44 |
|
| 45 |
on_supported_os.each do |os, facts| |
| 46 |
context "on #{os}" do |
| 47 |
let(:facts) do |
| 48 |
facts.merge({}) |
| 49 |
end |
| 50 |
|
| 51 |
it_behaves_like 'ceph profile osd' |
| 52 |
end |
| 53 |
end |
| 54 |
end |