2a4e110a7e
Switch Nova to use $::os_service_default Change logging.pp, db.pp and tests. Change-Id: I928a93534c6d27c020b7afb5b7dda32c379e9d62 Related-bug: #1515273
75 lines
1.6 KiB
Ruby
75 lines
1.6 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::manage::network' do
|
|
|
|
let :facts do
|
|
@default_facts.merge({:osfamily => 'RedHat'})
|
|
end
|
|
|
|
let :pre_condition do
|
|
'include nova'
|
|
end
|
|
|
|
let :title do
|
|
'foo'
|
|
end
|
|
|
|
describe 'with only required parameters' do
|
|
let :params do
|
|
{
|
|
:network => '10.0.0.0/24'
|
|
}
|
|
end
|
|
it { is_expected.to contain_nova_network('foo').with(
|
|
:ensure => 'present',
|
|
:network => '10.0.0.0/24',
|
|
:label => 'novanetwork',
|
|
:num_networks => 1,
|
|
:project => nil,
|
|
:allowed_start => nil,
|
|
:allowed_end => nil,
|
|
) }
|
|
end
|
|
describe 'when overriding num networks' do
|
|
let :params do
|
|
{
|
|
:network => '10.0.0.0/20',
|
|
:num_networks => 2
|
|
}
|
|
end
|
|
it { is_expected.to contain_nova_network('foo').with(
|
|
:network => '10.0.0.0/20',
|
|
:num_networks => 2
|
|
) }
|
|
end
|
|
|
|
describe 'when overriding projects' do
|
|
let :params do
|
|
{
|
|
:network => '10.0.0.0/20',
|
|
:project => 'foo'
|
|
}
|
|
end
|
|
it { is_expected.to contain_nova_network('foo').with(
|
|
:network => '10.0.0.0/20',
|
|
:project => 'foo'
|
|
) }
|
|
end
|
|
|
|
describe 'when overriding allowed range' do
|
|
let :params do
|
|
{
|
|
:network => '10.0.0.0/20',
|
|
:allowed_start => '10.0.0.1',
|
|
:allowed_end => '10.0.0.5'
|
|
}
|
|
end
|
|
it { is_expected.to contain_nova_network('foo').with(
|
|
:network => '10.0.0.0/20',
|
|
:allowed_start => '10.0.0.1',
|
|
:allowed_end => '10.0.0.5'
|
|
) }
|
|
end
|
|
|
|
end
|