diff --git a/README.md b/README.md index 5ac2ded7f..93633b95b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ scenario](#all-in-one). | watcher | | | | X | | | bgpvpn-api | | | | X | | | redis | X | | | | | +| l2gw | | | | X | | When the Jenkins slave is created, the *run_tests.sh* script will be executed. This script will execute *install_modules.sh* that prepare /etc/puppet/modules diff --git a/fixtures/scenario004.pp b/fixtures/scenario004.pp index cf4b879dc..071fdbb7a 100644 --- a/fixtures/scenario004.pp +++ b/fixtures/scenario004.pp @@ -48,7 +48,8 @@ class { '::openstack_integration::glance': backend => 'swift', } class { '::openstack_integration::neutron': - bgpvpn_enabled => $bgpvpn_enabled + bgpvpn_enabled => $bgpvpn_enabled, + l2gw_enabled => true, } class { '::openstack_integration::nova': libvirt_rbd => true, @@ -67,6 +68,8 @@ include ::openstack_integration::provision # Don't test swift, radosgw won't pass the current tests # Glance, nova, neutron are true by default. class { '::openstack_integration::tempest': - watcher => $watcher_enabled, - bgpvpn => $bgpvpn_enabled, + watcher => $watcher_enabled, + bgpvpn => $bgpvpn_enabled, + l2gw => true, + l2gw_switch => 'cell08-5930-01::FortyGigE1/0/1|100', } diff --git a/manifests/neutron.pp b/manifests/neutron.pp index f732dfc78..2b62e2797 100644 --- a/manifests/neutron.pp +++ b/manifests/neutron.pp @@ -10,9 +10,14 @@ # API extensions. # Defaults to false. # +# [*l2gw_enabled*] +# (optional) Flag to enable L2GW. +# Defaults to false. +# class openstack_integration::neutron ( $driver = 'openvswitch', $bgpvpn_enabled = false, + $l2gw_enabled = false, ) { include ::openstack_integration::config @@ -104,10 +109,28 @@ class openstack_integration::neutron ( admin_url => "${::openstack_integration::config::base_url}:9696", password => 'a_big_secret', } - $plugins_list = $bgpvpn_enabled ? { - true => ['router', 'metering', 'firewall', 'lbaasv2', 'bgpvpn'], - default => ['router', 'metering', 'firewall', 'lbaasv2'], + $bgpvpn_plugin = $bgpvpn_enabled ? { + true => 'bgpvpn', + default => undef, } + if $l2gw_enabled { + if ($::operatingsystem == 'Ubuntu') { + class {'::neutron::services::l2gw': } + $l2gw_provider = 'L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.L2gwDriver:default' + } + elsif ($::operatingsystem != 'Ubuntu') { + class {'::neutron::services::l2gw': + service_providers => ['L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.L2gwDriver:default'] + } + $l2gw_provider = undef + } + } + $l2gw_plugin = $l2gw_enabled ? { + true => 'networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin', + default => undef, + } + $plugins_list = delete_undef_values(['router', 'metering', 'firewall', 'lbaasv2', $bgpvpn_plugin, $l2gw_plugin]) + class { '::neutron': default_transport_url => os_transport_url({ 'transport' => 'rabbit', @@ -135,14 +158,16 @@ class openstack_integration::neutron ( auth_uri => $::openstack_integration::config::keystone_auth_uri, memcached_servers => $::openstack_integration::config::memcached_servers, } + $providers_list = delete_undef_values(['LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default', + 'LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default', + 'FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default', + $l2gw_provider]) class { '::neutron::server': database_connection => 'mysql+pymysql://neutron:neutron@127.0.0.1/neutron?charset=utf8', sync_db => true, api_workers => 2, rpc_workers => 2, - service_providers => ['LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default', - 'LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default', - 'FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default'], + service_providers => $providers_list, } class { '::neutron::services::lbaas': } class { '::neutron::plugins::ml2': diff --git a/manifests/tempest.pp b/manifests/tempest.pp index 834ddfbb4..123e9b7fa 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -52,6 +52,14 @@ # (optional) Define if Ironic needs to be tested. # Default to false. # +# [*l2gw*] +# (optional) Define if L2GW needs to be tested. +# Default to false. +# +# [*l2gw_switch*] +# (optional) Define a switch name for testing. +# Default to undef. +# # [*mistral*] # (optional) Define if Mistral needs to be tested. # Default to false. @@ -115,6 +123,8 @@ class openstack_integration::tempest ( $heat = false, $horizon = false, $ironic = false, + $l2gw = false, + $l2gw_switch = undef, $mistral = false, $murano = false, $neutron = true, @@ -164,6 +174,8 @@ class openstack_integration::tempest ( 'subnet_allocation', 'tag', 'tag-ext', + 'l2-gateway', + 'l2-gateway-connection', ], ) { @@ -210,6 +222,7 @@ class openstack_integration::tempest ( neutron_available => $neutron, neutron_bgpvpn_available => $bgpvpn, neutron_lbaas_available => true, + neutron_l2gw_available => $l2gw, neutron_fwaas_available => true, ceilometer_available => $ceilometer, aodh_available => $aodh, @@ -241,6 +254,7 @@ class openstack_integration::tempest ( murano_available => $murano, tempest_workspace => '/tmp/openstack/tempest', run_ssh => true, + l2gw_switch => $l2gw_switch, # TODO(emilien) optimization by 1/ using Hiera to configure Glance image source # and 2/ if running in the gate, use /home/jenkins/cache/files/ cirros image. # img_dir => '/home/jenkins/cache/files', diff --git a/run_tests.sh b/run_tests.sh index 764b21048..65ff863fb 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -309,6 +309,9 @@ echo "test_create_and_delete_workflow" >> /tmp/openstack/tempest/test-whitelist. # BGPVPN echo "test_create_bgpvpn" >> /tmp/openstack/tempest/test-whitelist.txt +# L2GW +echo "test_create_show_list_update_delete_l2gateway" >> /tmp/openstack/tempest/test-whitelist.txt + if uses_debs; then # TODO(aschultz): check this after pike-m1 # 1) fwaas tests from ubuntu are still out of date LP#1667736