Add acceptance tests
... to check a few more details of the deployment result. The existing spec file is removed because it can't be run by litmus. Change-Id: Ic4ffbebbf3c1d7ed82088703bce2681cb218de91
This commit is contained in:
parent
c1beeda5c0
commit
489e312416
@ -4,4 +4,5 @@
|
||||
- puppet-openstack-module-unit-jobs
|
||||
- puppet-openstack-integration-jobs-scenario001
|
||||
- puppet-openstack-integration-jobs-scenario004
|
||||
- puppet-openstack-litmus-jobs
|
||||
- release-notes-jobs-python3
|
||||
|
76
spec/acceptance/10_basic_ceph_spec.rb
Normal file
76
spec/acceptance/10_basic_ceph_spec.rb
Normal file
@ -0,0 +1,76 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'basic ceph' do
|
||||
|
||||
context 'default parameters' do
|
||||
|
||||
it 'should work with no errors' do
|
||||
pp = <<-EOS
|
||||
include openstack_integration
|
||||
include openstack_integration::apache
|
||||
include openstack_integration::mysql
|
||||
include openstack_integration::memcached
|
||||
include openstack_integration::keystone
|
||||
class { 'openstack_integration::ceph':
|
||||
deploy_rgw => true,
|
||||
create_cephfs => true,
|
||||
}
|
||||
include openstack_integration::repos
|
||||
EOS
|
||||
|
||||
apply_manifest(pp, :catch_failures => true)
|
||||
apply_manifest(pp, :catch_changes => true)
|
||||
end
|
||||
|
||||
it 'should deploy mon' do
|
||||
command('ceph -s') do |r|
|
||||
expect(r.exit_code).to eq 0
|
||||
expect(r.stdout).to match(/mon: 1 daemons/)
|
||||
expect(r.stderr).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
it 'should deploy osd' do
|
||||
command('ceph osd tree') do |r|
|
||||
expect(r.exit_code).to eq 0
|
||||
expect(r.stdout).to match(/\s+osd.0\s+up\s+/)
|
||||
expect(r.stderr).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
it 'should create pools' do
|
||||
command('ceph osd pool ls') do |r|
|
||||
expect(r.exit_code).to eq 0
|
||||
expect(r.stdout).to match(/^nova$/)
|
||||
expect(r.stdout).to match(/^glance$/)
|
||||
expect(r.stdout).to match(/^cephfs_data$/)
|
||||
expect(r.stdout).to match(/^cephfs_metadata$/)
|
||||
expect(r.stderr).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
it 'should create fs' do
|
||||
command('ceph fs ls') do |r|
|
||||
expect(r.exit_code).to eq 0
|
||||
expect(r.stdout).to match(/^cephfs$/)
|
||||
expect(r.stderr).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
describe port(8080) do
|
||||
it { is_expected.to be_listening }
|
||||
end
|
||||
end
|
||||
end
|
@ -1,75 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015 David Gurtner
|
||||
#
|
||||
# Author: David Gurtner <aldavud@crimson.ch>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'ceph mon osd' do
|
||||
|
||||
context 'default parameters' do
|
||||
|
||||
it 'should install one monitor and one OSD on /srv/data' do
|
||||
pp = <<-EOS
|
||||
class { 'ceph::repo':
|
||||
enable_sig => true,
|
||||
enable_epel => false,
|
||||
ceph_mirror => $ceph_mirror,
|
||||
}
|
||||
class { 'ceph':
|
||||
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
|
||||
mon_host => $::ipaddress,
|
||||
authentication_type => 'none',
|
||||
osd_pool_default_size => '1',
|
||||
osd_pool_default_min_size => '1',
|
||||
osd_max_object_namespace_len => '64',
|
||||
osd_max_object_name_len => '256',
|
||||
}
|
||||
ceph_config {
|
||||
'global/osd_journal_size': value => '100';
|
||||
}
|
||||
ceph::mgr { 'a':
|
||||
authentication_type => 'none',
|
||||
}
|
||||
ceph::mon { 'a':
|
||||
public_addr => $::ipaddress,
|
||||
authentication_type => 'none',
|
||||
}
|
||||
ceph::osd { '/srv/data': }
|
||||
EOS
|
||||
|
||||
apply_manifest(pp, :catch_failures => true)
|
||||
apply_manifest(pp, :catch_changes => true)
|
||||
|
||||
if os[:family].casecmp('RedHat') == 0
|
||||
describe command('sleep 10') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
describe command('ceph -s') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
its(:stdout) { should match /mon: 1 daemons/) }
|
||||
its(:stderr) { should be_empty }
|
||||
end
|
||||
|
||||
describe command('ceph osd tree | grep osd.0') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
its(:stdout) { should match /up/ }
|
||||
its(:stderr) { should be_empty }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user