"Fossies" - the Fresh Open Source Software Archive

Member "manila-8.1.3/contrib/ci/post_test_hook.sh" (20 Jul 2020, 18661 Bytes) of package /linux/misc/openstack/manila-8.1.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "post_test_hook.sh": 8.1.2_vs_8.1.3.

    1 #!/bin/bash -xe
    2 #
    3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    4 # not use this file except in compliance with the License. You may obtain
    5 # a copy of the License at
    6 #
    7 # http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 # Unless required by applicable law or agreed to in writing, software
   10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   12 # License for the specific language governing permissions and limitations
   13 # under the License.
   14 
   15 # This script is executed inside post_test_hook function in devstack gate.
   16 # First argument ($1) expects 'multibackend' as value for setting appropriate
   17 # tempest conf opts, all other values will assume singlebackend installation.
   18 
   19 sudo chown -R $USER:stack $BASE/new/tempest
   20 sudo chown -R $USER:stack $BASE/data/tempest
   21 sudo chmod -R o+rx $BASE/new/devstack/files
   22 
   23 # Import devstack functions 'iniset', 'iniget' and 'trueorfalse'
   24 source $BASE/new/devstack/functions
   25 
   26 export TEMPEST_CONFIG=${TEMPEST_CONFIG:-$BASE/new/tempest/etc/tempest.conf}
   27 
   28 # === Handle script arguments ===
   29 
   30 # First argument is expected to contain value equal either to 'singlebackend'
   31 # or 'multibackend' that defines how many back-ends are used.
   32 BACK_END_TYPE=$1
   33 
   34 # Second argument is expected to have codename of a share driver.
   35 DRIVER=$2
   36 
   37 # Third argument is expected to contain either 'api' or 'scenario' values
   38 # that define test suites to be run.
   39 TEST_TYPE=$3
   40 
   41 # Fourth argument is expected to be boolean-like and it should be 'true'
   42 # when PostgreSQL DB back-end is used and 'false' when MySQL.
   43 POSTGRES_ENABLED=$4
   44 POSTGRES_ENABLED=$(trueorfalse True POSTGRES_ENABLED)
   45 
   46 if [[ "$DRIVER" == "dummy" ]]; then
   47     export BACKENDS_NAMES="ALPHA,BETA"
   48 elif [[ "$BACK_END_TYPE" == "multibackend" ]]; then
   49     iniset $TEMPEST_CONFIG share multi_backend True
   50     # Set share backends names, they are defined within pre_test_hook
   51     export BACKENDS_NAMES="LONDON,PARIS"
   52 else
   53     export BACKENDS_NAMES="LONDON"
   54 fi
   55 iniset $TEMPEST_CONFIG share backend_names $BACKENDS_NAMES
   56 
   57 # If testing a stable branch, we need to ensure we're testing with supported
   58 # API micro-versions; so set the versions from code if we're not testing the
   59 # master branch. If we're testing master, we'll allow manila-tempest-plugin
   60 # (which is branchless) tell us what versions it wants to test.
   61 if [[ $ZUUL_BRANCH != "master" ]]; then
   62     # Grab the supported API micro-versions from the code
   63     _API_VERSION_REQUEST_PATH=$BASE/new/manila/manila/api/openstack/api_version_request.py
   64     _DEFAULT_MIN_VERSION=$(awk '$0 ~ /_MIN_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH)
   65     _DEFAULT_MAX_VERSION=$(awk '$0 ~ /_MAX_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH)
   66     # Override the *_api_microversion tempest options if present
   67     MANILA_TEMPEST_MIN_API_MICROVERSION=${MANILA_TEMPEST_MIN_API_MICROVERSION:-$_DEFAULT_MIN_VERSION}
   68     MANILA_TEMPEST_MAX_API_MICROVERSION=${MANILA_TEMPEST_MAX_API_MICROVERSION:-$_DEFAULT_MAX_VERSION}
   69     # Set these options in tempest.conf
   70     iniset $TEMPEST_CONFIG share min_api_microversion $MANILA_TEMPEST_MIN_API_MICROVERSION
   71     iniset $TEMPEST_CONFIG share max_api_microversion $MANILA_TEMPEST_MAX_API_MICROVERSION
   72 fi
   73 
   74 # Set two retries for CI jobs
   75 iniset $TEMPEST_CONFIG share share_creation_retry_number 2
   76 
   77 # Suppress errors in cleanup of resources
   78 SUPPRESS_ERRORS=${SUPPRESS_ERRORS_IN_CLEANUP:-True}
   79 iniset $TEMPEST_CONFIG share suppress_errors_in_cleanup $SUPPRESS_ERRORS
   80 
   81 USERNAME_FOR_USER_RULES=${USERNAME_FOR_USER_RULES:-"manila"}
   82 PASSWORD_FOR_SAMBA_USER=${PASSWORD_FOR_SAMBA_USER:-$USERNAME_FOR_USER_RULES}
   83 
   84 # Enable feature tests:
   85 # Default options are as specified in tempest.
   86 RUN_MANILA_QUOTA_TESTS=${RUN_MANILA_QUOTA_TESTS:-True}
   87 RUN_MANILA_SHRINK_TESTS=${RUN_MANILA_SHRINK_TESTS:-True}
   88 RUN_MANILA_SNAPSHOT_TESTS=${RUN_MANILA_SNAPSHOT_TESTS:-True}
   89 RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS=${RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS:-False}
   90 RUN_MANILA_SG_TESTS=${RUN_MANILA_SG_TESTS:-${RUN_MANILA_CG_TESTS:-True}}
   91 RUN_MANILA_MANAGE_TESTS=${RUN_MANILA_MANAGE_TESTS:-True}
   92 RUN_MANILA_MANAGE_SNAPSHOT_TESTS=${RUN_MANILA_MANAGE_SNAPSHOT_TESTS:-False}
   93 RUN_MANILA_REPLICATION_TESTS=${RUN_MANILA_REPLICATION_TESTS:-False}
   94 RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=${RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS:-False}
   95 RUN_MANILA_DRIVER_ASSISTED_MIGRATION_TESTS=${RUN_MANILA_DRIVER_ASSISTED_MIGRATION_TESTS:-False}
   96 RUN_MANILA_MOUNT_SNAPSHOT_TESTS=${RUN_MANILA_MOUNT_SNAPSHOT_TESTS:-False}
   97 RUN_MANILA_MIGRATION_WITH_PRESERVE_SNAPSHOTS_TESTS=${RUN_MANILA_MIGRATION_WITH_PRESERVE_SNAPSHOTS_TESTS:-False}
   98 RUN_MANILA_IPV6_TESTS=${RUN_MANILA_IPV6_TESTS:-False}
   99 
  100 MANILA_CONF=${MANILA_CONF:-/etc/manila/manila.conf}
  101 
  102 # Capabilitities
  103 CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT=${CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT:-True}
  104 MANILA_CONFIGURE_DEFAULT_TYPES=${MANILA_CONFIGURE_DEFAULT_TYPES:-True}
  105 
  106 if [[ -z "$MULTITENANCY_ENABLED" ]]; then
  107     # Define whether share drivers handle share servers or not.
  108     # Requires defined config option 'driver_handles_share_servers'.
  109     NO_SHARE_SERVER_HANDLING_MODES=0
  110     WITH_SHARE_SERVER_HANDLING_MODES=0
  111 
  112     # Convert backend names to config groups using lowercase translation
  113     CONFIG_GROUPS=${BACKENDS_NAMES,,}
  114 
  115     for CG in ${CONFIG_GROUPS//,/ }; do
  116         DRIVER_HANDLES_SHARE_SERVERS=$(iniget $MANILA_CONF $CG driver_handles_share_servers)
  117         if [[ $DRIVER_HANDLES_SHARE_SERVERS == False ]]; then
  118             NO_SHARE_SERVER_HANDLING_MODES=$((NO_SHARE_SERVER_HANDLING_MODES+1))
  119         elif [[ $DRIVER_HANDLES_SHARE_SERVERS == True ]]; then
  120             WITH_SHARE_SERVER_HANDLING_MODES=$((WITH_SHARE_SERVER_HANDLING_MODES+1))
  121         else
  122             echo "Config option 'driver_handles_share_servers' either is not defined or \
  123                     defined with improper value - '$DRIVER_HANDLES_SHARE_SERVERS'."
  124             exit 1
  125         fi
  126     done
  127 
  128     if [[ $NO_SHARE_SERVER_HANDLING_MODES -ge 1 && $WITH_SHARE_SERVER_HANDLING_MODES -ge 1 || \
  129             $NO_SHARE_SERVER_HANDLING_MODES -eq 0 && $WITH_SHARE_SERVER_HANDLING_MODES -eq 0 ]]; then
  130         echo 'Allowed only same driver modes for all backends to be run with Tempest job.'
  131         exit 1
  132     elif [[ $NO_SHARE_SERVER_HANDLING_MODES -ge 1 ]]; then
  133         MULTITENANCY_ENABLED='False'
  134     elif [[ $WITH_SHARE_SERVER_HANDLING_MODES -ge 1 ]]; then
  135         MULTITENANCY_ENABLED='True'
  136     else
  137         echo 'Should never get here unless an error occurred.'
  138         exit 1
  139     fi
  140 else
  141     MULTITENANCY_ENABLED=$(trueorfalse True MULTITENANCY_ENABLED)
  142 fi
  143 
  144 # Set multitenancy configuration for Tempest
  145 iniset $TEMPEST_CONFIG share multitenancy_enabled $MULTITENANCY_ENABLED
  146 if [[ "$MULTITENANCY_ENABLED" == "False"  ]]; then
  147     # Using approach without handling of share servers we have bigger load for
  148     # volume creation in Cinder using Generic driver. So, reduce amount of
  149     # threads to avoid errors for Cinder volume creations that appear
  150     # because of lack of free space.
  151     MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-8}
  152     iniset $TEMPEST_CONFIG auth create_isolated_networks False
  153 fi
  154 
  155 # let us control if we die or not
  156 set +o errexit
  157 cd $BASE/new/tempest
  158 
  159 export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-6}
  160 export MANILA_TESTS=${MANILA_TESTS:-'manila_tempest_tests.tests.api'}
  161 
  162 if [[ "$DRIVER" == "generic"* ]]; then
  163     RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
  164     RUN_MANILA_MANAGE_SNAPSHOT_TESTS=True
  165     RUN_MANILA_CG_TESTS=False
  166     if [[ "$MULTITENANCY_ENABLED" == "True"  ]]; then
  167         # NOTE(ganso): The generic driver has not implemented support for
  168         # Manage/unmanage shares/snapshots in DHSS=True
  169         RUN_MANILA_MANAGE_SNAPSHOT_TESTS=False
  170         RUN_MANILA_MANAGE_TESTS=False
  171     fi
  172     if [[ "$POSTGRES_ENABLED" == "True" ]]; then
  173         # Run only CIFS tests on PostgreSQL DB backend
  174         # to reduce amount of tests per job using 'generic' share driver.
  175         iniset $TEMPEST_CONFIG share enable_protocols cifs
  176     else
  177         # Run only NFS tests on MySQL DB backend to reduce amount of tests
  178         # per job using 'generic' share driver.
  179         iniset $TEMPEST_CONFIG share enable_protocols nfs
  180     fi
  181     MANILA_TESTS="(^manila_tempest_tests.tests.api)(?=.*\[.*\bbackend\b.*\])"
  182     RUN_MANILA_SG_TESTS=False
  183 fi
  184 
  185 if [[ "$DRIVER" == "generic_with_custom_image" ]]; then
  186     # For CI jobs that test changes to image we do not need to run lots of tests
  187     # Will be enough to run simple scenario test, because
  188     # if some package is lost, it is very likely to fail with each test.
  189     MANILA_TESTS="(^manila_tempest_tests.tests.scenario)(?=.*\btest_write_data_to_share_created_from_snapshot\b.*)"
  190 elif [[ "$TEST_TYPE" == "scenario" ]]; then
  191     echo "Set test set to scenario only"
  192     MANILA_TESTS='manila_tempest_tests.tests.scenario'
  193     iniset $TEMPEST_CONFIG auth use_dynamic_credentials True
  194     RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
  195 fi
  196 
  197 if [[ "$DRIVER" == "lvm" ]]; then
  198     MANILA_TESTS="(^manila_tempest_tests.tests)(?=.*\[.*\bbackend\b.*\])"
  199     MANILA_TEMPEST_CONCURRENCY=8
  200     RUN_MANILA_SG_TESTS=False
  201     RUN_MANILA_MANAGE_TESTS=False
  202     RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
  203     RUN_MANILA_SHRINK_TESTS=False
  204     RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS=True
  205     RUN_MANILA_MOUNT_SNAPSHOT_TESTS=True
  206     RUN_MANILA_IPV6_TESTS=True
  207     iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols 'nfs'
  208     iniset $TEMPEST_CONFIG share enable_user_rules_for_protocols 'cifs'
  209     iniset $TEMPEST_CONFIG share image_with_share_tools 'manila-service-image-master'
  210     iniset $TEMPEST_CONFIG auth use_dynamic_credentials True
  211     iniset $TEMPEST_CONFIG share capability_snapshot_support True
  212     if ! grep $USERNAME_FOR_USER_RULES "/etc/passwd"; then
  213         sudo useradd $USERNAME_FOR_USER_RULES
  214     fi
  215     (echo $PASSWORD_FOR_SAMBA_USER; echo $PASSWORD_FOR_SAMBA_USER) | sudo smbpasswd -s -a $USERNAME_FOR_USER_RULES
  216     sudo smbpasswd -e $USERNAME_FOR_USER_RULES
  217     samba_daemon_name=smbd
  218     if is_fedora; then
  219         samba_daemon_name=smb
  220     fi
  221     sudo service $samba_daemon_name restart
  222 elif [[ "$DRIVER" == "zfsonlinux" ]]; then
  223     MANILA_TESTS="(^manila_tempest_tests.tests)(?=.*\[.*\bbackend\b.*\])"
  224     MANILA_TEMPEST_CONCURRENCY=8
  225     RUN_MANILA_SG_TESTS=False
  226     RUN_MANILA_MANAGE_TESTS=True
  227     RUN_MANILA_MANAGE_SNAPSHOT_TESTS=True
  228     RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=True
  229     RUN_MANILA_DRIVER_ASSISTED_MIGRATION_TESTS=True
  230     RUN_MANILA_REPLICATION_TESTS=True
  231     iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols 'nfs'
  232     iniset $TEMPEST_CONFIG share enable_user_rules_for_protocols ''
  233     iniset $TEMPEST_CONFIG share enable_cert_rules_for_protocols ''
  234     iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols 'nfs'
  235     iniset $TEMPEST_CONFIG share build_timeout 180
  236     iniset $TEMPEST_CONFIG share share_creation_retry_number 0
  237     iniset $TEMPEST_CONFIG share capability_storage_protocol 'NFS'
  238     iniset $TEMPEST_CONFIG share enable_protocols 'nfs'
  239     iniset $TEMPEST_CONFIG share suppress_errors_in_cleanup False
  240     iniset $TEMPEST_CONFIG share multitenancy_enabled False
  241     iniset $TEMPEST_CONFIG share multi_backend True
  242     iniset $TEMPEST_CONFIG share backend_replication_type 'readable'
  243     iniset $TEMPEST_CONFIG share image_with_share_tools 'manila-service-image-master'
  244     iniset $TEMPEST_CONFIG auth use_dynamic_credentials True
  245     iniset $TEMPEST_CONFIG share capability_snapshot_support True
  246 elif [[ "$DRIVER" == "dummy" ]]; then
  247     MANILA_TEMPEST_CONCURRENCY=24
  248     MANILA_CONFIGURE_DEFAULT_TYPES=False
  249     RUN_MANILA_SG_TESTS=True
  250     RUN_MANILA_MANAGE_TESTS=True
  251     RUN_MANILA_MANAGE_SNAPSHOT_TESTS=True
  252     RUN_MANILA_DRIVER_ASSISTED_MIGRATION_TESTS=True
  253     RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS=True
  254     RUN_MANILA_MOUNT_SNAPSHOT_TESTS=True
  255     RUN_MANILA_MIGRATION_WITH_PRESERVE_SNAPSHOTS_TESTS=True
  256     iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols 'nfs'
  257     iniset $TEMPEST_CONFIG share enable_user_rules_for_protocols 'cifs'
  258     iniset $TEMPEST_CONFIG share enable_cert_rules_for_protocols ''
  259     iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols 'nfs,cifs'
  260     iniset $TEMPEST_CONFIG share build_timeout 180
  261     iniset $TEMPEST_CONFIG share share_creation_retry_number 0
  262     iniset $TEMPEST_CONFIG share capability_storage_protocol 'NFS_CIFS'
  263     iniset $TEMPEST_CONFIG share capability_sg_consistent_snapshot_support 'pool'
  264     iniset $TEMPEST_CONFIG share enable_protocols 'nfs,cifs'
  265     iniset $TEMPEST_CONFIG share suppress_errors_in_cleanup False
  266     iniset $TEMPEST_CONFIG share multitenancy_enabled True
  267     iniset $TEMPEST_CONFIG share create_networks_when_multitenancy_enabled False
  268     iniset $TEMPEST_CONFIG share multi_backend True
  269 elif [[ "$DRIVER" == "container"* ]]; then
  270     if [[ "$DRIVER" == "container_with_custom_image" ]]; then
  271         # TODO(vponomaryov): set scenario tests for run when
  272         # manila tempest plugin supports share protocol and rules that
  273         # container driver uses.
  274         # MANILA_TESTS="(^manila_tempest_tests.tests.scenario)(?=.*\btest_read_write_two_vms\b.*)"
  275         :
  276     fi
  277     MANILA_TEMPEST_CONCURRENCY=8
  278     RUN_MANILA_SG_TESTS=False
  279     RUN_MANILA_MANAGE_TESTS=True
  280     RUN_MANILA_QUOTA_TESTS=False
  281     RUN_MANILA_SHRINK_TESTS=False
  282     RUN_MANILA_SNAPSHOT_TESTS=False
  283     RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS=False
  284     CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT=False
  285     iniset $TEMPEST_CONFIG share capability_storage_protocol 'CIFS'
  286     iniset $TEMPEST_CONFIG share enable_protocols 'cifs'
  287     iniset $TEMPEST_CONFIG share enable_user_rules_for_protocols 'cifs'
  288     iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols ''
  289 
  290     # TODO(vponomaryov): set following to True when bug #1679715 is fixed
  291     iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
  292 fi
  293 
  294 # Enable quota tests
  295 iniset $TEMPEST_CONFIG share run_quota_tests $RUN_MANILA_QUOTA_TESTS
  296 
  297 # Enable shrink tests
  298 iniset $TEMPEST_CONFIG share run_shrink_tests $RUN_MANILA_SHRINK_TESTS
  299 
  300 # Enable snapshot tests
  301 iniset $TEMPEST_CONFIG share run_snapshot_tests $RUN_MANILA_SNAPSHOT_TESTS
  302 
  303 # Enable revert to snapshot tests
  304 iniset $TEMPEST_CONFIG share run_revert_to_snapshot_tests $RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS
  305 
  306 # Enable share group tests
  307 iniset $TEMPEST_CONFIG share run_share_group_tests $RUN_MANILA_SG_TESTS
  308 
  309 # Enable manage/unmanage tests
  310 iniset $TEMPEST_CONFIG share run_manage_unmanage_tests $RUN_MANILA_MANAGE_TESTS
  311 
  312 # Enable manage/unmanage snapshot tests
  313 iniset $TEMPEST_CONFIG share run_manage_unmanage_snapshot_tests $RUN_MANILA_MANAGE_SNAPSHOT_TESTS
  314 
  315 # Enable replication tests
  316 iniset $TEMPEST_CONFIG share run_replication_tests $RUN_MANILA_REPLICATION_TESTS
  317 
  318 # Enable migration tests
  319 iniset $TEMPEST_CONFIG share run_host_assisted_migration_tests $RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS
  320 iniset $TEMPEST_CONFIG share run_driver_assisted_migration_tests $RUN_MANILA_DRIVER_ASSISTED_MIGRATION_TESTS
  321 iniset $TEMPEST_CONFIG share run_migration_with_preserve_snapshots_tests $RUN_MANILA_MIGRATION_WITH_PRESERVE_SNAPSHOTS_TESTS
  322 
  323 # Enable mountable snapshots tests
  324 iniset $TEMPEST_CONFIG share run_mount_snapshot_tests $RUN_MANILA_MOUNT_SNAPSHOT_TESTS
  325 
  326 # Create share from snapshot support
  327 iniset $TEMPEST_CONFIG share capability_create_share_from_snapshot_support $CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT
  328 
  329 iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
  330 iniset $TEMPEST_CONFIG validation network_for_ssh ${PRIVATE_NETWORK_NAME:-"private"}
  331 
  332 if [ $(trueorfalse False MANILA_CONFIGURE_DEFAULT_TYPES) == True ]; then
  333     iniset $TEMPEST_CONFIG share default_share_type_name ${MANILA_DEFAULT_SHARE_TYPE:-default}
  334 fi
  335 
  336 ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-"Default"}
  337 export OS_PROJECT_DOMAIN_NAME=$ADMIN_DOMAIN_NAME
  338 export OS_USER_DOMAIN_NAME=$ADMIN_DOMAIN_NAME
  339 
  340 # Also, we should wait until service VM is available
  341 # before running Tempest tests using Generic driver in DHSS=False mode.
  342 source $BASE/new/manila/contrib/ci/common.sh
  343 manila_wait_for_drivers_init $MANILA_CONF
  344 
  345 source $BASE/new/devstack/openrc admin admin
  346 public_net_id=$(openstack network list --name $PUBLIC_NETWORK_NAME -f value -c ID )
  347 iniset $TEMPEST_CONFIG network public_network_id $public_net_id
  348 
  349 # Set config to run IPv6 tests according to env var
  350 iniset $TEMPEST_CONFIG share run_ipv6_tests $RUN_MANILA_IPV6_TESTS
  351 
  352 if ! [[ -z "$OVERRIDE_IP_FOR_NFS_ACCESS" ]]; then
  353     # Set config to use specified IP as access rule on NFS scenario tests
  354     # in order to workaround multiple NATs between the VMs and the storage
  355     # controller
  356     iniset $TEMPEST_CONFIG share override_ip_for_nfs_access $OVERRIDE_IP_FOR_NFS_ACCESS
  357 fi
  358 
  359 echo "Manila service details"
  360 source $BASE/new/devstack/openrc admin admin
  361 manila service-list
  362 
  363 echo "Running tempest manila test suites"
  364 cd $BASE/new/tempest/
  365 # List plugins in logs to enable debugging
  366 sudo -H -u $USER tempest list-plugins
  367 sudo -H -u $USER tempest run -r $MANILA_TESTS --concurrency=$MANILA_TEMPEST_CONCURRENCY
  368 RETVAL=$?
  369 cd -
  370 
  371 
  372 # If using the dummy driver, configure the second run. We can't use the
  373 # devstack variables RUN_MANILA_* now, we'll directly iniset tempest options.
  374 if [[ "$DRIVER" == "dummy" ]]; then
  375     save_tempest_results 1
  376     echo "First tempest run (DHSS=True) returned '$RETVAL'"
  377     iniset $TEMPEST_CONFIG share backend_names "GAMMA,DELTA"
  378     iniset $TEMPEST_CONFIG share run_manage_unmanage_tests True
  379     iniset $TEMPEST_CONFIG share run_manage_unmanage_snapshot_tests True
  380     iniset $TEMPEST_CONFIG share run_replication_tests True
  381     iniset $TEMPEST_CONFIG share multitenancy_enabled False
  382     iniset $TEMPEST_CONFIG share backend_replication_type 'readable'
  383 
  384     # Change driver mode for default share type to make tempest use
  385     # DHSS=False backends. This is just done here for semantics, if
  386     # the default share type hasn't been configured
  387     # ($MANILA_CONFIGURE_DEFAULT_TYPES=False), this command has no effect
  388     # since there is no default share type configured.
  389     source $BASE/new/devstack/openrc admin demo
  390     manila type-key default set driver_handles_share_servers=False
  391 
  392     echo "Running tempest manila test suites for DHSS=False mode"
  393     cd $BASE/new/tempest/
  394     sudo -H -u $USER tempest run -r  $MANILA_TESTS --concurrency=$MANILA_TEMPEST_CONCURRENCY
  395     RETVAL2=$?
  396     cd -
  397     save_tempest_results 2
  398 
  399     # Exit with last code if first succeeded else exit with first error code
  400     if [[ "$RETVAL" == "0" ]]; then
  401         RETVAL=$RETVAL2
  402     fi
  403 
  404     echo "Second tempest run (DHSS=False) returned '$RETVAL2'"
  405 fi
  406 exit $RETVAL