From 4e60c047d27a67f69624c6bd042e4c1521bd8989 Mon Sep 17 00:00:00 2001 From: Dongcan Ye Date: Fri, 31 Jan 2020 03:27:59 +0000 Subject: [PATCH] Permit OVS build can be set Commit 00a74d1137abe78a0f34a73144ee7e2ccc486a32 change the OVS package compile from source, this makes some neutron staduim projects func gate has no permission accessing the "ovs" dir. This patch adds a BUILD_OVS_FROM_SOURCE environment variables, let it can be override by gate_hook. Change-Id: Ib33fffbaaea6abfbd9719e0712918d4ae65b3ee2 Partial-Bug: #1861469 --- tools/configure_for_func_testing.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tools/configure_for_func_testing.sh b/tools/configure_for_func_testing.sh index 25b3d3cf3f9..13bcc70fe04 100755 --- a/tools/configure_for_func_testing.sh +++ b/tools/configure_for_func_testing.sh @@ -61,6 +61,7 @@ REPO_BASE=${GATE_DEST:-$(cd $(dirname "$0")/../.. && pwd)} INSTALL_MYSQL_ONLY=${INSTALL_MYSQL_ONLY:-False} # The gate should automatically install dependencies. INSTALL_BASE_DEPENDENCIES=${INSTALL_BASE_DEPENDENCIES:-$IS_GATE} +BUILD_OVS_FROM_SOURCE=${BUILD_OVS_FROM_SOURCE:-True} if [ ! -f "$DEVSTACK_PATH/stack.sh" ]; then @@ -97,18 +98,24 @@ function _install_base_deps { echo_summary "Installing base dependencies" INSTALL_TESTONLY_PACKAGES=True - PACKAGES=$(get_packages general,neutron,q-agt,q-l3) - # Do not install 'python-' prefixed packages other than - # python-dev*. Neutron's functional testing relies on deployment - # to a tox env so there is no point in installing python - # dependencies system-wide. - PACKAGES=$(echo $PACKAGES | perl -pe 's|python-(?!dev)[^ ]*||g') - install_package $PACKAGES + if [[ "$BUILD_OVS_FROM_SOURCE" == "True" ]]; then + PACKAGES=$(get_packages general,neutron,q-agt,q-l3) + # Do not install 'python-' prefixed packages other than + # python-dev*. Neutron's functional testing relies on deployment + # to a tox env so there is no point in installing python + # dependencies system-wide. + PACKAGES=$(echo $PACKAGES | perl -pe 's|python-(?!dev)[^ ]*||g') + install_package $PACKAGES - source $NEUTRON_PATH/devstack/lib/ovs - remove_ovs_packages - OVS_BRANCH="v2.12.0" - compile_ovs False /usr /var + source $NEUTRON_PATH/devstack/lib/ovs + remove_ovs_packages + OVS_BRANCH="v2.12.0" + compile_ovs False /usr /var + else + PACKAGES=$(get_packages general,neutron,q-agt,q-l3,openvswitch) + PACKAGES=$(echo $PACKAGES | perl -pe 's|python-(?!dev)[^ ]*||g') + install_package $PACKAGES + fi }