[CI] Add support for CI jobs with custom images

Manila project uses special images for some of its share drivers.
So, add possibility to configure manila and run tempest tests using
custom image that was built with proposed changes to
'manila-image-elements' project.
Supported share drivers are 'generic' and 'container'.

Change-Id: I005d1b204ea25ced8913351d19eac282ca465fb6
This commit is contained in:
vponomaryov 2017-03-10 18:44:28 +02:00
parent 77c118dd8e
commit 2668da7bf0
2 changed files with 28 additions and 10 deletions

View File

@ -140,12 +140,7 @@ cd $BASE/new/tempest
export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-6}
export MANILA_TESTS=${MANILA_TESTS:-'manila_tempest_tests.tests.api'}
if [[ "$TEST_TYPE" == "scenario" ]]; then
echo "Set test set to scenario only"
MANILA_TESTS='manila_tempest_tests.tests.scenario'
iniset $TEMPEST_CONFIG auth use_dynamic_credentials True
RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
elif [[ "$DRIVER" == "generic" ]]; then
if [[ "$DRIVER" == "generic"* ]]; then
RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
RUN_MANILA_MANAGE_SNAPSHOT_TESTS=True
RUN_MANILA_CG_TESTS=False
@ -162,6 +157,18 @@ elif [[ "$DRIVER" == "generic" ]]; then
RUN_MANILA_SG_TESTS=False
fi
if [[ "$DRIVER" == "generic_with_custom_image" ]]; then
# For CI jobs that test changes to image we do not need to run lots of tests
# Will be enough to run simple scenario test, because
# if some package is lost, it is very likely to fail with each test.
MANILA_TESTS="(^manila_tempest_tests.tests.scenario)(?=.*\btest_write_data_to_share_created_from_snapshot\b.*)"
elif [[ "$TEST_TYPE" == "scenario" ]]; then
echo "Set test set to scenario only"
MANILA_TESTS='manila_tempest_tests.tests.scenario'
iniset $TEMPEST_CONFIG auth use_dynamic_credentials True
RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
fi
if [[ "$DRIVER" == "lvm" ]]; then
MANILA_TESTS="(^manila_tempest_tests.tests)(?=.*\[.*\bbackend\b.*\])"
MANILA_TEMPEST_CONCURRENCY=8
@ -230,19 +237,30 @@ elif [[ "$DRIVER" == "dummy" ]]; then
iniset $TEMPEST_CONFIG share multitenancy_enabled True
iniset $TEMPEST_CONFIG share create_networks_when_multitenancy_enabled False
iniset $TEMPEST_CONFIG share multi_backend True
elif [[ "$DRIVER" == "container" ]]; then
elif [[ "$DRIVER" == "container"* ]]; then
MANILA_TESTS="(^manila_tempest_tests.tests.api)(?=.*\[.*\bbackend\b.*\])"
if [[ "$DRIVER" == "container_with_custom_image" ]]; then
# TODO(vponomaryov): set scenario tests for run when
# manila tempest plugin supports share protocol and rules that
# container driver uses.
# MANILA_TESTS="(^manila_tempest_tests.tests.scenario)(?=.*\btest_read_write_two_vms\b.*)"
:
fi
MANILA_TEMPEST_CONCURRENCY=8
RUN_MANILA_SG_TESTS=False
RUN_MANILA_MANAGE_TESTS=False
RUN_MANILA_QUOTA_TESTS=False
RUN_MANILA_SHRINK_TESTS=False
RUN_MANILA_SNAPSHOT_TESTS=False
RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=False
CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT=False
iniset $TEMPEST_CONFIG share capability_storage_protocol 'CIFS'
iniset $TEMPEST_CONFIG share enable_protocols 'cifs'
iniset $TEMPEST_CONFIG share enable_user_rules_for_protocols 'cifs'
iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols ''
# TODO(vponomaryov): set following to True when bug #1679715 is fixed
iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
fi
# Enable quota tests

View File

@ -75,7 +75,7 @@ echo "MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL=${MANILA_SHARE_MIGRATION_PERIO
MANILA_SERVICE_IMAGE_ENABLED=${MANILA_SERVICE_IMAGE_ENABLED:-False}
DEFAULT_EXTRA_SPECS=${DEFAULT_EXTRA_SPECS:-"'snapshot_support=True create_share_from_snapshot_support=True'"}
if [[ "$DRIVER" == "generic" ]]; then
if [[ "$DRIVER" == "generic"* ]]; then
MANILA_SERVICE_IMAGE_ENABLED=True
echo "SHARE_DRIVER=manila.share.drivers.generic.GenericShareDriver" >> $localconf
elif [[ "$DRIVER" == "windows" ]]; then
@ -149,7 +149,7 @@ elif [[ "$DRIVER" == "zfsonlinux" ]]; then
# Set proper host IP for user export to be able to run scenario tests correctly
echo "MANILA_ZFSONLINUX_SHARE_EXPORT_IP=$HOST" >> $localconf
echo "MANILA_ZFSONLINUX_SERVICE_IP=127.0.0.1" >> $localconf
elif [[ "$DRIVER" == "container" ]]; then
elif [[ "$DRIVER" == "container"* ]]; then
DEFAULT_EXTRA_SPECS="'snapshot_support=false'"
echo "SHARE_DRIVER=manila.share.drivers.container.driver.ContainerShareDriver" >> $localconf
echo "SHARE_BACKING_FILE_SIZE=64000M" >> $localconf
@ -168,7 +168,7 @@ echo "TEMPEST_USE_TEST_ACCOUNTS=True" >> $localconf
echo "TEMPEST_ALLOW_TENANT_ISOLATION=False" >> $localconf
echo "TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-8}" >> $localconf
if [[ "$DRIVER" == "generic" ]]; then
if [[ "$DRIVER" == "generic"* ]]; then
echo -e '[[post-config|${NOVA_CONF:-/etc/nova/nova.conf}]]\n[DEFAULT]\nquota_instances=30\n' >> $localconf
echo -e '[[post-config|${NEUTRON_CONF:-/etc/neutron/neutron.conf}]]\n[DEFAULT]\nmax_fixed_ips_per_port=100\n' >> $localconf
echo -e '[[post-config|${NEUTRON_CONF:-/etc/neutron/neutron.conf}]]\n[QUOTAS]\nquota_subnet=-1\n' >> $localconf