Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Puppetserver 5.x upgrade test #667

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions spec/acceptance/puppetserver_upgrade_5_1_3_to_5_3_6_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
require 'spec_helper_acceptance'

describe 'Scenario: 5.1.3 to 5.3.6 upgrade:', if: ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet5' && fact('lsbdistcodename') != 'bionic' do
before(:context) do
if check_for_package(default, 'puppetserver')
on default, puppet('resource package puppetserver ensure=purged')
on default, 'rm -rf /etc/sysconfig/puppetserver /etc/puppetlabs/puppetserver'
on default, 'rm -rf /etc/puppetlabs/puppet/ssl'
end

# puppetserver won't start with lower than 2GB memory
memoryfree_mb = fact('memoryfree_mb').to_i
raise 'At least 2048MB free memory required' if memoryfree_mb < 256
end

case fact('osfamily')
when 'Debian'
from_version = "5.1.3-1#{fact('lsbdistcodename')}"
to_version = "5.3.6-1#{fact('lsbdistcodename')}"
else
from_version = '5.1.3'
to_version = '5.3.6'
end

context 'install 5.1.3' do
let(:pp) do
<<-EOS
class { '::puppet':
server => true,
server_foreman => false,
server_reports => 'store',
server_external_nodes => '',
server_version => '#{from_version}',
# only for install test - don't think to use this in production!
# https://docs.puppet.com/puppetserver/latest/tuning_guide.html
server_jvm_max_heap_size => '256m',
server_jvm_min_heap_size => '256m',
}
EOS
end

it_behaves_like 'a idempotent resource'

describe command('puppetserver --version') do
its(:stdout) { is_expected.to match("puppetserver version: 5.1.3\n") }
end

describe service('puppetserver') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe port('8140') do
it { is_expected.to be_listening }
end
end

context 'upgrade to 5.3.6' do
let(:pp) do
<<-EOS
class { '::puppet':
server => true,
server_foreman => false,
server_reports => 'store',
server_external_nodes => '',
server_version => '#{to_version}',
# only for install test - don't think to use this in production!
# https://docs.puppet.com/puppetserver/latest/tuning_guide.html
server_jvm_max_heap_size => '256m',
server_jvm_min_heap_size => '256m',
}
EOS
end

it_behaves_like 'a idempotent resource'

describe command('puppetserver --version') do
its(:stdout) { is_expected.to match("puppetserver version: 5.3.6\n") }
end

describe service('puppetserver') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe port('8140') do
it { is_expected.to be_listening }
end
end
end