[all.xml]
bears = XMLBear
files = **.xml
+enabled = False
--- /dev/null
+<itm-config xmlns="urn:opendaylight:genius:itm:config">
+ <gpe-extension-enabled>true</gpe-extension-enabled>
+</itm-config>
--- /dev/null
+<elanmanager-config xmlns="urn:opendaylight:netvirt:elan:config">
+ <use-of-tunnels>true</use-of-tunnels>
+</elanmanager-config>
}
}
- # Configure ACL security group
- # Requires at least CentOS 7.3 for RHEL/CentOS systems
- if ('odl-netvirt-openstack' in $opendaylight::features) {
+ if ('odl-netvirt-openstack' in $opendaylight::features or 'odl-netvirt-sfc' in $opendaylight::features) {
+ # Configure ACL security group
+ # Requires at least CentOS 7.3 for RHEL/CentOS systems
if $opendaylight::security_group_mode == 'stateful' {
if defined('$opendaylight::stateful_unsupported') and $opendaylight::stateful_unsupported {
warning("Stateful is unsupported in ${::operatingsystemrelease} setting to 'learn'")
group => 'odl',
content => template('opendaylight/netvirt-aclservice-config.xml.erb'),
}
- }
- # Configure SNAT
- if ('odl-netvirt-openstack' in $opendaylight::features) {
+ # Configure SNAT
file { 'netvirt-natservice-config.xml':
ensure => file,
path => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml',
}
}
+ # SFC Config
+ if ('odl-netvirt-sfc' in $opendaylight::features) {
+ file { 'netvirt-elanmanager-config.xml':
+ ensure => file,
+ path => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-elanmanager-config.xml',
+ owner => 'odl',
+ group => 'odl',
+ source => 'puppet:///modules/opendaylight/netvirt-elanmanager-config.xml',
+ require => File['/opt/opendaylight/etc/opendaylight/datastore/initial/config'],
+ }
+
+ file { 'genius-itm-config.xml':
+ ensure => file,
+ path => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
+ owner => 'odl',
+ group => 'odl',
+ source => 'puppet:///modules/opendaylight/genius-itm-config.xml',
+ require => File['/opt/opendaylight/etc/opendaylight/datastore/initial/config'],
+ }
+ }
+
#configure VPP routing node
if ! empty($::opendaylight::vpp_routing_node) {
file { 'org.opendaylight.groupbasedpolicy.neutron.vpp.mapper.startup.cfg':
snat_mechanism_validations(snat_mechanism: 'conntrack')
end
end
+
+ describe 'testing configuring SFC' do
+ context 'using SFC feature' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl(extra_features: ['odl-netvirt-sfc'])
+
+ # Call specialized helper fn for SFC config validations
+ sfc_validations
+ end
+ end
end
end
end
+ # SFC tests
+ describe 'SFC tests' do
+ # Non-OS-type tests assume CentO
+ # See issue #43 for reasoning:
+ # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
+ osfamily = 'RedHat'
+ operatingsystem = 'CentOS'
+ operatingsystemmajrelease = '7'
+ context 'using odl-netvirt-sfc feature' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{
+ :extra_features => ['odl-netvirt-sfc'],
+ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test that specialize in checking security groups
+ # Note that this function is defined in spec_helper
+ sfc_tests
+ end
+ end
+
# VPP routing node config tests
describe 'VPP routing node tests' do
# Non-OS-type tests assume CentOS 7
username_password_tests('test', 'test')
end
end
-end
\ No newline at end of file
+end
}
end
+# Shared tests that specialize in testing SFC Config
+def sfc_tests()
+ it { should contain_file('/opt/opendaylight/etc/opendaylight') }
+ it { should contain_file('/opt/opendaylight/etc/opendaylight/datastore')}
+ it { should contain_file('/opt/opendaylight/etc/opendaylight/datastore/initial')}
+ it { should contain_file('/opt/opendaylight/etc/opendaylight/datastore/initial/config')}
+
+ it {
+ should contain_file('netvirt-elanmanager-config.xml').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-elanmanager-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'source' => 'puppet:///modules/opendaylight/netvirt-elanmanager-config.xml'
+ )
+ should contain_file('genius-itm-config.xml').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'source' => 'puppet:///modules/opendaylight/genius-itm-config.xml'
+ )
+ }
+end
+
# Shared tests that specialize in testing VPP routing node config
def vpp_routing_node_tests(options = {})
# Extract params
its(:content) { should match /<nat-mode>#{snat_mechanism}<\/nat-mode>/ }
end
end
+
+# Shared function for validations related to SFC
+def sfc_validations()
+ # NB: This param default should match the one used by the opendaylight
+ # class, which is defined in opendaylight::params
+ # TODO: Remove this possible source of bugs^^
+
+ describe file('/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-elanmanager-config.xml') do
+ it { should be_file }
+ it { should be_owned_by 'odl' }
+ it { should be_grouped_into 'odl' }
+ its(:content) { should match /<use-of-tunnels>true<\/use-of-tunnels>/ }
+ end
+
+ describe file('/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml') do
+ it { should be_file }
+ it { should be_owned_by 'odl' }
+ it { should be_grouped_into 'odl' }
+ its(:content) { should match /<gpe-extension-enabled>true<\/gpe-extension-enabled>/ }
+ end
+end