Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,23 @@ source "${_testlib_dir}/../smoketest/testlib.sh"
: ${SECURITY_ENABLED:=false}
: ${SCM:=scm}

# version is used in bucket name, which does not allow uppercase
export OZONE_CURRENT_VERSION="$(echo "${ozone.version}" | sed -e 's/-SNAPSHOT//' | tr '[:upper:]' '[:lower:]')"
# Check if running from output of Maven build or from source
_is_build() {
local file=""
# Variable is replaced by Maven at build time,
# so if it empty, we are running from source, if non-empty, then running in build output (target)
[[ -n "${file}" ]]
}

# Avoid `bad substitution` error
if _is_build; then
# version is used in bucket name, which does not allow uppercase
# variable is replaced by Maven at build time
OZONE_CURRENT_VERSION="$(echo "${ozone.version}" | sed -e 's/-SNAPSHOT//' | tr '[:upper:]' '[:lower:]')"
else
OZONE_CURRENT_VERSION=src
fi
export OZONE_CURRENT_VERSION

# create temp directory for test data; only once, even if testlib.sh is sourced again
if [[ -z "${TEST_DATA_DIR:-}" ]] && [[ "${KEEP_RUNNING:-false}" == "false" ]]; then
Expand Down