"Fossies" - the Fresh Open Source Software Archive

Member "monasca-events-api-2.0.0/monasca_events_api/tests/functional/contrib/post_test_hook.sh" (14 Oct 2020, 3248 Bytes) of package /linux/misc/openstack/monasca-events-api-2.0.0.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 and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
    3 # (C) Copyright 2017 FUJITSU LIMITED
    4 #
    5 # Licensed under the Apache License, Version 2.0 (the "License");
    6 # you may not use this file except in compliance with the License.
    7 # You may obtain a copy of the License at
    8 #
    9 #    http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 # Unless required by applicable law or agreed to in writing, software
   12 # distributed under the License is distributed on an "AS IS" BASIS,
   13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   14 # implied.
   15 # See the License for the specific language governing permissions and
   16 # limitations under the License.
   17 #
   18 
   19 sleep 6
   20 
   21 function load_devstack_utilities {
   22     source $BASE/new/devstack/stackrc
   23     source $BASE/new/devstack/functions
   24     source $BASE/new/devstack/openrc admin admin
   25 }
   26 
   27 function setup_monasca_events_api {
   28 
   29     local constraints="-c ${REQUIRMENTS_DIR}/upper-constraints.txt"
   30 
   31     pushd $TEMPEST_DIR
   32     sudo -EH pip install $constraints -r requirements.txt -r test-requirements.txt
   33     popd;
   34 
   35     pushd $MONASCA_EVENTS_API_DIR
   36     sudo -EH pip install $constraints -r requirements.txt -r test-requirements.txt
   37     sudo -EH python setup.py install
   38     popd;
   39 }
   40 
   41 function set_tempest_conf {
   42 
   43     local conf_file=$TEMPEST_DIR/etc/tempest.conf
   44     pushd $TEMPEST_DIR
   45     oslo-config-generator \
   46         --config-file tempest/cmd/config-generator.tempest.conf \
   47         --output-file $conf_file
   48     popd
   49 
   50     cp -f $DEST/tempest/etc/logging.conf.sample $DEST/tempest/etc/logging.conf
   51 
   52     # set identity section
   53     iniset $conf_file identity admin_domain_scope True
   54     iniset $conf_file identity user_unique_last_password_count 2
   55     iniset $conf_file identity user_locakout_duration 5
   56     iniset $conf_file identity user_lockout_failure_attempts 2
   57     iniset $conf_file identity uri $OS_AUTH_URL/v2.0
   58     iniset $conf_file identity uri_v3 $OS_AUTH_URL/v3
   59     iniset $conf_file identity auth_version v$OS_IDENTITY_API_VERSION
   60     # set auth section
   61     iniset $conf_file auth use_dynamic_credentials True
   62     iniset $conf_file auth admin_username $OS_USERNAME
   63     iniset $conf_file auth admin_password $OS_PASSWORD
   64     iniset $conf_file auth admin_domain_name $OS_PROJECT_DOMAIN_ID
   65     iniset $conf_file auth admin_project_name $OS_PROJECT_NAME
   66 
   67 }
   68 
   69 function function_exists {
   70     declare -f -F $1 > /dev/null
   71 }
   72 
   73 if ! function_exists echo_summary; then
   74     function echo_summary {
   75         echo $@
   76     }
   77 fi
   78 
   79 XTRACE=$(set +o | grep xtrace)
   80 set -o xtrace
   81 
   82 echo_summary "monasca's events post_test_hook.sh was called..."
   83 (set -o posix; set)
   84 
   85 # save ref to monasca-api dir
   86 export MONASCA_EVENTS_API_DIR="$BASE/new/monasca-events-api"
   87 export TEMPEST_DIR="$BASE/new/tempest"
   88 
   89 sudo chown -R $USER:stack $MONASCA_EVENTS_API_DIR
   90 sudo chown -R $USER:stack $TEMPEST_DIR
   91 
   92 load_devstack_utilities
   93 setup_monasca_events_api
   94 set_tempest_conf
   95 
   96 (cd $TEMPEST_DIR; testr init)
   97 (cd $TEMPEST_DIR; testr list-tests monasca_events_api/tests/functional > monasca_tempest_tests)
   98 (cd $TEMPEST_DIR; cat monasca_tempest_tests)
   99 (cd $TEMPEST_DIR; cat monasca_tempest_tests | grep gate > monasca_tempest_tests_gate)
  100 (cd $TEMPEST_DIR; testr run --subunit --load-list=monasca_tempest_tests_gate | subunit-trace --fails)