Skip to content

Commit

Permalink
Merge pull request #18 from voxpupuli/modulesync
Browse files Browse the repository at this point in the history
Add acceptance test for aptly::mirror
  • Loading branch information
bastelfreak committed Feb 27, 2024
2 parents 8aacc2e + 3a0373f commit 37de20f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
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.

0 comments on commit 37de20f

Please sign in to comment.