3 describe 'neutron::agents::n1kv_vem' do
6 { :osfamily => 'RedHat' }
9 it 'should have a n1kv-vem config file' do
10 should contain_file('/etc/n1kv/n1kv.conf').with(
18 it 'install n1kv-vem' do
19 should contain_package('libnl').with_before('Package[nexus1000v]')
20 should contain_service('openvswitch').with_notify('Package[nexus1000v]')
21 should contain_package('nexus1000v').with_notify('Service[nexus1000v]')
22 should contain_service('nexus1000v').with_ensure('running')
25 context 'with local file vem rpm' do
28 :n1kv_source => 'vem.rpm'
32 it 'verify dependency' do
33 should contain_package('nexus1000v').with_source('/var/n1kv/vem.rpm')
34 should contain_file('/var/n1kv/vem.rpm').that_requires('File[/var/n1kv]')
35 should contain_file('/var/n1kv/vem.rpm').with(
43 context 'remote vem rpm' do
46 :n1kv_source => 'http://www.cisco.com/repo'
50 it 'verify dependency' do
51 should contain_package('nexus1000v').without_source
52 should contain_yumrepo('cisco-vem-repo').with(
53 :baseurl => 'http://www.cisco.com/repo',
59 it 'execute reread config upon config change' do
60 should contain_exec('vemcmd reread config') \
61 .that_subscribes_to('File[/etc/n1kv/n1kv.conf]')
64 context 'verify n1kv.conf default' do
67 :n1kv_vsm_ip => '9.0.0.1',
68 :n1kv_vsm_domain_id => 900,
69 :host_mgmt_intf => 'eth9',
71 :fastpath_flood => 'disable'
75 should contain_file('/etc/n1kv/n1kv.conf') \
76 .with_content(/^l3control-ipaddr 9.0.0.1/)
77 should contain_file('/etc/n1kv/n1kv.conf') \
78 .with_content(/^switch-domain 900/)
79 should contain_file('/etc/n1kv/n1kv.conf') \
80 .with_content(/^host-mgmt-intf eth9/)
81 should contain_file('/etc/n1kv/n1kv.conf') \
82 .with_content(/^portdb ovs/)
83 should contain_file('/etc/n1kv/n1kv.conf') \
84 .without_content(/^phys/)
85 should contain_file('/etc/n1kv/n1kv.conf') \
86 .without_content(/^virt/)
87 should contain_file('/etc/n1kv/n1kv.conf') \
88 .with_content(/^node-type compute/)
89 should contain_file('/etc/n1kv/n1kv.conf') \
90 .with_content(/^fastpath-flood disable/)
94 context 'verify node_type' do
97 :node_type => 'network',
101 should contain_file('/etc/n1kv/n1kv.conf') \
102 .with_content(/^node-type network/)
103 should contain_file('/etc/n1kv/n1kv.conf') \
104 .without_content(/^node-type compute/)
108 context 'verify portdb' do
115 should contain_file('/etc/n1kv/n1kv.conf') \
116 .with_content(/^portdb vem/)
117 should contain_file('/etc/n1kv/n1kv.conf') \
118 .without_content(/^portdb ovs/)
122 context 'verify fastpath_flood' do
125 :fastpath_flood => 'enable',
129 should contain_file('/etc/n1kv/n1kv.conf') \
130 .with_content(/^fastpath-flood enable/)
131 should contain_file('/etc/n1kv/n1kv.conf') \
132 .without_content(/^fastpath-flood disable/)
136 context 'verify n1kv.conf with uplinks' do
139 :uplink_profile => { 'eth1' => 'prof1',
145 should contain_file('/etc/n1kv/n1kv.conf') \
146 .with_content(/^phys eth1 profile prof1/)
147 should contain_file('/etc/n1kv/n1kv.conf') \
148 .with_content(/^phys eth2 profile prof2/)
153 context 'verify n1kv.conf with vtep info' do
156 :vtep_config => { 'vtep1' => { 'profile' => 'profint',
159 'vtep2' => { 'profile' => 'profint',
160 'ipmode' => 'static',
161 'ipaddress' => '192.168.1.1',
162 'netmask' => '255.255.255.0'
168 should contain_file('/etc/n1kv/n1kv.conf') \
169 .with_content(/^virt vtep1 profile profint mode dhcp/)
170 should contain_file('/etc/n1kv/n1kv.conf') \
171 .with_content(/^virt vtep2 profile profint mode static/)
176 context 'with manage_service as false' do
179 :manage_service => false
182 it 'should not start/stop service' do
183 should contain_service('nexus1000v').without_ensure
187 context 'with manage_service true and enable_service false' do
190 :manage_service => true,
194 it 'should stop service' do
195 should contain_service('nexus1000v').with_ensure('stopped')
199 context 'verify sysctl setting with vteps_in_same_subnet true' do
202 :vteps_in_same_subnet => true
206 should contain_sysctl__value('net.ipv4.conf.default.rp_filter').with_value('2')
207 should contain_sysctl__value('net.ipv4.conf.all.rp_filter').with_value('2')
208 should contain_sysctl__value('net.ipv4.conf.default.arp_ignore').with_value('1')
209 should contain_sysctl__value('net.ipv4.conf.all.arp_ignore').with_value('1')
210 should contain_sysctl__value('net.ipv4.conf.all.arp_announce').with_value('2')
211 should contain_sysctl__value('net.ipv4.conf.default.arp_announce').with_value('2')