2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
20 describe 'openstacklib::wsgi::apache' do
22 let (:title) { 'keystone_wsgi' }
26 :processorcount => 42,
27 :concat_basedir => '/var/lib/puppet/concat',
28 :fqdn => 'some.host.tld'
38 :wsgi_script_dir => '/var/www/cgi-bin/keystone',
39 :wsgi_script_file => 'main',
40 :wsgi_script_source => '/usr/share/keystone/keystone.wsgi'
44 shared_examples_for 'apache serving a service with mod_wsgi' do
45 it { is_expected.to contain_service('httpd').with_name(platform_parameters[:httpd_service_name]) }
46 it { is_expected.to contain_class('apache') }
47 it { is_expected.to contain_class('apache::mod::wsgi') }
49 describe 'with default parameters' do
51 it { is_expected.to contain_file('/var/www/cgi-bin/keystone').with(
52 'ensure' => 'directory',
53 'owner' => 'keystone',
54 'group' => 'keystone',
55 'require' => 'Package[httpd]'
58 it { is_expected.to contain_file('keystone_wsgi').with(
60 'path' => '/var/www/cgi-bin/keystone/main',
61 'source' => '/usr/share/keystone/keystone.wsgi',
62 'owner' => 'keystone',
63 'group' => 'keystone',
67 it { is_expected.to contain_apache__vhost('keystone_wsgi').with(
68 'servername' => 'some.host.tld',
71 'docroot' => '/var/www/cgi-bin/keystone',
72 'docroot_owner' => 'keystone',
73 'docroot_group' => 'keystone',
75 'wsgi_daemon_process' => 'keystone_wsgi',
76 'wsgi_process_group' => 'keystone_wsgi',
77 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },
78 'wsgi_daemon_process_options' => {
80 'group' => 'keystone',
82 'threads' => global_facts[:processorcount],
84 'require' => 'File[keystone_wsgi]'
86 it { is_expected.to contain_file("#{platform_parameters[:httpd_ports_file]}") }
91 context 'on RedHat platforms' do
94 :osfamily => 'RedHat',
95 :operatingsystemrelease => '7.0'
99 let :platform_parameters do
101 :httpd_service_name => 'httpd',
102 :httpd_ports_file => '/etc/httpd/conf/ports.conf',
106 it_configures 'apache serving a service with mod_wsgi'
109 context 'on Debian platforms' do
112 :osfamily => 'Debian',
113 :operatingsystem => 'Debian',
114 :operatingsystemrelease => '7.0'
118 let :platform_parameters do
120 :httpd_service_name => 'apache2',
121 :httpd_ports_file => '/etc/apache2/ports.conf',
125 it_configures 'apache serving a service with mod_wsgi'