| 1 |
# |
| 2 |
# Copyright (C) 2016 Red Hat, 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: Giulio Fidente <[email protected]> |
| 17 |
# |
| 18 |
require 'spec_helper' |
| 19 |
|
| 20 |
describe 'ceph::profile::mds' do |
| 21 |
|
| 22 |
shared_examples 'ceph profile mds' do |
| 23 |
|
| 24 |
it { should contain_class('ceph::mds').with( |
| 25 |
'public_addr' => '10.11.12.2', |
| 26 |
)} |
| 27 |
it { should contain_ceph__key('mds.myhostname').with( |
| 28 |
:cap_mon => 'allow profile mds', |
| 29 |
:cap_osd => 'allow rwx', |
| 30 |
:cap_mds => 'allow', |
| 31 |
:inject => true, |
| 32 |
:keyring_path => "/var/lib/ceph/mds/ceph-myhostname/keyring", |
| 33 |
:secret => 'AQDLOh1VgEp6FRAAFzT7Zw+Y9V6JJExQAsRnRQ==', |
| 34 |
:user => 'ceph', |
| 35 |
:group => 'ceph' |
| 36 |
)} |
| 37 |
end |
| 38 |
|
| 39 |
on_supported_os({ |
| 40 |
:supported_os => OSDefaults.get_supported_os |
| 41 |
}).each do |os,facts| |
| 42 |
context "on #{os}" do |
| 43 |
let (:facts) do |
| 44 |
facts.merge!(OSDefaults.get_facts({:hostname => 'myhostname'})) |
| 45 |
end |
| 46 |
|
| 47 |
it_behaves_like 'ceph profile mds' |
| 48 |
end |
| 49 |
end |
| 50 |
end |