"Fossies" - the Fresh Open Source Software Archive

Member "manila-8.1.3/contrib/ci/pre_test_hook.sh" (20 Jul 2020, 11398 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 "pre_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 pre_test_hook function in devstack gate.
   16 # First argument ($1) expects boolean as value where:
   17 # 'False' means share driver will not handle share servers
   18 # 'True' means it will handle share servers.
   19 
   20 # Import devstack function 'trueorfalse'
   21 source $BASE/new/devstack/functions
   22 
   23 localconf=$BASE/new/devstack/local.conf
   24 
   25 echo "[[local|localrc]]" >> $localconf
   26 echo "DEVSTACK_GATE_TEMPEST_ALLOW_TENANT_ISOLATION=1" >> $localconf
   27 echo "API_RATE_LIMIT=False" >> $localconf
   28 echo "VOLUME_BACKING_FILE_SIZE=22G" >> $localconf
   29 echo "CINDER_LVM_TYPE=thin" >> $localconf
   30 
   31 # Set DevStack's PYTHON3_VERSION variable if CI scripts specify it
   32 if ! [[ -z "PYTHON3_VERSION" ]]; then
   33 echo "PYTHON3_VERSION=$PYTHON3_VERSION" >> $localconf
   34 fi
   35 
   36 # NOTE(mkoderer): switch to keystone v3 by default
   37 echo "IDENTITY_API_VERSION=3" >> $localconf
   38 
   39 # NOTE(vponomaryov): Set oversubscription ratio for Cinder LVM driver
   40 # bigger than 1.0, because in CI we do not need such small value.
   41 # It will allow us to avoid exceeding real capacity in CI test runs.
   42 echo "CINDER_OVERSUBSCRIPTION_RATIO=100.0" >> $localconf
   43 echo "MANILA_BACKEND1_CONFIG_GROUP_NAME=london" >> $localconf
   44 echo "MANILA_BACKEND2_CONFIG_GROUP_NAME=paris" >> $localconf
   45 echo "MANILA_SHARE_BACKEND1_NAME=LONDON" >> $localconf
   46 echo "MANILA_SHARE_BACKEND2_NAME=PARIS" >> $localconf
   47 
   48 echo "MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE=${MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE:=True}" >> $localconf
   49 
   50 echo "MANILA_ALLOW_NAS_SERVER_PORTS_ON_HOST=${MANILA_ALLOW_NAS_SERVER_PORTS_ON_HOST:=False}" >> $localconf
   51 
   52 # === Handle script arguments ===
   53 # First argument is expected to be a boolean-like value for DHSS.
   54 DHSS=$1
   55 DHSS=$(trueorfalse True DHSS)
   56 
   57 # Second argument is expected to have codename of a share driver.
   58 DRIVER=$2
   59 
   60 # Third argument is expected to contain value equal either to 'singlebackend'
   61 # or 'multibackend' that defines how many back-ends should be configured.
   62 BACK_END_TYPE=$3
   63 
   64 echo "MANILA_OPTGROUP_london_driver_handles_share_servers=$DHSS" >> $localconf
   65 echo "MANILA_OPTGROUP_paris_driver_handles_share_servers=$DHSS" >> $localconf
   66 echo "MANILA_USE_SERVICE_INSTANCE_PASSWORD=True" >> $localconf
   67 echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localconf
   68 
   69 if [[ "$BACK_END_TYPE" == "multibackend" ]]; then
   70     echo "MANILA_MULTI_BACKEND=True" >> $localconf
   71 else
   72     echo "MANILA_MULTI_BACKEND=False" >> $localconf
   73 fi
   74 
   75 # Set MANILA_ADMIN_NET_RANGE for admin_network and data_service IP
   76 echo "MANILA_ADMIN_NET_RANGE=${MANILA_ADMIN_NET_RANGE:=10.2.5.0/24}" >> $localconf
   77 echo "MANILA_DATA_NODE_IP=${MANILA_DATA_NODE_IP:=$MANILA_ADMIN_NET_RANGE}" >> $localconf
   78 echo "MANILA_DATA_COPY_CHECK_HASH=${MANILA_DATA_COPY_CHECK_HASH:=True}" >> $localconf
   79 
   80 # Share Migration CI tests migration_continue period task interval
   81 echo "MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL=${MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL:=1}" >> $localconf
   82 
   83 MANILA_SERVICE_IMAGE_ENABLED=${MANILA_SERVICE_IMAGE_ENABLED:-False}
   84 DEFAULT_EXTRA_SPECS=${DEFAULT_EXTRA_SPECS:-"'snapshot_support=True create_share_from_snapshot_support=True'"}
   85 
   86 if [[ "$DRIVER" == "generic"* ]]; then
   87     MANILA_SERVICE_IMAGE_ENABLED=True
   88     echo "SHARE_DRIVER=manila.share.drivers.generic.GenericShareDriver" >> $localconf
   89 elif [[ "$DRIVER" == "windows" ]]; then
   90     MANILA_SERVICE_IMAGE_ENABLED=True
   91     echo "SHARE_DRIVER=manila.share.drivers.windows.windows_smb_driver.WindowsSMBDriver" >> $localconf
   92 elif [[ "$DRIVER" == "dummy" ]]; then
   93     driver_path="manila.tests.share.drivers.dummy.DummyDriver"
   94     DEFAULT_EXTRA_SPECS="'snapshot_support=True create_share_from_snapshot_support=True revert_to_snapshot_support=True mount_snapshot_support=True'"
   95     echo "MANILA_SERVICE_IMAGE_ENABLED=False" >> $localconf
   96 
   97     # Run dummy driver CI job using standalone approach for running
   98     # manila API service just because we need to test this approach too,
   99     # that is very useful for development needs.
  100     echo "MANILA_USE_UWSGI=False" >> $localconf
  101     echo "MANILA_USE_MOD_WSGI=False" >> $localconf
  102 
  103     echo "SHARE_DRIVER=$driver_path" >> $localconf
  104     echo "SUPPRESS_ERRORS_IN_CLEANUP=False" >> $localconf
  105     echo "MANILA_REPLICA_STATE_UPDATE_INTERVAL=10" >> $localconf
  106     echo "MANILA_ENABLED_BACKENDS=alpha,beta,gamma,delta" >> $localconf
  107     echo "MANILA_CONFIGURE_GROUPS=alpha,beta,gamma,delta,membernet,adminnet" >> $localconf
  108 
  109     echo "MANILA_OPTGROUP_alpha_share_driver=$driver_path" >> $localconf
  110     echo "MANILA_OPTGROUP_alpha_driver_handles_share_servers=True" >> $localconf
  111     echo "MANILA_OPTGROUP_alpha_share_backend_name=ALPHA" >> $localconf
  112     echo "MANILA_OPTGROUP_alpha_network_config_group=membernet" >> $localconf
  113     echo "MANILA_OPTGROUP_alpha_admin_network_config_group=adminnet" >> $localconf
  114 
  115     echo "MANILA_OPTGROUP_beta_share_driver=$driver_path" >> $localconf
  116     echo "MANILA_OPTGROUP_beta_driver_handles_share_servers=True" >> $localconf
  117     echo "MANILA_OPTGROUP_beta_share_backend_name=BETA" >> $localconf
  118     echo "MANILA_OPTGROUP_beta_network_config_group=membernet" >> $localconf
  119     echo "MANILA_OPTGROUP_beta_admin_network_config_group=adminnet" >> $localconf
  120 
  121     echo "MANILA_OPTGROUP_gamma_share_driver=$driver_path" >> $localconf
  122     echo "MANILA_OPTGROUP_gamma_driver_handles_share_servers=False" >> $localconf
  123     echo "MANILA_OPTGROUP_gamma_share_backend_name=GAMMA" >> $localconf
  124     echo "MANILA_OPTGROUP_gamma_replication_domain=DUMMY_DOMAIN" >> $localconf
  125 
  126     echo "MANILA_OPTGROUP_delta_share_driver=$driver_path" >> $localconf
  127     echo "MANILA_OPTGROUP_delta_driver_handles_share_servers=False" >> $localconf
  128     echo "MANILA_OPTGROUP_delta_share_backend_name=DELTA" >> $localconf
  129     echo "MANILA_OPTGROUP_delta_replication_domain=DUMMY_DOMAIN" >> $localconf
  130 
  131     echo "MANILA_OPTGROUP_membernet_network_api_class=manila.network.standalone_network_plugin.StandaloneNetworkPlugin" >> $localconf
  132     echo "MANILA_OPTGROUP_membernet_standalone_network_plugin_gateway=10.0.0.1" >> $localconf
  133     echo "MANILA_OPTGROUP_membernet_standalone_network_plugin_mask=24" >> $localconf
  134     echo "MANILA_OPTGROUP_membernet_standalone_network_plugin_network_type=vlan" >> $localconf
  135     echo "MANILA_OPTGROUP_membernet_standalone_network_plugin_segmentation_id=1010" >> $localconf
  136     echo "MANILA_OPTGROUP_membernet_standalone_network_plugin_allowed_ip_ranges=10.0.0.10-10.0.0.209" >> $localconf
  137     echo "MANILA_OPTGROUP_membernet_network_plugin_ipv4_enabled=True" >> $localconf
  138 
  139     echo "MANILA_OPTGROUP_adminnet_network_api_class=manila.network.standalone_network_plugin.StandaloneNetworkPlugin" >> $localconf
  140     echo "MANILA_OPTGROUP_adminnet_standalone_network_plugin_gateway=11.0.0.1" >> $localconf
  141     echo "MANILA_OPTGROUP_adminnet_standalone_network_plugin_mask=24" >> $localconf
  142     echo "MANILA_OPTGROUP_adminnet_standalone_network_plugin_network_type=vlan" >> $localconf
  143     echo "MANILA_OPTGROUP_adminnet_standalone_network_plugin_segmentation_id=1011" >> $localconf
  144     echo "MANILA_OPTGROUP_adminnet_standalone_network_plugin_allowed_ip_ranges=11.0.0.10-11.0.0.19,11.0.0.30-11.0.0.39,11.0.0.50-11.0.0.199" >> $localconf
  145     echo "MANILA_OPTGROUP_adminnet_network_plugin_ipv4_enabled=True" >> $localconf
  146 
  147     export MANILA_TEMPEST_CONCURRENCY=24
  148     export MANILA_CONFIGURE_DEFAULT_TYPES=False
  149 
  150 elif [[ "$DRIVER" == "lvm" ]]; then
  151     MANILA_SERVICE_IMAGE_ENABLED=True
  152     DEFAULT_EXTRA_SPECS="'snapshot_support=True create_share_from_snapshot_support=True revert_to_snapshot_support=True mount_snapshot_support=True'"
  153 
  154     echo "SHARE_DRIVER=manila.share.drivers.lvm.LVMShareDriver" >> $localconf
  155     echo "SHARE_BACKING_FILE_SIZE=32000M" >> $localconf
  156     export MANILA_SETUP_IPV6=True
  157 elif [[ "$DRIVER" == "zfsonlinux" ]]; then
  158     MANILA_SERVICE_IMAGE_ENABLED=True
  159     echo "SHARE_DRIVER=manila.share.drivers.zfsonlinux.driver.ZFSonLinuxShareDriver" >> $localconf
  160     echo "RUN_MANILA_REPLICATION_TESTS=True" >> $localconf
  161     # Set the replica_state_update_interval to 60 seconds to make
  162     # replication tests run faster. The default is 300, which is greater than
  163     # the build timeout for ZFS on the gate.
  164     echo "MANILA_REPLICA_STATE_UPDATE_INTERVAL=60" >> $localconf
  165     echo "MANILA_ZFSONLINUX_USE_SSH=True" >> $localconf
  166     # Set proper host IP for user export to be able to run scenario tests correctly
  167     echo "MANILA_ZFSONLINUX_SHARE_EXPORT_IP=$HOST" >> $localconf
  168     echo "MANILA_ZFSONLINUX_SERVICE_IP=127.0.0.1" >> $localconf
  169 elif [[ "$DRIVER" == "container"* ]]; then
  170     DEFAULT_EXTRA_SPECS="'snapshot_support=false'"
  171     echo "SHARE_DRIVER=manila.share.drivers.container.driver.ContainerShareDriver" >> $localconf
  172     echo "SHARE_BACKING_FILE_SIZE=64000M" >> $localconf
  173 fi
  174 
  175 echo "MANILA_SERVICE_IMAGE_ENABLED=$MANILA_SERVICE_IMAGE_ENABLED" >> $localconf
  176 if [[ "$MANILA_SERVICE_IMAGE_ENABLED" == True ]]; then
  177     echo "MANILA_SERVICE_IMAGE_URL=$MANILA_SERVICE_IMAGE_URL" >> $localconf
  178     echo "MANILA_SERVICE_IMAGE_NAME=$MANILA_SERVICE_IMAGE_NAME" >> $localconf
  179 fi
  180 echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS=$DEFAULT_EXTRA_SPECS" >> $localconf
  181 echo "MANILA_CONFIGURE_DEFAULT_TYPES=${MANILA_CONFIGURE_DEFAULT_TYPES:-True}" >> $localconf
  182 
  183 # Enabling isolated metadata in Neutron is required because
  184 # Tempest creates isolated networks and created vm's in scenario tests don't
  185 # have access to Nova Metadata service. This leads to unavailability of
  186 # created vm's in scenario tests.
  187 echo "ENABLE_ISOLATED_METADATA=True" >> $localconf
  188 
  189 echo "TEMPEST_USE_TEST_ACCOUNTS=True" >> $localconf
  190 echo "TEMPEST_ALLOW_TENANT_ISOLATION=False" >> $localconf
  191 echo "TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-8}" >> $localconf
  192 
  193 MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6:-False}
  194 echo "MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6}" >> $localconf
  195 if [[ "$MANILA_SETUP_IPV6" == True ]]; then
  196     # When setting up proper IPv6 networks, we should do it ourselves so we can
  197     # use Neutron Dynamic Routing plugin with address scopes instead of the
  198     # regular Neutron DevStack configuration.
  199     echo "NEUTRON_CREATE_INITIAL_NETWORKS=False" >> $localconf
  200     echo "IP_VERSION=4+6" >> $localconf
  201     echo "MANILA_RESTORE_IPV6_DEFAULT_ROUTE=False" >> $localconf
  202 fi
  203 
  204 if [[ "$DRIVER" == "generic"* ]]; then
  205     echo -e '[[post-config|${NOVA_CONF:-/etc/nova/nova.conf}]]\n[DEFAULT]\nquota_instances=30\n' >> $localconf
  206     echo -e '[[post-config|${NEUTRON_CONF:-/etc/neutron/neutron.conf}]]\n[DEFAULT]\nmax_fixed_ips_per_port=100\n' >> $localconf
  207     echo -e '[[post-config|${NEUTRON_CONF:-/etc/neutron/neutron.conf}]]\n[QUOTAS]\nquota_subnet=-1\n' >> $localconf
  208 fi
  209 
  210 # Required for "grenade" job that uses devstack config from 'old' directory.
  211 if [[ -d "$BASE/old/devstack" ]]; then
  212     cp $localconf $BASE/old/devstack/local.conf
  213 fi
  214 
  215 cd $BASE/new/tempest
  216 source $BASE/new/manila/contrib/ci/common.sh
  217 
  218 # Print current Tempest status
  219 git status