Add additional order between end of init l23network and start of resource processing

Fuel-CI: disable
Closes-bug: #1446875
Change-Id: Ib3862318db65b296e5b21edb8a6242eac0b0b6e7
This commit is contained in:
Sergey Vasilenko 2015-04-22 00:52:41 +03:00
parent 91ee597bb2
commit 7bdb71f5fc
15 changed files with 52 additions and 35 deletions

View File

@ -49,8 +49,8 @@ class l23network (
mode => '0755',
} -> Anchor['l23network::init']
}
Class['l23network::l2'] -> File<| title == "${::l23network::params::interfaces_dir}" |>
Class['l23network::l2'] -> File<| title == "${::l23network::params::interfaces_file}" |>
Anchor['l23network::l2::init'] -> File<| title == "${::l23network::params::interfaces_dir}" |>
Anchor['l23network::l2::init'] -> File<| title == "${::l23network::params::interfaces_file}" |>
# Centos interface up-n-down scripts
if $::osfamily =~ /(?i)redhat/ {

View File

@ -174,7 +174,7 @@ define l23network::l2::bond (
# this need for creating L2_port resource by ifup, if it allowed by OS
L23_stored_config[$bond] -> L2_bond[$bond]
K_mod<||> -> L2_bond<||>
Anchor['l23network::init'] -> K_mod<||> -> L2_bond<||>
}

View File

@ -59,7 +59,7 @@ define l23network::l2::bridge (
# this need for creating L2_bridge resource by ifup, if it allowed by OS
L23_stored_config[$name] -> L2_bridge[$name]
K_mod<||> -> L2_bridge<||>
Anchor['l23network::init'] -> K_mod<||> -> L2_bridge<||>
}
}

View File

@ -63,7 +63,7 @@ define l23network::l2::patch (
provider => $provider
}
K_mod<||> -> L2_patch<||>
Anchor['l23network::init'] -> K_mod<||> -> L2_patch<||>
}
}
# vim: set ts=2 sw=2 et :

View File

@ -139,7 +139,7 @@ define l23network::l2::port (
# this need for creating L2_port resource by ifup, if it allowed by OS
L23_stored_config[$port_name] -> L2_port[$port_name]
K_mod<||> -> L2_port<||>
Anchor['l23network::init'] -> K_mod<||> -> L2_port<||>
}
}
# vim: set ts=2 sw=2 et :

View File

@ -230,5 +230,4 @@ define l23network::l3::ifconfig (
L23_stored_config <| title == $interface |> ->
L3_ifconfig <| title == $interface |>
}
}

View File

@ -30,5 +30,6 @@ define l23network::l3::route (
}
L3_ifconfig<||> -> L3_route<||>
}
Anchor['l23network::init'] -> L3_route<||>
}

View File

@ -46,7 +46,7 @@ end
} end
it do
should compile
should compile.with_all_deps
end
it do

View File

@ -21,6 +21,10 @@ describe 'l23network', :type => :class do
should contain_package('ethtool').with_ensure('present')
should contain_package('ifenslave').with_ensure('present')
should contain_package('vlan').with_ensure('present')
should contain_anchor('l23network::l2::init').that_comes_before('Anchor[l23network::init]')
should contain_anchor('l23network::l2::init').that_requires('Package[vlan]')
should contain_anchor('l23network::l2::init').that_requires('Package[ifenslave]')
should contain_anchor('l23network::l2::init').that_requires('Package[ethtool]')
end
end
@ -57,7 +61,7 @@ describe 'l23network', :type => :class do
'ensure' => 'running',
'name' => 'openvswitch-switch',
'enable' => true
})
}).that_comes_before('Anchor[l23network::l2::init]')
end
end

View File

@ -14,6 +14,10 @@ describe 'l23network::l3::ifconfig', :type => :define do
:ipaddr => 'dhcp'
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
it do
should compile
end

View File

@ -14,6 +14,10 @@ describe 'l23network::l3::ifconfig', :type => :define do
:ipaddr => 'none'
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
it do
should compile
end

View File

@ -9,6 +9,10 @@ describe 'l23network::l2::bond', :type => :define do
:l23_os => 'ubuntu',
:l3_fqdn_hostname => 'stupid_hostname',
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
context 'Just create a lnx-bond with two slave interfaces' do
let(:params) do
@ -21,7 +25,7 @@ describe 'l23network::l2::bond', :type => :define do
end
it do
should compile
should compile.with_all_deps
end
it do

View File

@ -9,6 +9,10 @@ describe 'l23network::l2::bridge', :type => :define do
:l23_os => 'ubuntu',
:l3_fqdn_hostname => 'stupid_hostname',
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
context 'Just a bridge, created by name' do
let(:params) do
@ -32,9 +36,8 @@ describe 'l23network::l2::bridge', :type => :define do
end
it do
should contain_l2_bridge('br-mgmt').only_with({
should contain_l2_bridge('br-mgmt').with({
'ensure' => 'present',
'use_ovs' => nil,
'external_ids' => {'bridge-id'=>'br-mgmt'},
}).that_requires('L23_stored_config[br-mgmt]')
end
@ -77,7 +80,7 @@ describe 'l23network::l2::bridge', :type => :define do
end
it do
should compile
should compile.with_all_deps
end
it do

View File

@ -9,6 +9,10 @@ describe 'l23network::l2::patch', :type => :define do
:l23_os => 'ubuntu',
:l3_fqdn_hostname => 'stupid_hostname',
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
context 'Just a patch between two bridges' do
let(:params) do
@ -18,7 +22,7 @@ describe 'l23network::l2::patch', :type => :define do
end
it do
should compile
should compile.with_all_deps
end
it do
@ -34,9 +38,8 @@ describe 'l23network::l2::patch', :type => :define do
end
it do
should contain_l2_patch('patch__br1--br2').only_with({
should contain_l2_patch('patch__br1--br2').with({
'ensure' => 'present',
'use_ovs' => nil,
'bridges' => ['br1', 'br2'],
}).that_requires('L23_stored_config[p_br1-0]')
end

View File

@ -9,6 +9,10 @@ describe 'l23network::l2::port', :type => :define do
:l23_os => 'ubuntu',
:l3_fqdn_hostname => 'stupid_hostname',
} }
let(:pre_condition) { [
"class {'l23network': }"
] }
context 'Port without anythyng' do
let(:params) do
@ -18,7 +22,7 @@ describe 'l23network::l2::port', :type => :define do
end
it do
should compile
should compile.with_all_deps
end
it do
@ -31,9 +35,8 @@ describe 'l23network::l2::port', :type => :define do
end
it do
should contain_l2_port('eth4').only_with({
should contain_l2_port('eth4').with({
'ensure' => 'present',
'use_ovs' => nil,
}).that_requires('L23_stored_config[eth4]')
end
end
@ -62,9 +65,8 @@ describe 'l23network::l2::port', :type => :define do
end
it do
should contain_l2_port('eth4.102').only_with({
should contain_l2_port('eth4.102').with({
'ensure' => 'present',
'use_ovs' => nil,
'vlan_id' => '102',
'vlan_dev' => 'eth4',
'vlan_mode' => 'eth'
@ -98,9 +100,8 @@ describe 'l23network::l2::port', :type => :define do
end
it do
should contain_l2_port('vlan102').only_with({
should contain_l2_port('vlan102').with({
'ensure' => 'present',
'use_ovs' => nil,
'vlan_id' => '102',
'vlan_dev' => 'eth4',
'vlan_mode' => 'vlan'
@ -137,17 +138,15 @@ describe 'l23network::l2::port', :type => :define do
it do
should compile
should contain_l23_stored_config('eth2').only_with({
'use_ovs' => nil,
should contain_l23_stored_config('eth2').with({
'method' => nil,
'ipaddr' => nil,
'gateway' => nil,
'mtu' => 9000,
})
should contain_l2_port('eth2').only_with({
should contain_l2_port('eth2').with({
'ensure' => 'present',
'mtu' => 9000,
'use_ovs' => nil,
}).that_requires('L23_stored_config[eth2]')
end
end
@ -162,16 +161,14 @@ describe 'l23network::l2::port', :type => :define do
it do
should compile
should contain_l23_stored_config('eth2').only_with({
'use_ovs' => nil,
should contain_l23_stored_config('eth2').with({
'method' => nil,
'ipaddr' => nil,
'gateway' => nil,
'bridge' => 'br-floating',
})
should contain_l2_port('eth2').only_with({
should contain_l2_port('eth2').with({
'ensure' => 'present',
'use_ovs' => nil,
'bridge' => 'br-floating',
}).that_requires('L23_stored_config[eth2]')
end
@ -193,8 +190,7 @@ describe 'l23network::l2::port', :type => :define do
it do
should compile
should contain_l23_stored_config('eth2').only_with({
'use_ovs' => nil,
should contain_l23_stored_config('eth2').with({
'method' => nil,
'ipaddr' => nil,
'gateway' => nil,
@ -206,9 +202,8 @@ describe 'l23network::l2::port', :type => :define do
},
},
})
should contain_l2_port('eth2').only_with({
should contain_l2_port('eth2').with({
'ensure' => 'present',
'use_ovs' => nil,
'vendor_specific' => {
'aaa' => '1111',
'bbb' => {