Skip to content

Commit

Permalink
(maint) Fixing test to upgrade from puppet 5 not from puppet 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Oana Tanasoiu committed May 28, 2019
1 parent 984c215 commit 737e1bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

it 'should work idempotently with no errors' do
pp = <<-EOS
class { 'puppet_agent': package_version => '6.0.9' }
class { 'puppet_agent': package_version => '5.5.14', collection => 'puppet5' }
EOS

# Run it twice and test for idempotency
Expand Down Expand Up @@ -63,7 +63,7 @@ class { 'puppet_agent': package_version => '6.0.9' }
wait_for_finish_on default
case default['platform']
when /debian|ubuntu/
pp = "include apt\napt::source { 'pc_repo': ensure => present, location => 'https://apt.puppet.com', repos => 'PC1' }"
pp = "include apt\napt::source { 'pc_repo': ensure => present, location => 'https://apt.puppet.com', repos => 'puppet5'}"
when /fedora|el|centos/
pp = "yumrepo { 'pc_repo': ensure => present }"
else
Expand Down Expand Up @@ -133,7 +133,7 @@ class { 'puppet_agent': service_names => [] }
context 'agent run' do
before(:all) {
setup_puppet_on default, :agent => true
manifest = 'class { "puppet_agent": package_version => "1.10.0", service_names => ["mcollective"] }'
manifest = 'class { "puppet_agent": package_version => "5.5.14", collection => "puppet5", service_names => ["mcollective"] }'
pp = "file { '#{master.puppet['codedir']}/environments/production/manifests/site.pp': ensure => file, content => '#{manifest}' }"
apply_manifest_on(master, pp, :catch_failures => true)
}
Expand Down Expand Up @@ -173,7 +173,7 @@ class { 'puppet_agent': service_names => [] }
context 'with mcollective configured' do
before(:all) {
setup_puppet_on default, :mcollective => true, :agent => true
manifest = 'class { "puppet_agent": package_version => "1.10.0", service_names => ["mcollective"] }'
manifest = 'class { "puppet_agent": package_version => "5.5.14", collection => "puppet5", service_names => ["mcollective"] }'
pp = "file { '#{master.puppet['codedir']}/environments/production/manifests/site.pp': ensure => file, content => '#{manifest}' }"
apply_manifest_on(master, pp, :catch_failures => true)
}
Expand Down
10 changes: 5 additions & 5 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def activemq_host
def install_modules_on(host)
install_ca_certs_on(host)
puppet_module_install_on(host, :source => PROJ_ROOT, :module_name => 'puppet_agent')
on host, puppet('module', 'install', 'puppetlabs-stdlib', '--version', '5.1.0'), {:acceptable_exit_codes => [0]}
on host, puppet('module', 'install', 'puppetlabs-inifile', '--version', '2.4.0'), {:acceptable_exit_codes => [0]}
on host, puppet('module', 'install', 'puppetlabs-apt', '--version', '6.0.0'), {:acceptable_exit_codes => [0]}
on host, puppet('module', 'install', 'puppetlabs-stdlib'), {:acceptable_exit_codes => [0]}
on host, puppet('module', 'install', 'puppetlabs-inifile'), {:acceptable_exit_codes => [0]}
on host, puppet('module', 'install', 'puppetlabs-apt'), {:acceptable_exit_codes => [0]}
end

unless ENV['BEAKER_provision'] == 'no'
Expand Down Expand Up @@ -133,7 +133,7 @@ def setup_puppet_on(host, opts = {})

puts "Setup foss puppet on #{host}"
configure_defaults_on host, 'foss'
install_puppet_agent_on host, :version => ENV['PUPPET_CLIENT_VERSION'] || '5.5.14'
install_puppet_agent_on host, {:version => ENV['PUPPET_CLIENT_VERSION'] || '5.5.10', :puppet_collection => 'puppet5'}

puppet_opts = agent_opts(master.to_s)
if host['platform'] =~ /windows/i
Expand Down Expand Up @@ -209,7 +209,7 @@ def teardown_puppet_on(host)
clean_repo = "include apt\napt::source { 'pc_repo': ensure => absent, notify => Package['puppet-agent'] }"
when /fedora|el|centos/
clean_repo = "yumrepo { 'pc_repo': ensure => absent, notify => Package['puppet-agent'] }"
when /sles/
when /sles|osx/
ensure_type = 'absent'
else
logger.notify("Not sure how to remove repos on #{host['platform']}")
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

RSpec.configure do |c|
c.default_facts = {
:aio_agent_version => '1.10.100',
:puppetversion => nil,
:aio_agent_version => '5.5.10',
:puppetversion => '5.5.10',
:lsbdistrelease => nil,
:is_pe => false,
:platform_tag => nil,
Expand Down

0 comments on commit 737e1bb

Please sign in to comment.