Showing with 42 additions and 107 deletions.
  1. +2 −2 .fixtures.yml
  2. +12 −70 .github/workflows/ci.yml
  3. +8 −0 CHANGELOG.md
  4. +2 −2 Gemfile
  5. +4 −3 metadata.json
  6. +0 −4 spec/acceptance/tftp_redhat_spec.rb
  7. +3 −5 spec/acceptance/tftp_spec.rb
  8. +5 −21 spec/classes/init_spec.rb
  9. +6 −0 spec/setup_acceptance_node.pp
4 changes: 2 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fixtures:
repositories:
augeas_core: 'https://github.com/puppetlabs/puppetlabs-augeas_core'
stdlib: 'git://github.com/puppetlabs/puppetlabs-stdlib'
xinetd: 'git://github.com/puppetlabs/puppetlabs-xinetd'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
xinetd: 'https://github.com/puppetlabs/puppetlabs-xinetd'
82 changes: 12 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,21 @@
---
name: CI

on:
pull_request:
schedule:
- cron: '4 4 * * *'

jobs:
setup_matrix:
if: github.event_name != 'schedule' || github.repository_owner == 'theforeman'
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
outputs:
beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }}
puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run rake check
run: bundle exec rake check
- name: Run rake validate
run: bundle exec rake validate
- name: Run rake lint
run: bundle exec rake lint
- name: Setup Test Matrix
id: get_outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "${{ matrix.puppet }}.0"
name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake parallel_spec
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
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: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
rubocop: false
cache-version: '1'
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [7.2.0](https://github.com/theforeman/puppet-tftp/tree/7.2.0) (2022-04-19)

[Full Changelog](https://github.com/theforeman/puppet-tftp/compare/7.1.0...7.2.0)

**Implemented enhancements:**

- CentOS Stream 9 support [\#126](https://github.com/theforeman/puppet-tftp/pull/126) ([ekohl](https://github.com/ekohl))

## [7.1.0](https://github.com/theforeman/puppet-tftp/tree/7.1.0) (2022-02-03)

[Full Changelog](https://github.com/theforeman/puppet-tftp/compare/7.0.0...7.1.0)
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test']
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
Expand All @@ -15,7 +15,7 @@ gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet_metadata', '~> 1.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}
Expand Down
7 changes: 4 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "theforeman-tftp",
"version": "7.1.0",
"version": "7.2.0",
"author": "theforeman",
"summary": "TFTP server configuration",
"license": "GPL-3.0+",
"source": "git://github.com/theforeman/puppet-tftp",
"source": "https://github.com/theforeman/puppet-tftp",
"project_page": "https://github.com/theforeman/puppet-tftp",
"issues_url": "https://github.com/theforeman/puppet-tftp/issues",
"description": "Module for configuring a TFTP server",
Expand Down Expand Up @@ -41,7 +41,8 @@
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8"
"8",
"9"
]
},
{
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/tftp_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class { 'tftp':
it { is_expected.to be_listening.with('udp') }
end

describe 'ensure tftp client is installed' do
on hosts, puppet('resource', 'package', 'tftp', 'ensure=installed')
end

describe command("echo get /test /tmp/downloaded_file | tftp #{fact('fqdn')}") do
its(:exit_status) { should eq 0 }
end
Expand Down
8 changes: 3 additions & 5 deletions spec/acceptance/tftp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class { 'tftp': }
end

service_name = case fact('osfamily')
when 'Archlinux'
'tftpd.socket'
when 'RedHat'
fact('operatingsystemmajrelease').to_i >= 8 ? 'tftp.socket' : 'xinetd'
when 'Debian'
Expand All @@ -39,14 +41,10 @@ class { 'tftp': }
it { is_expected.not_to be_running }
end

describe port(69), unless: service_name == 'tftp.socket' do
describe port(69), unless: service_name.end_with?('.socket') do
it { is_expected.to be_listening.with('udp') }
end

describe 'ensure tftp client is installed' do
on hosts, puppet('resource', 'package', 'tftp', 'ensure=installed')
end

describe command("echo get /test /tmp/downloaded_file | tftp #{fact('fqdn')}") do
its(:exit_status) { should eq 0 }
end
Expand Down
26 changes: 5 additions & 21 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@
should_not contain_service('tftpd-hpa')
end
else
it 'should not configure xinetd' do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end

it 'should contain the service' do
should contain_service('tftp.socket')
.with_ensure('running')
Expand All @@ -78,11 +73,6 @@
end
end
when 'FreeBSD'
it 'should not configure xinetd' do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end

it 'should contain the service' do
should contain_service('tftpd')
.with_ensure('running')
Expand All @@ -91,25 +81,14 @@
.that_subscribes_to('Class[Tftp::Config]')
end
when 'Archlinux'
it 'should not configure xinetd' do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end

it 'should contain the service' do
should contain_service('tftpd.socket')
.with_ensure('running')
.with_enable('true')
.with_alias('tftpd')
.that_subscribes_to('Class[Tftp::Config]')
end

else
it 'should not configure xinetd' do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end

it 'should contain the service' do
should contain_service('tftpd-hpa')
.with_ensure('running')
Expand All @@ -123,6 +102,11 @@
end
end

it 'should not configure xinetd', unless: facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease].to_i <= 7 do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end

context 'with root set to /changed', if: facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease].to_i <= 7 do
let :params do
{
Expand Down
6 changes: 6 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Arch includes the client the server package
unless $facts['os']['family'] == 'Archlinux' {
package { 'tftp':
ensure => installed,
}
}