Debian Codegraph @

spec/defines/ceph_fs_spec.rb

raw
1 # Copyright 2016 Red Hat, Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16 require 'spec_helper'
17
18 describe 'ceph::fs' do
19 shared_examples 'ceph fs' do
20 describe "activated with custom params" do
21 let :title do
22 'fsa'
23 end
24
25 let :params do
26 {
27 :metadata_pool => 'metadata_pool',
28 :data_pool => 'data_pool'
29 }
30 end
31
32 it { should contain_exec('create-fs-fsa').with(
33 :command => "/bin/true # comment to satisfy puppet syntax requirements\nset -ex\nceph fs new fsa metadata_pool data_pool",
34 :unless => "/bin/true # comment to satisfy puppet syntax requirements\nset -ex\nceph fs ls | grep 'name: fsa,'"
35 )}
36 end
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 fs'
48 end
49 end
50 end