forked from theforeman/foreman_maintain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #35533 - remove duplicate ssl params of cpdb cmd (theforeman#643)
- Loading branch information
1 parent
5f9bf72
commit fef74a8
Showing
4 changed files
with
134 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'test_helper' | ||
require 'minitest/stub_const' | ||
|
||
describe Features::CandlepinDatabase do | ||
include DefinitionsTestHelper | ||
subject { Features::CandlepinDatabase.new } | ||
let(:subject_ins) { Features::CandlepinDatabase.any_instance } | ||
|
||
let(:cp_config_dir) do | ||
File.expand_path('../../../support/', __FILE__) | ||
end | ||
|
||
def stub_with_ssl_config | ||
Features::CandlepinDatabase.stub_const(:CANDLEPIN_DB_CONFIG, | ||
cp_config_dir + '/candlepin_with_ssl.conf') do | ||
yield | ||
end | ||
end | ||
|
||
def stub_without_ssl_config | ||
Features::CandlepinDatabase.stub_const(:CANDLEPIN_DB_CONFIG, | ||
cp_config_dir + '/candlepin_without_ssl.conf') do | ||
yield | ||
end | ||
end | ||
|
||
describe '.configuration' do | ||
it 'The url includes ssl attributes when ssl is enabled' do | ||
stub_with_ssl_config do | ||
url = subject.configuration['url'] | ||
assert_includes url, 'ssl=true' | ||
assert_includes url, 'sslrootcert=/usr/share/foreman/root.crt' | ||
end | ||
end | ||
|
||
it 'The url does not include ssl attributes when ssl is disabled' do | ||
stub_without_ssl_config do | ||
url = subject.configuration['url'] | ||
refute_includes url, 'ssl=true' | ||
refute_includes url, 'sslrootcert=/usr/share/foreman/root.crt' | ||
end | ||
end | ||
end | ||
end |
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,45 @@ | ||
### File managed with puppet ### | ||
## Module: 'candlepin' | ||
|
||
candlepin.consumer_system_name_pattern=.+ | ||
candlepin.environment_content_filtering=true | ||
candlepin.auth.basic.enable=false | ||
candlepin.auth.trusted.enable=false | ||
|
||
candlepin.audit.hornetq.config_path=/etc/candlepin/broker.xml | ||
|
||
candlepin.auth.oauth.enable=true | ||
candlepin.auth.oauth.consumer.katello.secret=abcdabcd | ||
|
||
module.config.adapter_module=org.candlepin.katello.KatelloModule | ||
|
||
candlepin.ca_key=/etc/candlepin/certs/candlepin-ca.key | ||
candlepin.ca_cert=/etc/candlepin/certs/candlepin-ca.crt | ||
candlepin.crl.file=/var/lib/candlepin/candlepin-crl.crl | ||
|
||
candlepin.async.jobs.ExpiredPoolsCleanupJob.schedule=0 0 0 * * ? | ||
|
||
# Required for https://hibernate.atlassian.net/browse/HHH-12927 | ||
log4j.logger.org.hibernate.internal.SessionImpl=ERROR | ||
|
||
# uncomment to enable debug logging in candlepin.log: | ||
#log4j.logger.org.candlepin=DEBUG | ||
jpa.config.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect | ||
jpa.config.hibernate.connection.driver_class=org.postgresql.Driver | ||
jpa.config.hibernate.connection.url=jdbc:postgresql://host.example.com:5432/candlepin1db?ssl=true&sslrootcert=/usr/share/foreman/root.crt | ||
jpa.config.hibernate.hbm2ddl.auto=validate | ||
jpa.config.hibernate.connection.username=candlepin | ||
jpa.config.hibernate.connection.password=password | ||
|
||
org.quartz.jobStore.misfireThreshold=60000 | ||
org.quartz.jobStore.useProperties=false | ||
org.quartz.jobStore.dataSource=myDS | ||
org.quartz.jobStore.tablePrefix=QRTZ_ | ||
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX | ||
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate | ||
|
||
org.quartz.dataSource.myDS.driver=org.postgresql.Driver | ||
org.quartz.dataSource.myDS.URL=jdbc:postgresql://host.example.com:5432/candlepin1db?ssl=true&sslrootcert=/usr/share/foreman/root.crt | ||
org.quartz.dataSource.myDS.user=candlepin | ||
org.quartz.dataSource.myDS.password=password | ||
org.quartz.dataSource.myDS.maxConnections=5 |
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,44 @@ | ||
### File managed with puppet ### | ||
## Module: 'candlepin' | ||
|
||
candlepin.consumer_system_name_pattern=.+ | ||
candlepin.environment_content_filtering=true | ||
candlepin.auth.basic.enable=false | ||
candlepin.auth.trusted.enable=false | ||
|
||
candlepin.audit.hornetq.config_path=/etc/candlepin/broker.xml | ||
|
||
candlepin.auth.oauth.enable=true | ||
candlepin.auth.oauth.consumer.katello.secret=abcdabcd | ||
|
||
module.config.adapter_module=org.candlepin.katello.KatelloModule | ||
|
||
candlepin.ca_key=/etc/candlepin/certs/candlepin-ca.key | ||
candlepin.ca_cert=/etc/candlepin/certs/candlepin-ca.crt | ||
|
||
candlepin.async.jobs.ExpiredPoolsCleanupJob.schedule=0 0 0 * * ? | ||
|
||
# Required for https://hibernate.atlassian.net/browse/HHH-12927 | ||
log4j.logger.org.hibernate.internal.SessionImpl=ERROR | ||
|
||
# uncomment to enable debug logging in candlepin.log: | ||
#log4j.logger.org.candlepin=DEBUG | ||
jpa.config.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect | ||
jpa.config.hibernate.connection.driver_class=org.postgresql.Driver | ||
jpa.config.hibernate.connection.url=jdbc:postgresql://localhost:5432/candlepin | ||
jpa.config.hibernate.hbm2ddl.auto=validate | ||
jpa.config.hibernate.connection.username=candlepin | ||
jpa.config.hibernate.connection.password=password | ||
|
||
org.quartz.jobStore.misfireThreshold=60000 | ||
org.quartz.jobStore.useProperties=false | ||
org.quartz.jobStore.dataSource=myDS | ||
org.quartz.jobStore.tablePrefix=QRTZ_ | ||
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX | ||
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate | ||
|
||
org.quartz.dataSource.myDS.driver=org.postgresql.Driver | ||
org.quartz.dataSource.myDS.URL=jdbc:postgresql://localhost:5432/candlepin | ||
org.quartz.dataSource.myDS.user=candlepin | ||
org.quartz.dataSource.myDS.password=password | ||
org.quartz.dataSource.myDS.maxConnections=5 |