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 nova::migration::libvirt class
23 describe 'nova::migration::libvirt' do
29 include nova::compute::libvirt'
32 shared_examples_for 'nova migration with libvirt' do
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"')
42 context 'on Debian platforms' do
44 { :osfamily => 'Debian' }
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"') }
51 context 'on RedHat platforms' do
53 { :osfamily => 'RedHat' }
56 it_configures 'nova migration with libvirt'
57 it { should contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') }