memcached (openstack) is no longer in use
[mirror/dsa-puppet.git] / 3rdparty / modules / neutron / spec / classes / neutron_services_fwaas_spec.rb
1 #
2 # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
3 #
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
5 #
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
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
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
16 # under the License.
17 #
18 # Unit tests for neutron::services::fwaas class
19 #
20
21 require 'spec_helper'
22
23 describe 'neutron::services::fwaas' do
24   let :pre_condition do
25     "class { 'neutron': rabbit_password => 'passw0rd' }"
26   end
27
28   let :params do
29     {}
30   end
31
32   let :default_params do
33     { :driver               => 'neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver',
34       :enabled              => true,
35       :vpnaas_agent_package => false }
36   end
37
38   shared_examples_for 'neutron fwaas service plugin' do
39     let :params_hash do
40       default_params.merge(params)
41     end
42
43     it 'configures driver in fwaas_driver.ini' do
44       should contain_neutron_fwaas_service_config('fwaas/driver').with_value('neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver')
45       should contain_neutron_fwaas_service_config('fwaas/enabled').with_value('true')
46     end
47   end
48
49   context 'on Debian platforms' do
50     let :facts do
51       { :osfamily => 'Debian' }
52     end
53
54     let :platform_params do
55       { :l3_agent_package     => 'neutron-l3-agent',
56         :vpnaas_agent_package => 'neutron-vpn-agent'}
57     end
58
59     it_configures 'neutron fwaas service plugin'
60
61     it 'installs neutron l3 agent package' do
62       should contain_package('neutron-l3-agent').with_ensure('present')
63     end
64   end
65
66   context 'on Debian platforms with VPNaaS' do
67     let :facts do
68       { :osfamily => 'Debian' }
69     end
70
71     let :platform_params do
72       { :l3_agent_package     => 'neutron-l3-agent',
73         :vpnaas_agent_package => 'neutron-vpn-agent' }
74     end
75
76     let :params do
77       { :vpnaas_agent_package => true }
78     end
79
80     it_configures 'neutron fwaas service plugin'
81
82     it 'installs neutron vpnaas agent package' do
83       should contain_package('neutron-vpn-agent').with_ensure('present')
84     end
85   end
86
87   context 'on Red Hat platforms' do
88     let :facts do
89       { :osfamily => 'RedHat' }
90     end
91
92     let :platform_params do
93       { :package_name => 'openstack-neutron' }
94     end
95
96     it_configures 'neutron fwaas service plugin'
97
98   end
99
100 end