]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/spec/classes/nova_migration_libvirt_spec.rb
9cedb5c018afdc59a859d640cc4255c7a4f2fc4a
[dsa-puppet.git] / 3rdparty / modules / nova / spec / classes / nova_migration_libvirt_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 nova::migration::libvirt class
19 #
20
21 require 'spec_helper'
22
23 describe 'nova::migration::libvirt' do
24
25
26   let :pre_condition do
27    'include nova
28     include nova::compute
29     include nova::compute::libvirt'
30   end
31
32   shared_examples_for 'nova migration with libvirt' do
33
34     it 'configure libvirtd.conf' do
35       should contain_file_line('/etc/libvirt/libvirtd.conf listen_tls').with(:line => 'listen_tls = 0')
36       should contain_file_line('/etc/libvirt/libvirtd.conf listen_tcp').with(:line => 'listen_tcp = 1')
37       should contain_file_line('/etc/libvirt/libvirtd.conf auth_tcp').with(:line => 'auth_tcp = "none"')
38     end
39
40   end
41
42   context 'on Debian platforms' do
43     let :facts do
44       { :osfamily => 'Debian' }
45     end
46
47     it_configures 'nova migration with libvirt'
48     it { should contain_file_line('/etc/default/libvirt-bin libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
49   end
50
51   context 'on RedHat platforms' do
52     let :facts do
53       { :osfamily => 'RedHat' }
54     end
55
56     it_configures 'nova migration with libvirt'
57     it { should contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') }
58   end
59
60 end