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

fix beaker tests #258

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on: pull_request

jobs:
acceptance:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
name: 'Debian 10 puppet 6'
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: puppet6
BEAKER_setfile: "debian10-64{hostname=debian10-64.example.com}"
12 changes: 5 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ group :development do
end

group :system_tests do
gem 'puppet_metadata', '~> 0.3.0', :require => false
gem 'voxpupuli-acceptance', :require => false
end

Expand All @@ -35,14 +36,11 @@ group :release do
end


gem 'puppetlabs_spec_helper', '~> 2.0', :require => false
gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
require 'voxpupuli/test/rake'
# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
# otherwise attempt to load it directly.
begin
require 'voxpupuli/test/rake'
rescue LoadError
require 'puppetlabs_spec_helper/rake_tasks'
end

# load optional tasks for releases
# only available if gem group releases is installed
Expand Down
15 changes: 3 additions & 12 deletions spec/acceptance/unbound_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
describe 'unbound class' do
describe 'running puppet code' do
it 'work with no errors' do
pp = "class {'unbound': }"
pp = "class {'unbound': verbosity => 5, logfile => '/tmp/unbound.log'}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this happens more often, https://github.com/voxpupuli/voxpupuli-acceptance/#environment-variables-to-facts may be a good way to make this easier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was mainly to debug the ipv6 issue and not sure if its genrally usefull but thanks for the pointer

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_failures: true)
expect(apply_manifest(pp, catch_failures: true).exit_code).to eq 0
Expand All @@ -29,19 +29,10 @@
describe port(53) do
it { is_expected.to be_listening }
end
describe command('dig +dnssec . soa @localhost') do
its(:stdout) { is_expected.to match %r{\.\s+\d+\s+IN\s+SOA\s+a\.root-servers\.net\.\snstld\.verisign-grs\.com\.\s\d+\s1800\s900\s604800\s86400} }
its(:stdout) { is_expected.to match %r{flags: qr rd ra ad;} }
end
describe command('dig +dnssec . soa @localhost') do
its(:stdout) { is_expected.to match %r{\.\s+\d+\s+IN\s+SOA\s+a\.root-servers\.net\.\snstld\.verisign-grs\.com\.\s\d+\s1800\s900\s604800\s86400} }
its(:stdout) { is_expected.to match %r{\.\s+\d+\s+IN\s+RRSIG\s+SOA} }
its(:stdout) { is_expected.to match %r{flags: qr rd ra ad;} }
end
describe command('dig +dnssec SOA dnssec-failed.org @localhost') do
describe command('dig +tcp +dnssec -t SOA dnssec-failed.org @127.0.0.1') do
its(:stdout) { is_expected.to match %r{status: SERVFAIL} }
end
describe command('dig +dnssec +cd SOA dnssec-failed.org @localhost') do
describe command('dig +dnssec +cd -t SOA dnssec-failed.org @127.0.0.1') do
its(:stdout) { is_expected.to match %r{status: NOERROR} }
end
end
Expand Down