Skip to content

Commit

Permalink
Add an acceptance test for candlepin
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Mar 24, 2017
1 parent 7988aba commit a8ee582
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---
.travis.yml:
beaker_sets:
- docker/centos-7
Rakefile:
param_docs_pattern:
- manifests/foreman_proxy_content.pp
- manifests/init.pp
spec/spec_helper_acceptance:
modules:
- katello-candlepin
- katello-qpid
- puppetlabs-java_ks
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ matrix:
# Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with.
- rvm: 2.3.0
env: PUPPET_VERSION=4.4 ONLY_OS=redhat-7-x86_64,centos-7-x86_64
# Acceptance tests
- rvm: 2.3.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
script: bundle exec rake beaker
services: docker
bundler_args: --without development
bundler_args: --without system_tests development
sudo: false
71 changes: 71 additions & 0 deletions spec/acceptance/candlepin_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
require 'spec_helper_acceptance'

describe 'Installing candlepin with the right certificates' do
let :pp do
<<-EOS
$repo = 'latest'
$dist = 'el7'
package { 'epel-release':
ensure => installed,
}
yumrepo { 'candlepin':
descr => 'Candlepin: an open source entitlement management system.',
baseurl => "https://fedorapeople.org/groups/katello/releases/yum/${repo}/candlepin/${dist}/\\$basearch/",
gpgkey => 'https://raw.githubusercontent.com/Katello/katello-packaging/master/repos/RPM-GPG-KEY-katello-2015',
gpgcheck => '0',
enabled => '1',
}
yumrepo { 'katello':
descr => 'Katello latest',
baseurl => "https://fedorapeople.org/groups/katello/releases/yum/${repo}/katello/${dist}/\\$basearch/",
gpgkey => 'https://raw.githubusercontent.com/Katello/katello-packaging/master/repos/RPM-GPG-KEY-katello-2015',
gpgcheck => '0',
enabled => '1',
}
class { '::certs': }
class { '::certs::qpid':
require => Class['certs'],
} ->
class { '::qpid':
ssl => true,
ssl_cert_db => $::certs::nss_db_dir,
ssl_cert_password_file => $::certs::qpid::nss_db_password_file,
ssl_cert_name => 'broker',
interface => 'lo',
}
class { '::certs::candlepin':
require => Class['certs'],
} ->
class { '::candlepin':
ca_key => $::certs::ca_key,
ca_cert => $::certs::ca_cert_stripped,
keystore_password => $::certs::candlepin::keystore_password,
truststore_password => $::certs::candlepin::keystore_password,
enable_basic_auth => false,
consumer_system_name_pattern => '.+',
adapter_module => 'org.candlepin.katello.KatelloModule',
amq_enable => true,
amqp_keystore_password => $::certs::candlepin::keystore_password,
amqp_truststore_password => $::certs::candlepin::keystore_password,
amqp_keystore => $::certs::candlepin::amqp_keystore,
amqp_truststore => $::certs::candlepin::amqp_truststore,
}
EOS
end

it_behaves_like 'a idempotent resource'

describe port('8080') do
it { is_expected.to be_listening }
end

describe port('8443') do
it { is_expected.to be_listening }
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Install module and dependencies
puppet_module_install(:source => proj_root, :module_name => 'certs')
hosts.each do |host|
["puppetlabs-stdlib"].each do |mod|
["katello-candlepin", "katello-qpid", "puppetlabs-java_ks"].each do |mod|
on host, puppet('module', 'install', mod), { :acceptable_exit_codes => [0] }
end

Expand Down

0 comments on commit a8ee582

Please sign in to comment.