Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created November 4, 2013 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/7305126 to your computer and use it in GitHub Desktop.
Save dmsimard/7305126 to your computer and use it in GitHub Desktop.
ceph_init_systemspec
# Copyright (C) iWeb Technologies Inc.
#
# 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.
#
# Author: David Moreau Simard <dmsimard@iweb.com>
require 'spec_helper_system'
describe 'ceph::init with ceph::repo' do
describe 'dumpling' do
it 'should find 0.67' do
pp = <<-EOS
class { 'ceph::repo':
release => 'dumpling'
}
class { 'ceph::init': }
Class['ceph::repo'] -> Class['ceph::init']
EOS
# Run it twice and test for idempotency
puppet_apply(pp) do |r|
r.exit_code.should_not == 1
r.refresh
r.exit_code.should be_zero
end
end
context shell 'apt-cache policy ceph' do
its(:stdout) { should =~ /Candidate: 0.67/ }
its(:stderr) { should be_empty }
its(:exit_code) { should be_zero }
end
end
describe 'cuttlefish (default)' do
it 'should find 0.61' do
pp = <<-EOS
class { 'ceph::repo': }
class { 'ceph::init': }
Class['ceph::repo'] -> Class['ceph::init']
EOS
# Run it twice and test for idempotency
puppet_apply(pp) do |r|
r.exit_code.should_not == 1
r.refresh
r.exit_code.should be_zero
end
end
context shell 'apt-cache policy ceph' do
its(:stdout) { should =~ /Candidate: 0.61/ }
its(:stderr) { should be_empty }
its(:exit_code) { should be_zero }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment