-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a shared example to reduce duplication
- Loading branch information
Showing
4 changed files
with
75 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
shared_examples 'the default pulpcore application' do | ||
certdir = '/etc/pulpcore-certs' | ||
|
||
describe user('pulp') do | ||
it { is_expected.to exist } | ||
its(:uid) { is_expected.to be < 1000 } | ||
end | ||
|
||
describe group('pulp') do | ||
it { is_expected.to exist } | ||
its(:gid) { is_expected.to be < 1000 } | ||
end | ||
|
||
describe service('httpd') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-api') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-content') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-resource-manager') do | ||
it { is_expected.not_to be_enabled } | ||
it { is_expected.not_to be_running } | ||
end | ||
|
||
describe service('pulpcore-worker@1') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe port(443) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/status/", cacert: "#{certdir}/ca-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager dumpdata auth.User") do | ||
its(:stdout) { is_expected.to match(/auth\.user/) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/", cacert: "#{certdir}/ca-cert.pem") do | ||
# Requires authentication: https://github.com/pulp/pulpcore/issues/2340 | ||
its(:response_code) { is_expected.to eq(403) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/", | ||
cacert: "#{certdir}/ca-cert.pem", key: "#{certdir}/client-key.pem", cert: "#{certdir}/client-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:body) { is_expected.to contain('artifacts') } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
end |