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 acceptance test for aptly::mirror #18

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 1 addition & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-02-27 12:38:44 UTC using RuboCop version 1.50.2.
# on 2024-02-27 15:10:28 UTC using RuboCop version 1.50.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -10,8 +10,3 @@
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/defines/mirror_spec.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'spec/spec_helper_system.rb'
35 changes: 35 additions & 0 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,39 @@
end
end
end

context 'mirror' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
include apt
include aptly
$package = $facts['os']['name'] ? {
'Debian' => 'debian-archive-keyring',
'Ubuntu' => 'ubuntu-keyring',
}
package { $package:
ensure => 'installed',
}
exec { 'import_keyring':
command => "/usr/bin/gpg --no-default-keyring --keyring /usr/share/keyrings/${facts['os']['name'].downcase}-archive-keyring.gpg --export | /usr/bin/gpg --no-default-keyring --keyring trustedkeys.gpg --import",
creates => '/root/.gnupg/trustedkeys.gpg',
}
~> exec { 'puppetkey':
command => '/usr/bin/wget -O - https://apt.puppet.com/keyring.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import',
refreshonly => true,
}
-> aptly::mirror { 'puppetlabs':
location => 'https://apt.puppet.com/',
key => 'D6811ED3ADEEB8441AF5AA8F4528B6CD9E61EF26',
release => 'bookworm',
repos => ['puppet8'],
}
PUPPET
end
end
describe command('aptly mirror show puppetlabs') do
its(:stdout) { is_expected.to match %r{Archive Root URL: https://apt.puppet.com/} }
end
end
end
36 changes: 0 additions & 36 deletions spec/system/mirror_spec.rb

This file was deleted.