Debian Codegraph @

spec/acceptance/ceph_mon_osd_spec.rb

raw
1 #
2 # Copyright (C) 2015 David Gurtner
3 #
4 # Author: David Gurtner <[email protected]>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 require 'spec_helper_acceptance'
19
20 describe 'ceph mon osd' do
21
22 context 'default parameters' do
23
24 it 'should install one monitor and one OSD on /srv/data' do
25 pp = <<-EOS
26 class { 'ceph::repo':
27 enable_sig => true,
28 enable_epel => false,
29 ceph_mirror => $ceph_mirror,
30 }
31 class { 'ceph':
32 fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
33 mon_host => $::ipaddress,
34 authentication_type => 'none',
35 osd_pool_default_size => '1',
36 osd_pool_default_min_size => '1',
37 osd_max_object_namespace_len => '64',
38 osd_max_object_name_len => '256',
39 }
40 ceph_config {
41 'global/osd_journal_size': value => '100';
42 }
43 ceph::mgr { 'a':
44 authentication_type => 'none',
45 }
46 ceph::mon { 'a':
47 public_addr => $::ipaddress,
48 authentication_type => 'none',
49 }
50 ceph::osd { '/srv/data': }
51 EOS
52
53 apply_manifest(pp, :catch_failures => true)
54 apply_manifest(pp, :catch_changes => true)
55
56 if os[:family].casecmp('RedHat') == 0
57 shell 'sleep 10' # we need to wait a bit until the OSD is up
58
59 shell 'ceph -s', { :acceptable_exit_codes => [0] } do |r|
60 expect(r.stdout).to match(/mon: 1 daemons/)
61 expect(r.stderr).to be_empty
62 end
63
64 shell 'ceph osd tree | grep osd.0', { :acceptable_exit_codes => [0] } do |r|
65 expect(r.stdout).to match(/up/)
66 expect(r.stderr).to be_empty
67 end
68 end
69 end
70 end
71
72 end