diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49981e36..b1971f43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,4 +13,4 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1 + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 diff --git a/spec/acceptance/r10k_webhook_spec.rb b/spec/acceptance/r10k_webhook_spec.rb new file mode 100644 index 00000000..905b5e04 --- /dev/null +++ b/spec/acceptance/r10k_webhook_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require 'spec_helper_acceptance' + +describe 'r10k::webhook tests', if: fact('os.name') != 'Archlinux' do + context 'when defaults used' do + it_behaves_like 'an idempotent resource' do + let(:manifest) do + <<-PUPPET + class { 'r10k': } + -> class { 'r10k::webhook': } + PUPPET + end + end + + describe package('webhook-go') do + it { is_expected.to be_installed } + end + + describe file('/etc/voxpupuli/webhook.yml') do + it 'exists and has content' do + expect(subject).to exist + expect(subject).to be_owned_by 'root' + expect(subject).to be_grouped_into 'root' + expect(subject).to contain "---\nserver:\n protected: true\n user: puppet\n password: puppet\n" + end + end + + describe service('webhook-go') do + it { is_expected.to be_enabled } + it { is_expected.to be_running } + end + + describe command('systemctl cat webhook-go') do + its(:stdout) { is_expected.to match(%r{webhook-go}) } + end + end +end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 2affbd1a..2681792e 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + require 'voxpupuli/acceptance/spec_helper_acceptance' -configure_beaker do |host| - on host, puppet('resource', 'user', 'puppet', 'ensure=present') -end +configure_beaker(modules: :metadata) + +Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }