From 2bdb724c37aa8dc6f9efd094ff249f5d8efd2c28 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Tue, 28 Apr 2020 18:09:56 -0700 Subject: [PATCH] [devstack][ci] Move bgp setup to plugin We currently use a legacy devstack-gate script to create the bgp speaker, and peer required to communicate to and from the tenant private IPv6 networks. Move this logic to the devstack plugin so that we can invoke it automatically with the existing devstack variable MANILA_SETUP_IPV6. Change-Id: Iea90e3f04ae05e5783c3163bbf2d2dabd128c7b5 (cherry picked from commit 2277c20c02641c3a0cd0804ef53a54cd5492ce2d) (cherry picked from commit fc9ac3cb4944020645b9616fbf2b6b81675726bf) (cherry picked from commit d4e0627e93e5c4aa77d9609256a75d1295b79f9a) Signed-off-by: Goutham Pacha Ravi --- contrib/ci/post_test_hook.sh | 8 -------- devstack/plugin.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/contrib/ci/post_test_hook.sh b/contrib/ci/post_test_hook.sh index 9e6ce135bd..d4b17c849b 100755 --- a/contrib/ci/post_test_hook.sh +++ b/contrib/ci/post_test_hook.sh @@ -339,14 +339,6 @@ source $BASE/new/devstack/openrc admin admin public_net_id=$(openstack network list --name $PUBLIC_NETWORK_NAME -f value -c ID ) iniset $TEMPEST_CONFIG network public_network_id $public_net_id -# Now that all plugins are loaded, setup BGP here -if [ $(trueorfalse False MANILA_SETUP_IPV6) == True ]; then - neutron bgp-speaker-create --ip-version 6 --local-as 100 bgpspeaker - neutron bgp-speaker-network-add bgpspeaker $PUBLIC_NETWORK_NAME - neutron bgp-peer-create --peer-ip ::1 --remote-as 200 bgppeer - neutron bgp-speaker-peer-add bgpspeaker bgppeer -fi - # Set config to run IPv6 tests according to env var iniset $TEMPEST_CONFIG share run_ipv6_tests $RUN_MANILA_IPV6_TESTS diff --git a/devstack/plugin.sh b/devstack/plugin.sh index b55388282b..5dd368a056 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -1078,6 +1078,13 @@ function setup_ipv6 { } +function setup_bgp_for_ipv6 { + neutron bgp-speaker-create --ip-version 6 --local-as 100 bgpspeaker + neutron bgp-speaker-network-add bgpspeaker $PUBLIC_NETWORK_NAME + neutron bgp-peer-create --peer-ip ::1 --remote-as 200 bgppeer + neutron bgp-speaker-peer-add bgpspeaker bgppeer +} + # Main dispatcher if [[ "$1" == "stack" && "$2" == "install" ]]; then echo_summary "Installing Manila Client" @@ -1196,6 +1203,12 @@ elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then allow_host_ports_for_share_mounting fi + if [[ "$(trueorfalse False MANILA_SETUP_IPV6)" == "True" ]]; then + # Now that all plugins are loaded, setup BGP + echo_summary "Setting up BGP speaker to advertise routes to project networks" + setup_bgp_for_ipv6 + fi + fi if [[ "$1" == "unstack" ]]; then