Skip to content
Draft
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
2 changes: 2 additions & 0 deletions spec/acceptance/ansible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'ansible'

describe package('ansible-collection-theforeman-foreman') do
it { is_expected.to be_installed }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/container_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'container_gateway'

describe 'is created' do
it { expect(package('rubygem-smart_proxy_container_gateway')).to be_installed }
it { expect(file('/etc/foreman-proxy/settings.d/container_gateway.yml')).to be_file }
Expand Down
4 changes: 1 addition & 3 deletions spec/acceptance/discovery_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@

it_behaves_like 'the default foreman proxy application'

describe command('curl -sk https://127.0.0.1:8443/features | grep -q discovery') do
its(:exit_status) { should eq 0 }
end
it_behaves_like 'the exposed feature', 'discovery'
end
2 changes: 2 additions & 0 deletions spec/acceptance/dns_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'dns'

describe port(53) do
it { is_expected.to be_listening }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/dynflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
include_examples 'the example', 'dynflow.pp'

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'dynflow'
end
2 changes: 2 additions & 0 deletions spec/acceptance/openscap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'openscap'

describe package('puppet-foreman_scap_client') do
it { is_expected.to be_installed }
end
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/remote_execution_script_pull_mqtt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'script'

describe port(1883) do
it { is_expected.to be_listening }
end
Expand Down Expand Up @@ -70,6 +72,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'script'

describe port(1883) do
it { is_expected.not_to be_listening }
end
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/remote_execution_script_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'script'

describe file('/etc/foreman-proxy/settings.d/remote_execution_ssh.yml') do
its(:content) { is_expected.to_not match %r{:ssh_log_level:} }
end
Expand All @@ -19,6 +21,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'script'

describe file('/etc/foreman-proxy/settings.d/remote_execution_ssh.yml') do
its(:content) { is_expected.to match %r{:ssh_log_level: debug} }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/salt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

it_behaves_like 'the default foreman proxy application'

it_behaves_like 'the exposed feature', 'salt'

specify { expect(file('/etc/salt/master.d')).to be_directory }
specify { expect(file('/etc/salt/master.d/foreman.conf')).to be_file.and(have_attributes(owner: 'root', group: 'foreman-proxy')) }
end
10 changes: 10 additions & 0 deletions spec/support/acceptance/examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@
it { is_expected.to be_listening }
end
end

shared_examples 'the exposed feature' do |feature|
let(:feature) { feature }

cert_dir = '/etc/foreman-proxy'
describe curl_command("https://#{host_inventory['fqdn']}:8443/features", cacert: "#{cert_dir}/certificate.pem", cert: "#{cert_dir}/certificate.pem", key: "#{cert_dir}/key.pem") do
Comment on lines +19 to +20
Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, we don't need client auth so can be simplified to:

Suggested change
cert_dir = '/etc/foreman-proxy'
describe curl_command("https://#{host_inventory['fqdn']}:8443/features", cacert: "#{cert_dir}/certificate.pem", cert: "#{cert_dir}/certificate.pem", key: "#{cert_dir}/key.pem") do
describe curl_command("https://#{host_inventory['fqdn']}:8443/features", cacert: '/etc/foreman-proxy/certificate.pem') do

its(:stdout) { should include(feature) }

Check failure on line 21 in spec/support/acceptance/examples.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - AlmaLinux 9

Scenario: install foreman-proxy with container_gateway plugin behaves like the exposed feature Curl command "https://almalinux9-64-puppet8.example.com:8443/features" stdout is expected to include "container_gateway" Failure/Error: its(:stdout) { should include(feature) } expected "[\"logs\"]" to include "container_gateway" Shared Example Group: "the exposed feature" called from ./spec/acceptance/container_gateway_spec.rb:10

Check failure on line 21 in spec/support/acceptance/examples.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Rocky 9

Scenario: install foreman-proxy with container_gateway plugin behaves like the exposed feature Curl command "https://rocky9-64-puppet8.example.com:8443/features" stdout is expected to include "container_gateway" Failure/Error: its(:stdout) { should include(feature) } expected "[\"logs\"]" to include "container_gateway" Shared Example Group: "the exposed feature" called from ./spec/acceptance/container_gateway_spec.rb:10

Check failure on line 21 in spec/support/acceptance/examples.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - CentOS 9

Scenario: install foreman-proxy with container_gateway plugin behaves like the exposed feature Curl command "https://centos9-64-puppet8.example.com:8443/features" stdout is expected to include "container_gateway" Failure/Error: its(:stdout) { should include(feature) } expected "[\"logs\"]" to include "container_gateway" Shared Example Group: "the exposed feature" called from ./spec/acceptance/container_gateway_spec.rb:10
its(:exit_status) { should eq 0 }
end
end
Loading