Browse Source

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
Colleen Murphy 9 months ago
parent
commit
3baf809e4e
3 changed files with 14 additions and 3 deletions
  1. 4
    3
      manifests/apache.pp
  2. 4
    0
      spec/acceptance/ethercalc_spec.rb
  3. 6
    0
      spec/acceptance/fixtures/ethercalc.pp

+ 4
- 3
manifests/apache.pp View File

@@ -152,9 +152,10 @@ class ethercalc::apache (
152 152
   }
153 153
 
154 154
   file { '/etc/ssl/private':
155
-    ensure => directory,
156
-    owner  => 'root',
157
-    mode   => '0700',
155
+    ensure  => directory,
156
+    owner   => 'root',
157
+    mode    => '0700',
158
+    require => Package['ssl-cert'],
158 159
   }
159 160
 
160 161
   if $ssl_cert_file_contents != '' {

+ 4
- 0
spec/acceptance/ethercalc_spec.rb View File

@@ -49,6 +49,10 @@ describe 'puppet-ethercalc:: manifest', :if => ['debian', 'ubuntu'].include?(os[
49 49
       describe command('curl http://localhost:8000 --verbose') do
50 50
         its(:stdout) { should contain('EtherCalc - Share the URL to your friends') }
51 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 56
     end
53 57
   end
54 58
 

+ 6
- 0
spec/acceptance/fixtures/ethercalc.pp View File

@@ -3,3 +3,9 @@ $source_dir = '/opt/openstack-health'
3 3
 include ethercalc::redis
4 4
 
5 5
 class { '::ethercalc': }
6
+
7
+class { '::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
+}

Loading…
Cancel
Save