Skip to content

Commit

Permalink
Merge pull request #107 from lpiwowar/fix/tempest-params
Browse files Browse the repository at this point in the history
Revert "Revert "Merge pull request #96 from lpiwowar/feature/tempest-…
  • Loading branch information
openshift-merge-bot[bot] authored Dec 11, 2023
2 parents 9f82a1f + a054545 commit bc294ef
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions container-images/tcib/base/os/tempest/run_tempest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ set -x

HOMEDIR=/var/lib/tempest
TEMPEST_DIR=$HOMEDIR/openshift
PROFILE_ARG=""
TEMPEST_PATH=$HOMEDIR/
CONCURRENCY="${CONCURRENCY:-}"

TEMPESTCONF_ARGS=""
TEMPEST_ARGS=""

[[ ! -z ${USE_EXTERNAL_FILES} ]] && TEMPEST_PATH=$HOMEDIR/external_files/

[[ ${TEMPESTCONF_CREATE:=true} == true ]] && TEMPESTCONF_ARGS+="--create "
[[ ${TEMPESTCONF_INSECURE} == true ]] && TEMPESTCONF_ARGS+="--insecure "
Expand All @@ -32,6 +34,18 @@ TEMPESTCONF_ARGS=""
[[ ! -z ${TEMPESTCONF_FLAVOR_MIN_DISK} ]] && TEMPESTCONF_ARGS+="--flavor-min-disk ${TEMPESTCONF_FLAVOR_MIN_DISK} "
[[ ! -z ${TEMPESTCONF_NETWORK_ID} ]] && TEMPESTCONF_ARGS+="--network-id ${TEMPESTCONF_NETWORK_ID} "

# Tempest arguments
[[ ${TEMPEST_SMOKE} == true ]] && TEMPEST_ARGS+="--smoke "
[[ ${TEMPEST_PARALLEL:=true} == true ]] && TEMPEST_ARGS+="--parallel "
[[ ${TEMPEST_SERIAL} == true ]] && TEMPEST_ARGS+="--serial "

[[ ! -z ${TEMPEST_INCLUDE_LIST} ]] && TEMPEST_ARGS+="--include-list ${TEMPEST_INCLUDE_LIST} "
[[ ! -z ${TEMPEST_EXCLUDE_LIST} ]] && TEMPEST_ARGS+="--exclude-list ${TEMPEST_EXCLUDE_LIST} "
[[ ! -z ${TEMPEST_CONCURRENCY} ]] && TEMPEST_ARGS+="--concurrency ${TEMPEST_CONCURRENCY} "
[[ ! -z ${TEMPEST_WORKER_FILE} ]] && TEMPEST_ARGS+="--worker-file ${TEMPEST_WORKER_FILE} "
[[ -z ${TEMPEST_INCLUDE_LIST} ]] && TEMPEST_ARGS+="--include-list ${TEMPEST_PATH}include.txt "
[[ -z ${TEMPEST_EXCLUDE_LIST} ]] && TEMPEST_ARGS+="--exclude-list ${TEMPEST_PATH}exclude.txt "

if [[ ! -z ${TEMPESTCONF_APPEND} ]]; then
while IFS= read -r line; do
TEMPESTCONF_ARGS+="--append $line "
Expand All @@ -46,13 +60,15 @@ fi

TEMPESTCONF_OVERRIDES="$(echo ${TEMPESTCONF_OVERRIDES} | tr '\n' ' ') identity.v3_endpoint_type public"

if [ -n "$CONCURRENCY" ] && [ -z ${TEMPEST_CONCURRENCY} ]; then
TEMPEST_ARGS+="--concurrency ${CONCURRENCY} "
fi

pushd $HOMEDIR

export OS_CLOUD=default

TEMPEST_PATH=$HOMEDIR/
if [ ! -z ${USE_EXTERNAL_FILES} ]; then
TEMPEST_PATH=$HOMEDIR/external_files/
mkdir -p $HOME/.config/openstack
cp ${TEMPEST_PATH}clouds.yaml $HOME/.config/openstack/clouds.yaml
fi
Expand All @@ -61,25 +77,20 @@ if [ -f ${TEMPEST_PATH}profile.yaml ] && [ -z ${TEMPESTCONF_PROFILE} ]; then
TEMPESTCONF_ARGS+="--profile ${TEMPEST_PATH}profile.yaml "
fi

tempest init openshift

pushd $TEMPEST_DIR
discover-tempest-config ${TEMPESTCONF_ARGS} ${TEMPESTCONF_OVERRIDES}

if [ ! -f ${TEMPEST_PATH}include.txt ]; then
if [ ! -f ${TEMPEST_PATH}include.txt ] && [ -z ${TEMPEST_INCLUDE_LIST} ]; then
echo "tempest.api.identity.v3" > ${TEMPEST_PATH}include.txt
fi
if [ ! -f ${TEMPEST_PATH}exclude.txt ]; then

if [ ! -f ${TEMPEST_PATH}exclude.txt ] && [ -z ${TEMPEST_EXCLUDE_LIST} ]; then
touch ${TEMPEST_PATH}exclude.txt
fi

if [ -n "$CONCURRENCY" ]; then
CONCURRENCY_ARGS="--concurrency ${CONCURRENCY}"
fi
tempest init openshift

pushd $TEMPEST_DIR
discover-tempest-config ${TEMPESTCONF_ARGS} ${TEMPESTCONF_OVERRIDES}

tempest run ${CONCURRENCY_ARGS:-} \
--include-list ${TEMPEST_PATH}include.txt \
--exclude-list ${TEMPEST_PATH}exclude.txt
tempest run ${TEMPEST_ARGS}

RETURN_VALUE=$?

Expand Down

0 comments on commit bc294ef

Please sign in to comment.