Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure acceptance tests on docker on travis #885

Merged
merged 4 commits into from
Sep 29, 2016
Merged
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
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
.travis.yml:
secure: "SDpX6jzritODonEQBqy9g0NbOmk2a9dBfAtZLrvHwM8BTpM2W0Y1daqzIbpzxFiqlNX+6r2GSq9SV70N0A9Ko/uPV9aG/XZx7MsBR9DNVjgqjJSl7+aF88VJfRpOv4PAyTM33JMx91nLFxM/ql61YX+2DXGXrhUkBsMZcdBgQnk="
docker_sets:
- set: docker/ubuntu-14.04
- set: docker/centos-7
4 changes: 2 additions & 2 deletions spec/acceptance/nginx_mail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class { 'nginx':
listen_port => 587,
ssl => true,
ssl_port => 465,
ssl_cert => '/tmp/blah.cert',
ssl_key => '/tmp/blah.key',
ssl_cert => '/etc/pki/tls/certs/blah.cert',
ssl_key => '/etc/pki/tls/private/blah.key',
xclient => 'off',
}
"
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nginx_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class { 'nginx': }
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
ssl => true,
ssl_cert => '/tmp/blah.cert',
ssl_key => '/tmp/blah.key',
ssl_cert => '/etc/pki/tls/certs/blah.cert',
ssl_key => '/etc/pki/tls/private/blah.key',
www_root => '/var/www/www.puppetlabs.com',
}
host { 'www.puppetlabs.com': ip => '127.0.0.1', }
Expand Down
14 changes: 12 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'beaker-rspec'
require 'pry'
require 'beaker/puppet_install_helper'

install_puppet_on(hosts)
run_puppet_install_helper

RSpec.configure do |c|
# Project root
Expand Down Expand Up @@ -59,6 +59,16 @@
aIZ8kxsBjLvpi9KQTHi7Wl6Sw3ecoYdKy+2P8S5xOIpWjs8XVmOWf7Tq1+9KPv3z
HLw/FDCzntkdq3G4em15CdFlO9BTY4HXiHU=
-----END CERTIFICATE-----" > /tmp/blah.cert'

#--- START SELINUX WORKAROUND ---
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about just dropping the certs into /etc in the first place, and then just using /etc/blah.{crt,key} as the path? Then we don't have to use this whole workaround at all, assuming selinux allows those files to be in /etc
Or symlink /etc/pki to /etc/ssl early in the process for Debian?

I also see some discussion about disabling SELinux with Beaker here: https://bugzilla.redhat.com/show_bug.cgi?id=1074384

Copy link
Member

Choose a reason for hiding this comment

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

Confusingly, that is a different Beaker testing project, run by RedHat 😄 https://beaker-project.org/

if fact('osfamily') == 'Debian'
on host, 'mkdir -p /etc/pki/tls/certs'
on host, 'mkdir -p /etc/pki/tls/private'
end

# put the keys in a directory with the correct SELinux context
on host, 'cp /tmp/blah.cert /etc/pki/tls/certs/blah.cert'
on host, 'cp /tmp/blah.key /etc/pki/tls/private/blah.key'
end
end
end