manila/contrib/ci/pre_test_hook.sh

121 lines
5.3 KiB
Bash
Raw Normal View History

#!/bin/bash -xe
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside pre_test_hook function in devstack gate.
# First argument ($1) expects boolean as value where:
# 'False' means share driver will not handle share servers
# 'True' means it will handle share servers.
[victoria][goal] Native Zuulv3 CI jobs Replace "legacy" style jobs with native zuulv3 ones built within the manila-tempest-plugin repository. This refactoring is driven by a community wide goal to stop relying on devstack-gate, a deprecated component of the OpenDev CI system [1] Remove in-tree devstack gate hook script portions that are no longer necessary; and mark the rest as deprecated, since third party CI could still be relying on these hooks. Replace "manila-tempest-dsvm-mysql-generic", "manila-tempest-dsvm-postgres-generic-singlebackend", "manila-tempest-dsvm-generic-no-share-servers" and "manila-tempest-dsvm-scenario" jobs with "manila-tempest-plugin-generic" which preserves coverage for the generic driver, while removing unnecessary duplication/separation. See commit message in [2] for more details. Remove older CentOS and HDFS jobs since they were not being executed. Remove "custom" image jobs targeting custom manila-image-element based builds, the jobs now originate in the manila-image-elements repository. [3] The dummy driver job has been split into two parts for testing DHSS=True and DHSS=False in separate jobs. Read more about the motivation in the commit message for the change that created that job [4] While some name tags such as "postgres" and "ipv6-only" have been removed from the job names, the functionality of the job hasn't been changed. This change will not be backported. Instead, new changes akin to this may directly target older branches of manila. [1] https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html [2] https://review.opendev.org/726291/ [3] https://opendev.org/openstack/manila-image-elements/src/commit/d9d2f1636066c7cd96e6cfd202c4db7ee3109b73/zuul.d/manila-image-elements-jobs.yaml#L34-L67 [4] https://review.opendev.org/740534/ Change-Id: I2be6fc12c787c05c7df68297990fcdca96f57c5d Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-07-21 13:04:58 -07:00
# Import devstack function 'trueorfalse', 'deprecated'
source $BASE/new/devstack/functions
[victoria][goal] Native Zuulv3 CI jobs Replace "legacy" style jobs with native zuulv3 ones built within the manila-tempest-plugin repository. This refactoring is driven by a community wide goal to stop relying on devstack-gate, a deprecated component of the OpenDev CI system [1] Remove in-tree devstack gate hook script portions that are no longer necessary; and mark the rest as deprecated, since third party CI could still be relying on these hooks. Replace "manila-tempest-dsvm-mysql-generic", "manila-tempest-dsvm-postgres-generic-singlebackend", "manila-tempest-dsvm-generic-no-share-servers" and "manila-tempest-dsvm-scenario" jobs with "manila-tempest-plugin-generic" which preserves coverage for the generic driver, while removing unnecessary duplication/separation. See commit message in [2] for more details. Remove older CentOS and HDFS jobs since they were not being executed. Remove "custom" image jobs targeting custom manila-image-element based builds, the jobs now originate in the manila-image-elements repository. [3] The dummy driver job has been split into two parts for testing DHSS=True and DHSS=False in separate jobs. Read more about the motivation in the commit message for the change that created that job [4] While some name tags such as "postgres" and "ipv6-only" have been removed from the job names, the functionality of the job hasn't been changed. This change will not be backported. Instead, new changes akin to this may directly target older branches of manila. [1] https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html [2] https://review.opendev.org/726291/ [3] https://opendev.org/openstack/manila-image-elements/src/commit/d9d2f1636066c7cd96e6cfd202c4db7ee3109b73/zuul.d/manila-image-elements-jobs.yaml#L34-L67 [4] https://review.opendev.org/740534/ Change-Id: I2be6fc12c787c05c7df68297990fcdca96f57c5d Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-07-21 13:04:58 -07:00
deprecated "Manila's pre_test_hook and post_test_hook scripts are DEPRECATED. Please use alternate tools to configure devstack's local.conf file"
localconf=$BASE/new/devstack/local.conf
echo "[[local|localrc]]" >> $localconf
echo "DEVSTACK_GATE_TEMPEST_ALLOW_TENANT_ISOLATION=1" >> $localconf
echo "API_RATE_LIMIT=False" >> $localconf
echo "VOLUME_BACKING_FILE_SIZE=22G" >> $localconf
echo "CINDER_LVM_TYPE=thin" >> $localconf
# Set DevStack's PYTHON3_VERSION variable if CI scripts specify it
if [[ ! -z "$PYTHON3_VERSION" ]]; then
echo "PYTHON3_VERSION=$PYTHON3_VERSION" >> $localconf
fi
# NOTE(mkoderer): switch to keystone v3 by default
echo "IDENTITY_API_VERSION=3" >> $localconf
# NOTE(vponomaryov): Set oversubscription ratio for Cinder LVM driver
# bigger than 1.0, because in CI we do not need such small value.
# It will allow us to avoid exceeding real capacity in CI test runs.
echo "CINDER_OVERSUBSCRIPTION_RATIO=100.0" >> $localconf
echo "MANILA_BACKEND1_CONFIG_GROUP_NAME=london" >> $localconf
echo "MANILA_BACKEND2_CONFIG_GROUP_NAME=paris" >> $localconf
echo "MANILA_SHARE_BACKEND1_NAME=LONDON" >> $localconf
echo "MANILA_SHARE_BACKEND2_NAME=PARIS" >> $localconf
echo "MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE=${MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE:=True}" >> $localconf
echo "MANILA_ALLOW_NAS_SERVER_PORTS_ON_HOST=${MANILA_ALLOW_NAS_SERVER_PORTS_ON_HOST:=False}" >> $localconf
# === Handle script arguments ===
# First argument is expected to be a boolean-like value for DHSS.
DHSS=$1
DHSS=$(trueorfalse True DHSS)
# Second argument is expected to have codename of a share driver.
DRIVER=$2
# Third argument is expected to contain value equal either to 'singlebackend'
# or 'multibackend' that defines how many back-ends should be configured.
BACK_END_TYPE=$3
echo "MANILA_OPTGROUP_london_driver_handles_share_servers=$DHSS" >> $localconf
echo "MANILA_OPTGROUP_paris_driver_handles_share_servers=$DHSS" >> $localconf
echo "MANILA_USE_SERVICE_INSTANCE_PASSWORD=True" >> $localconf
echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localconf
if [[ "$BACK_END_TYPE" == "multibackend" ]]; then
echo "MANILA_MULTI_BACKEND=True" >> $localconf
else
echo "MANILA_MULTI_BACKEND=False" >> $localconf
fi
# Set MANILA_ADMIN_NET_RANGE for admin_network and data_service IP
echo "MANILA_ADMIN_NET_RANGE=${MANILA_ADMIN_NET_RANGE:=10.2.5.0/24}" >> $localconf
echo "MANILA_DATA_NODE_IP=${MANILA_DATA_NODE_IP:=$MANILA_ADMIN_NET_RANGE}" >> $localconf
echo "MANILA_DATA_COPY_CHECK_HASH=${MANILA_DATA_COPY_CHECK_HASH:=True}" >> $localconf
Share migration Newton improvements At Austin 2016 summit there were several improvements to Share migration feature discussed. This patch implements these changes. Changes are: - Added 'Writable' API parameter: user chooses whether share must remain writable during migration. - Added 'Preserve Metadata' API parameter: user chooses whether share must preserve all file metadata on migration. - Added 'Non-disruptive' API parameter: user chooses whether migration of share must be performed non-disruptively. - Removed existing 'Notify', thus removing 1-phase migration possibility. - Renamed existing 'Force Host Copy' parameter to 'Force Host-assisted Migration'. - Renamed all 'migration_info' and 'migration_get_info' entries to 'connection_info' and 'connection_get_info'. - Updated driver interfaces with the new API parameters, drivers must respect them. - Changed share/api => scheduler RPCAPI back to asynchronous. - Added optional SHA-256 validation to perform additional check if bytes were corrupted during copying. - Added mount options configuration to Data Service so CIFS shares can be mounted. - Driver may override _get_access_mapping if supports a different access_type/protocol combination than what is defined by default. - Added CIFS share protocol support and 'user' access type support to Data Service. - Reset Task State API now allows task_state to be unset using 'None' value. - Added possibility to change share-network when migrating a share. - Bumped microversion to 2.22. - Removed support of all previous versions of Share Migration APIs. APIImpact DocImpact Implements: blueprint newton-migration-improvements Change-Id: Ief49a46c86ed3c22d3b31021aff86a9ce0ecbe3b
2016-06-06 17:10:06 -03:00
# Share Migration CI tests migration_continue period task interval
echo "MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL=${MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL:=1}" >> $localconf
Share migration Newton improvements At Austin 2016 summit there were several improvements to Share migration feature discussed. This patch implements these changes. Changes are: - Added 'Writable' API parameter: user chooses whether share must remain writable during migration. - Added 'Preserve Metadata' API parameter: user chooses whether share must preserve all file metadata on migration. - Added 'Non-disruptive' API parameter: user chooses whether migration of share must be performed non-disruptively. - Removed existing 'Notify', thus removing 1-phase migration possibility. - Renamed existing 'Force Host Copy' parameter to 'Force Host-assisted Migration'. - Renamed all 'migration_info' and 'migration_get_info' entries to 'connection_info' and 'connection_get_info'. - Updated driver interfaces with the new API parameters, drivers must respect them. - Changed share/api => scheduler RPCAPI back to asynchronous. - Added optional SHA-256 validation to perform additional check if bytes were corrupted during copying. - Added mount options configuration to Data Service so CIFS shares can be mounted. - Driver may override _get_access_mapping if supports a different access_type/protocol combination than what is defined by default. - Added CIFS share protocol support and 'user' access type support to Data Service. - Reset Task State API now allows task_state to be unset using 'None' value. - Added possibility to change share-network when migrating a share. - Bumped microversion to 2.22. - Removed support of all previous versions of Share Migration APIs. APIImpact DocImpact Implements: blueprint newton-migration-improvements Change-Id: Ief49a46c86ed3c22d3b31021aff86a9ce0ecbe3b
2016-06-06 17:10:06 -03:00
MANILA_SERVICE_IMAGE_ENABLED=${MANILA_SERVICE_IMAGE_ENABLED:-False}
DEFAULT_EXTRA_SPECS=${DEFAULT_EXTRA_SPECS:-"'snapshot_support=True create_share_from_snapshot_support=True'"}
[victoria][goal] Native Zuulv3 CI jobs Replace "legacy" style jobs with native zuulv3 ones built within the manila-tempest-plugin repository. This refactoring is driven by a community wide goal to stop relying on devstack-gate, a deprecated component of the OpenDev CI system [1] Remove in-tree devstack gate hook script portions that are no longer necessary; and mark the rest as deprecated, since third party CI could still be relying on these hooks. Replace "manila-tempest-dsvm-mysql-generic", "manila-tempest-dsvm-postgres-generic-singlebackend", "manila-tempest-dsvm-generic-no-share-servers" and "manila-tempest-dsvm-scenario" jobs with "manila-tempest-plugin-generic" which preserves coverage for the generic driver, while removing unnecessary duplication/separation. See commit message in [2] for more details. Remove older CentOS and HDFS jobs since they were not being executed. Remove "custom" image jobs targeting custom manila-image-element based builds, the jobs now originate in the manila-image-elements repository. [3] The dummy driver job has been split into two parts for testing DHSS=True and DHSS=False in separate jobs. Read more about the motivation in the commit message for the change that created that job [4] While some name tags such as "postgres" and "ipv6-only" have been removed from the job names, the functionality of the job hasn't been changed. This change will not be backported. Instead, new changes akin to this may directly target older branches of manila. [1] https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html [2] https://review.opendev.org/726291/ [3] https://opendev.org/openstack/manila-image-elements/src/commit/d9d2f1636066c7cd96e6cfd202c4db7ee3109b73/zuul.d/manila-image-elements-jobs.yaml#L34-L67 [4] https://review.opendev.org/740534/ Change-Id: I2be6fc12c787c05c7df68297990fcdca96f57c5d Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-07-21 13:04:58 -07:00
if [[ "$DRIVER" == "windows" ]]; then
MANILA_SERVICE_IMAGE_ENABLED=True
echo "SHARE_DRIVER=manila.share.drivers.windows.windows_smb_driver.WindowsSMBDriver" >> $localconf
fi
echo "MANILA_SERVICE_IMAGE_ENABLED=$MANILA_SERVICE_IMAGE_ENABLED" >> $localconf
if [[ "$MANILA_SERVICE_IMAGE_ENABLED" == True ]]; then
echo "MANILA_SERVICE_IMAGE_URL=$MANILA_SERVICE_IMAGE_URL" >> $localconf
echo "MANILA_SERVICE_IMAGE_NAME=$MANILA_SERVICE_IMAGE_NAME" >> $localconf
fi
echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS=$DEFAULT_EXTRA_SPECS" >> $localconf
echo "MANILA_CONFIGURE_DEFAULT_TYPES=${MANILA_CONFIGURE_DEFAULT_TYPES:-True}" >> $localconf
# Enabling isolated metadata in Neutron is required because
# Tempest creates isolated networks and created vm's in scenario tests don't
# have access to Nova Metadata service. This leads to unavailability of
# created vm's in scenario tests.
echo "ENABLE_ISOLATED_METADATA=True" >> $localconf
echo "TEMPEST_USE_TEST_ACCOUNTS=True" >> $localconf
echo "TEMPEST_ALLOW_TENANT_ISOLATION=False" >> $localconf
echo "TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-8}" >> $localconf
MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6:-False}
echo "MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6}" >> $localconf
if [[ "$MANILA_SETUP_IPV6" == True ]]; then
# When setting up proper IPv6 networks, we should do it ourselves so we can
# use Neutron Dynamic Routing plugin with address scopes instead of the
# regular Neutron DevStack configuration.
echo "NEUTRON_CREATE_INITIAL_NETWORKS=False" >> $localconf
echo "IP_VERSION=4+6" >> $localconf
echo "MANILA_RESTORE_IPV6_DEFAULT_ROUTE=False" >> $localconf
fi