CI Changes
- define a .zuul.yaml file with the jobs that need to run against this repo - post_test_hook is working fine without any problems, however as options are added over time the script is hard to understand. Make clean post_test_hook.sh - Set min and max API versions for testing in the post_test_hook, since it's being used for stable branch testing against manila - deprecate the pre and post test hooks since these aren't used by the zuulv3 native jobs run against this repo. They're however needed by manila jobs on stable branches. Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com> Change-Id: Ieee0be4e94f237c81529e6e664f0edf9d47297fc
This commit is contained in:
parent
1b849b2757
commit
2cd720e448
11
.zuul.yaml
Normal file
11
.zuul.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- openstack-tox-bashate
|
||||
- manila-tempest-plugin-glusterfs-native:
|
||||
voting: false
|
||||
- manila-tempest-plugin-glusterfs-nfs:
|
||||
voting: false
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-bashate
|
@ -13,9 +13,71 @@
|
||||
# under the License.
|
||||
|
||||
# This script is executed inside post_test_hook function in devstack gate.
|
||||
SCRIPT_IS_DEPRECATED="The pre_test_hook and post_test_hook scripts from
|
||||
devstack-plugin-glusterfs are DEPRECATED. Please use alternate tools to
|
||||
configure devstack's local.conf file or run tempest tests"
|
||||
|
||||
echo $SCRIPT_IS_DEPRECATED
|
||||
|
||||
# Backend configuration: singlebackend only, not used yet.
|
||||
MANILA_BACKEND_TYPE=${1:?}
|
||||
|
||||
# Driver type: glusterfs, glusterfs-nfs, glusterfs-heketi,
|
||||
# glusterfs-nfs-heketi, glusterfs-native
|
||||
GLUSTERFS_MANILA_DRIVER_TYPE=${2:?}
|
||||
|
||||
# Test type: api or scenario
|
||||
MANILA_TEST_TYPE=${3:?}
|
||||
|
||||
if [[ $MANILA_TEST_TYPE == 'api' ]]; then
|
||||
export MANILA_TESTS='manila_tempest_tests.tests.api'
|
||||
export MANILA_TEMPEST_CONCURRENCY=12
|
||||
elif [[ $MANILA_TEST_TYPE == 'scenario' ]]; then
|
||||
export MANILA_TESTS='manila_tempest_tests.tests.scenario'
|
||||
export MANILA_TEMPEST_CONCURRENCY=8
|
||||
else
|
||||
echo "Invalid MANILA_TEST_TYPE = ${MANILA_TEST_TYPE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$GLUSTERFS_MANILA_DRIVER_TYPE" in
|
||||
glusterfs-native)
|
||||
BACKEND_NAME="GLUSTERNATIVE"
|
||||
ENABLE_PROTOCOLS="glusterfs"
|
||||
STORAGE_PROTOCOL="glusterfs"
|
||||
ENABLE_RO_ACCESS_LEVEL_FOR_PROTOCOLS=""
|
||||
ENABLE_IP_RULES_FOR_PROTOCOLS=""
|
||||
SHARE_ENABLE_CERT_RULES_FOR_PROTOCOLS="glusterfs"
|
||||
|
||||
CAPABILITY_SNAPSHOT_SUPPORT=True
|
||||
CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT=True
|
||||
|
||||
RUN_MANILA_SNAPSHOT_TESTS=True
|
||||
;;
|
||||
glusterfs|glusterfs-nfs)
|
||||
BACKEND_NAME="GLUSTERFS"
|
||||
ENABLE_PROTOCOLS="nfs"
|
||||
STORAGE_PROTOCOL="NFS"
|
||||
ENABLE_RO_ACCESS_LEVEL_FOR_PROTOCOLS=""
|
||||
ENABLE_IP_RULES_FOR_PROTOCOLS="nfs"
|
||||
SHARE_ENABLE_CERT_RULES_FOR_PROTOCOLS=""
|
||||
|
||||
RUN_MANILA_EXTEND_TESTS=True
|
||||
RUN_MANILA_SHRINK_TESTS=True
|
||||
;;
|
||||
glusterfs-heketi|glusterfs-nfs-heketi)
|
||||
BACKEND_NAME="GLUSTERFSHEKETI"
|
||||
# TODO: enable glusterfs-heketi ci
|
||||
;;
|
||||
*)
|
||||
echo "Invalid GLUSTERFS_MANILA_DRIVER_TYPE = \
|
||||
${GLUSTERFS_MANILA_DRIVER_TYPE}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
TEMPEST_CONFIG=$BASE/new/tempest/etc/tempest.conf
|
||||
|
||||
# Start setup Tempest
|
||||
sudo chown -R $USER:stack $BASE/new/tempest
|
||||
sudo chown -R $USER:stack $BASE/data/tempest
|
||||
sudo chmod -R o+rx $BASE/new/devstack/files
|
||||
@ -28,107 +90,47 @@ for env_var in ${DEVSTACK_LOCAL_CONFIG// / }; do
|
||||
export $env_var;
|
||||
done
|
||||
|
||||
# What backend configuration: singlebackend or multibackend
|
||||
MANILA_BACKEND_TYPE=$1
|
||||
MANILA_BACKEND_TYPE=${MANILA_BACKEND_TYPE:-singlebackend}
|
||||
# When testing a stable branch, we need to ensure we're testing with
|
||||
# supported API micro-versions; so set the versions from code if we're
|
||||
# not testing the master branch. If we're testing master, we'll allow
|
||||
# manila-tempest-plugin (which is branchless) tell us what versions it
|
||||
# wants to test. Grab the supported API micro-versions from the code
|
||||
_API_VERSION_REQUEST_PATH=$BASE/new/manila/manila/api/openstack/api_version_request.py
|
||||
_DEFAULT_MIN_VERSION=$(awk '$0 ~ /_MIN_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH)
|
||||
_DEFAULT_MAX_VERSION=$(awk '$0 ~ /_MAX_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH)
|
||||
# Override the *_api_microversion tempest options if present
|
||||
MANILA_TEMPEST_MIN_API_MICROVERSION=${MANILA_TEMPEST_MIN_API_MICROVERSION:-$_DEFAULT_MIN_VERSION}
|
||||
MANILA_TEMPEST_MAX_API_MICROVERSION=${MANILA_TEMPEST_MAX_API_MICROVERSION:-$_DEFAULT_MAX_VERSION}
|
||||
# Set these options in tempest.conf
|
||||
iniset $TEMPEST_CONFIG share min_api_microversion $MANILA_TEMPEST_MIN_API_MICROVERSION
|
||||
iniset $TEMPEST_CONFIG share max_api_microversion $MANILA_TEMPEST_MAX_API_MICROVERSION
|
||||
|
||||
# What driver to test: glusterfs, glusterfs-nfs, glusterfs-heketi,
|
||||
# glusterfs-nfs-heketi, glusterfs-native
|
||||
GLUSTERFS_MANILA_DRIVER_TYPE=$2
|
||||
GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE:-glusterfs-nfs}
|
||||
iniset $TEMPEST_CONFIG share backend_names ${BACKEND_NAME:?}
|
||||
iniset $TEMPEST_CONFIG share enable_protocols ${ENABLE_PROTOCOLS:?}
|
||||
iniset $TEMPEST_CONFIG share storage_protocol ${STORAGE_PROTOCOL:?}
|
||||
iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols \
|
||||
${ENABLE_RO_ACCESS_LEVEL_FOR_PROTOCOLS?}
|
||||
iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols \
|
||||
${ENABLE_IP_RULES_FOR_PROTOCOLS?}
|
||||
iniset $TEMPEST_CONFIG share enable_cert_rules_for_protocols \
|
||||
${SHARE_ENABLE_CERT_RULES_FOR_PROTOCOLS?}
|
||||
|
||||
# What test to run: api or scenario
|
||||
MANILA_TEST_TYPE=$3
|
||||
MANILA_TEST_TYPE=${MANILA_TEST_TYPE:-api}
|
||||
iniset $TEMPEST_CONFIG share capability_snapshot_support \
|
||||
${CAPABILITY_SNAPSHOT_SUPPORT:-False}
|
||||
iniset $TEMPEST_CONFIG share capability_create_share_from_snapshot_support \
|
||||
${CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT:-False}
|
||||
|
||||
if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs-native" ]]; then
|
||||
local BACKEND_NAME="GLUSTERNATIVE"
|
||||
iniset $TEMPEST_CONFIG share enable_protocols glusterfs
|
||||
iniset $TEMPEST_CONFIG share storage_protocol glusterfs
|
||||
# Disable tempest config option that enables creation of 'ip' type access
|
||||
# rules by default during tempest test runs.
|
||||
iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols
|
||||
iniset $TEMPEST_CONFIG share enable_cert_rules_for_protocols glusterfs
|
||||
iniset $TEMPEST_CONFIG share capability_snapshot_support True
|
||||
iniset $TEMPEST_CONFIG share capability_create_share_from_snapshot_support true
|
||||
# ro access_level is not supported by the driver.
|
||||
iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols
|
||||
RUN_MANILA_SNAPSHOT_TESTS=True
|
||||
else
|
||||
case "$GLUSTERFS_MANILA_DRIVER_TYPE" in
|
||||
glusterfs|glusterfs-nfs)
|
||||
local BACKEND_NAME="GLUSTERFS"
|
||||
RUN_MANILA_EXTEND_TESTS=True
|
||||
RUN_MANILA_SHRINK_TESTS=True
|
||||
;;
|
||||
glusterfs-heketi|glusterfs-nfs-heketi)
|
||||
local BACKEND_NAME="GLUSTERFSHEKETI"
|
||||
;;
|
||||
*)
|
||||
echo "no BACKEND_NAME for GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE}"
|
||||
;;
|
||||
esac
|
||||
iniset $TEMPEST_CONFIG share enable_protocols nfs
|
||||
iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols nfs
|
||||
iniset $TEMPEST_CONFIG share storage_protocol NFS
|
||||
# ro access_level is not supported by the driver.
|
||||
iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols
|
||||
fi
|
||||
|
||||
|
||||
iniset $TEMPEST_CONFIG share backend_names $BACKEND_NAME
|
||||
|
||||
# Set two retries for CI jobs
|
||||
iniset $TEMPEST_CONFIG share share_creation_retry_number 2
|
||||
|
||||
# Suppress errors in cleanup of resources
|
||||
SUPPRESS_ERRORS=${SUPPRESS_ERRORS_IN_CLEANUP:-True}
|
||||
iniset $TEMPEST_CONFIG share suppress_errors_in_cleanup $SUPPRESS_ERRORS
|
||||
|
||||
|
||||
# Disable multi_backend tests
|
||||
RUN_MANILA_MULTI_BACKEND_TESTS=${RUN_MANILA_MULTI_BACKEND_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share multi_backend $RUN_MANILA_MULTI_BACKEND_TESTS
|
||||
|
||||
# Disable manage/unmanage tests
|
||||
RUN_MANILA_MANAGE_TESTS=${RUN_MANILA_MANAGE_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_manage_unmanage_tests $RUN_MANILA_MANAGE_TESTS
|
||||
|
||||
# Disable extend tests
|
||||
RUN_MANILA_EXTEND_TESTS=${RUN_MANILA_EXTEND_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_extend_tests $RUN_MANILA_EXTEND_TESTS
|
||||
|
||||
# Disable shrink tests
|
||||
RUN_MANILA_SHRINK_TESTS=${RUN_MANILA_SHRINK_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_shrink_tests $RUN_MANILA_SHRINK_TESTS
|
||||
|
||||
# Disable multi_tenancy tests
|
||||
iniset $TEMPEST_CONFIG share run_snapshot_tests \
|
||||
${RUN_MANILA_SNAPSHOT_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_extend_tests ${RUN_MANILA_EXTEND_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_shrink_tests ${RUN_MANILA_SHRINK_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_manage_unmanage_tests False
|
||||
iniset $TEMPEST_CONFIG share multitenancy_enabled False
|
||||
iniset $TEMPEST_CONFIG share run_consistency_group_tests False
|
||||
|
||||
# Disable snapshot tests
|
||||
RUN_MANILA_SNAPSHOT_TESTS=${RUN_MANILA_SNAPSHOT_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_snapshot_tests $RUN_MANILA_SNAPSHOT_TESTS
|
||||
|
||||
# Disable consistency group tests
|
||||
RUN_MANILA_CG_TESTS=${RUN_MANILA_CG_TESTS:-False}
|
||||
iniset $TEMPEST_CONFIG share run_consistency_group_tests $RUN_MANILA_CG_TESTS
|
||||
|
||||
# let us control if we die or not
|
||||
set +o errexit
|
||||
cd $BASE/new/tempest
|
||||
|
||||
if [[ $MANILA_TEST_TYPE == 'api' ]]; then
|
||||
export MANILA_TESTS='manila_tempest_tests.tests.api'
|
||||
MANILA_TEMPEST_CONCURRENCY=12
|
||||
elif [[ $MANILA_TEST_TYPE == 'scenario' ]]; then
|
||||
export MANILA_TESTS='manila_tempest_tests.tests.scenario'
|
||||
else
|
||||
export MANILA_TESTS='manila_tempest_tests.tests'
|
||||
fi
|
||||
export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-8}
|
||||
|
||||
# check if tempest plugin was installed correctly
|
||||
echo 'import pkg_resources; print list(pkg_resources.iter_entry_points("tempest.test_plugins"))' | python
|
||||
iniset $TEMPEST_CONFIG share share_creation_retry_number 2
|
||||
iniset $TEMPEST_CONFIG share suppress_errors_in_cleanup True
|
||||
iniset $TEMPEST_CONFIG share multi_backend False
|
||||
|
||||
# Workaround for Tempest architectural changes (only for Liberty and lower releases)
|
||||
# See bugs:
|
||||
@ -148,11 +150,21 @@ iniset $TEMPEST_CONFIG identity alt_password $ADMIN_PASSWORD
|
||||
iniset $TEMPEST_CONFIG identity alt_tenant_name ${ALT_TENANT_NAME:-"alt_demo"}
|
||||
iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
|
||||
iniset $TEMPEST_CONFIG validation ssh_timeout $BUILD_TIMEOUT
|
||||
iniset $TEMPEST_CONFIG validation network_for_ssh ${PRIVATE_NETWORK_NAME:-"private"}
|
||||
iniset $TEMPEST_CONFIG validation network_for_ssh\
|
||||
${PRIVATE_NETWORK_NAME:-"private"}
|
||||
|
||||
# let us control if we die or not
|
||||
set +o errexit
|
||||
|
||||
# check if tempest plugin was installed correctly
|
||||
echo 'import pkg_resources; print list(pkg_resources.\
|
||||
iter_entry_points("tempest.test_plugins"))' | python
|
||||
|
||||
echo "Running tempest manila test suites"
|
||||
cd $BASE/new/tempest
|
||||
sudo -H -u $USER tempest list-plugins
|
||||
sudo -H -u $USER tempest run -r $MANILA_TESTS --concurrency=$MANILA_TEMPEST_CONCURRENCY
|
||||
sudo -H -u $USER tempest run -r $MANILA_TESTS\
|
||||
--concurrency=$MANILA_TEMPEST_CONCURRENCY
|
||||
|
||||
_retval=$?
|
||||
|
||||
|
@ -25,6 +25,10 @@ echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localconf
|
||||
echo "MANILA_SERVICE_IMAGE_ENABLED=False" >> $localconf
|
||||
echo "MANILA_MULTI_BACKEND=False" >> $localconf
|
||||
|
||||
source $BASE/new/devstack/functions
|
||||
|
||||
deprecated "devstack-plugin-glusterfs pre_test_hook and post_test_hook scripts are DEPRECATED. Please use alternate tools to configure devstack's local.conf file"
|
||||
|
||||
# Import env vars defined in CI job.
|
||||
for env_var in ${DEVSTACK_LOCAL_CONFIG// / }; do
|
||||
export $env_var;
|
||||
|
Loading…
x
Reference in New Issue
Block a user