Skip to content

Commit

Permalink
Merge pull request #116 from bodepd/network_project
Browse files Browse the repository at this point in the history
Project should be set
  • Loading branch information
branan committed May 25, 2012
2 parents 65c0609 + 6200922 commit e0bddbb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/manage/network.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ensure => present,
network => $network,
num_networks => $num_networks,
project => undef,
project => $project,
notify => Exec['nova-db-sync'],
}

Expand Down
56 changes: 56 additions & 0 deletions spec/defines/nova_manage_networks.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
require 'spec_helper'

describe 'nova::manage::network' do

let :facts do
{: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 { should contain_nova_network('foo').with(
:ensure => 'present',
:network => '10.0.0.0/24',
:num_networks => 1,
:project => nil,
:notify => 'Exec[nova-db-sync]'
) }
end
describe 'when overriding num networks' do
let :params do
{
:network => '10.0.0.0/20',
:num_networks => 2
}
end
it { should 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 { should contain_nova_network('foo').with(
:network => '10.0.0.0/20',
:project => 'foo'
) }
end
end

0 comments on commit e0bddbb

Please sign in to comment.