2 # Copyright (C) 2013 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
18 # Unit tests for neutron::services::fwaas class
23 describe 'neutron::services::fwaas' do
25 "class { 'neutron': rabbit_password => 'passw0rd' }"
32 let :default_params do
33 { :driver => 'neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver',
35 :vpnaas_agent_package => false }
38 shared_examples_for 'neutron fwaas service plugin' do
40 default_params.merge(params)
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')
49 context 'on Debian platforms' do
51 { :osfamily => 'Debian' }
54 let :platform_params do
55 { :l3_agent_package => 'neutron-l3-agent',
56 :vpnaas_agent_package => 'neutron-vpn-agent'}
59 it_configures 'neutron fwaas service plugin'
61 it 'installs neutron l3 agent package' do
62 should contain_package('neutron-l3-agent').with_ensure('present')
66 context 'on Debian platforms with VPNaaS' do
68 { :osfamily => 'Debian' }
71 let :platform_params do
72 { :l3_agent_package => 'neutron-l3-agent',
73 :vpnaas_agent_package => 'neutron-vpn-agent' }
77 { :vpnaas_agent_package => true }
80 it_configures 'neutron fwaas service plugin'
82 it 'installs neutron vpnaas agent package' do
83 should contain_package('neutron-vpn-agent').with_ensure('present')
87 context 'on Red Hat platforms' do
89 { :osfamily => 'RedHat' }
92 let :platform_params do
93 { :package_name => 'openstack-neutron' }
96 it_configures 'neutron fwaas service plugin'