summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColleen Murphy <colleen.murphy@suse.de>2018-07-24 13:13:47 +0200
committerColleen Murphy <colleen.murphy@suse.de>2018-08-13 17:35:37 +0200
commit3baf809e4e061ebe6c3f2dad4422e74e7b656ffe (patch)
tree7575959a34dedf9840872cce929d4bc5cab191c8
parentbc771d07c8010d5b7c8ed5ad954bc3467f5a7f78 (diff)
Add test for ethercalc::apache
Add the ethercalc::apache class to the test fixture and ensure the service is accessible over port 80. This also corrects a minor idempotency issue in this class due to the way the ssl-cert package and the /etc/ssl/private file resources were ordered. Change-Id: I4cdba5b1881c3e9891ca9f8c2c4dd50ca5662d4e
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Ian Wienand <iwienand@redhat.com> Workflow+1: Ian Wienand <iwienand@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 13 Aug 2018 22:56:20 +0000 Reviewed-on: https://review.openstack.org/585294 Project: openstack-infra/puppet-ethercalc Branch: refs/heads/master
-rw-r--r--manifests/apache.pp7
-rw-r--r--spec/acceptance/ethercalc_spec.rb4
-rw-r--r--spec/acceptance/fixtures/ethercalc.pp6
3 files changed, 14 insertions, 3 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp
index 758d836..5df8fe1 100644
--- a/manifests/apache.pp
+++ b/manifests/apache.pp
@@ -152,9 +152,10 @@ class ethercalc::apache (
152 } 152 }
153 153
154 file { '/etc/ssl/private': 154 file { '/etc/ssl/private':
155 ensure => directory, 155 ensure => directory,
156 owner => 'root', 156 owner => 'root',
157 mode => '0700', 157 mode => '0700',
158 require => Package['ssl-cert'],
158 } 159 }
159 160
160 if $ssl_cert_file_contents != '' { 161 if $ssl_cert_file_contents != '' {
diff --git a/spec/acceptance/ethercalc_spec.rb b/spec/acceptance/ethercalc_spec.rb
index aede7d0..e45bad3 100644
--- a/spec/acceptance/ethercalc_spec.rb
+++ b/spec/acceptance/ethercalc_spec.rb
@@ -49,6 +49,10 @@ describe 'puppet-ethercalc:: manifest', :if => ['debian', 'ubuntu'].include?(os[
49 describe command('curl http://localhost:8000 --verbose') do 49 describe command('curl http://localhost:8000 --verbose') do
50 its(:stdout) { should contain('EtherCalc - Share the URL to your friends') } 50 its(:stdout) { should contain('EtherCalc - Share the URL to your friends') }
51 end 51 end
52
53 describe command('curl -L -k http://localhost --verbose') do
54 its(:stdout) { should contain('EtherCalc - Share the URL to your friends') }
55 end
52 end 56 end
53 end 57 end
54 58
diff --git a/spec/acceptance/fixtures/ethercalc.pp b/spec/acceptance/fixtures/ethercalc.pp
index d721bd3..c86350c 100644
--- a/spec/acceptance/fixtures/ethercalc.pp
+++ b/spec/acceptance/fixtures/ethercalc.pp
@@ -3,3 +3,9 @@ $source_dir = '/opt/openstack-health'
3include ethercalc::redis 3include ethercalc::redis
4 4
5class { '::ethercalc': } 5class { '::ethercalc': }
6
7class { '::ethercalc::apache':
8 ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
9 ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key',
10 vhost_name => 'localhost',
11}