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 Test for latest rundeck v5.7.0-20241021 #554

Closed
wants to merge 2 commits into from
Closed
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
84 changes: 60 additions & 24 deletions spec/acceptance/rundeck_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,38 @@

describe 'rundeck class' do
context 'default parameters' do
it 'applies successfully' do
pp = <<-EOS
class { 'java':
distribution => 'jre',
}
class { 'rundeck':
package_ensure => '5.0.2.20240212-1',
}
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'java':
distribution => 'jre',
}
class { 'rundeck':
package_ensure => '5.0.2.20240212-1',
}
Class['java'] -> Class['rundeck']
PUPPET
end
end
describe package('rundeck') do
it { is_expected.to be_installed }
end

Class['java'] -> Class['rundeck']
EOS
describe service('rundeckd') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
end

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true, debug: true)
apply_manifest(pp, catch_changes: true, debug: true)
context 'updrade to 5.2.0.20240410-1' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'rundeck':
package_ensure => '5.2.0.20240410-1',
}
PUPPET
end
end

describe package('rundeck') do
Expand All @@ -31,17 +48,15 @@
end
end

context 'updrade to latest version' do
it 'applies successfully' do
pp = <<-EOS
class { 'rundeck':
package_ensure => '5.2.0.20240410-1',
}
EOS

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
context 'updrade to 5.7.0.20241021-1' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'rundeck':
package_ensure => '5.7.0.20241021-1',
}
PUPPET
end
end

describe package('rundeck') do
Expand All @@ -53,4 +68,25 @@
it { is_expected.to be_running }
end
end

context 'remove rundeck' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'rundeck':
package_ensure => 'absent',
}
PUPPET
end
end

describe package('rundeck') do
it { is_expected.not_to be_installed }
end

describe service('rundeckd') do
it { is_expected.not_to be_enabled }

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Debian 11

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Debian 11

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 22.04

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Ubuntu 22.04

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Ubuntu 20.04

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled

Check failure on line 88 in spec/acceptance/rundeck_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 20.04

rundeck class remove rundeck Service "rundeckd" is expected not to be enabled Failure/Error: it { is_expected.not_to be_enabled } expected Service "rundeckd" not to be enabled
it { is_expected.not_to be_running }
end
end
end
Loading