Skip to content

Commit

Permalink
(maint) Initially manage puppet before testing
Browse files Browse the repository at this point in the history
This changes the class_spec to initally manage puppet; puppet 7 and
puppet 8 both are not enabled or running after installation, so
there could be a bug in the initscripts somewhere or this was never
actually a feature but a bug in how the tests were run.
  • Loading branch information
tvpartytonight committed Aug 30, 2023
1 parent 7fd28af commit 61859dd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

describe 'puppet_agent class' do
context 'default parameters in apply' do
before(:all) { setup_puppet_on default }
before(:all) do
setup_puppet_on default
pp = "class { 'puppet_agent': package_version => 'auto'}"
apply_manifest(pp, catch_failures: true)
end
after(:all) { teardown_puppet_on default }

describe package(package_name(default)) do
Expand All @@ -18,6 +22,7 @@
end
else
describe service('puppet') do

Check failure on line 25 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Run checks

Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. (https://rubystyle.guide#empty-lines-around-bodies)
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand All @@ -34,9 +39,6 @@
describe 'manage_repo parameter' do
context 'when true (default)' do
it 'creates repo config' do
pp = "class { 'puppet_agent': }"
apply_manifest(pp, catch_failures: true)
wait_for_finish_on default
case default['platform']
when %r{debian|ubuntu}
pp = "include apt\napt::source { 'pc_repo': ensure => present, location => 'https://apt.puppet.com', repos => 'puppet5'}"
Expand All @@ -53,9 +55,6 @@

context 'when false' do
it 'ceases to manage repo config' do
pp = "class { 'puppet_agent': }"
apply_manifest(pp, catch_failures: true)
wait_for_finish_on default
case default['platform']
when %r{debian|ubuntu}
pp = "include apt\napt::source { 'pc_repo': ensure => absent }"
Expand Down

0 comments on commit 61859dd

Please sign in to comment.