Skip to content

Commit

Permalink
Fix to allow non-numeric formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
kportertx committed Oct 18, 2024
1 parent 4220a37 commit 5636057
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions template/7/aerospike.template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ network {

namespace ${NAMESPACE} {
replication-factor 1
$( (("${DEFAULT_TTL}" != 0 )) && echo "default-ttl ${DEFAULT_TTL}")
$( (("${DEFAULT_TTL}" != 0 )) && echo "nsup-period ${NSUP_PERIOD}")
$( [[ "${DEFAULT_TTL}" != "0" ]] && echo "default-ttl ${DEFAULT_TTL}")
$( [[ "${DEFAULT_TTL}" != "0" ]] && echo "nsup-period ${NSUP_PERIOD}")

storage-engine $([ "${DATA_IN_MEMORY}" = "true" ] && echo "memory" || echo "device") {
# For 'storage-engine memory' with 'device' or 'file' backing, we
Expand Down
22 changes: 16 additions & 6 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ function run_docker() {

log_info "------ Running docker image ${IMAGE_TAG} ..."

if [ "${EDITION}" = "community" ] || version_compare_gt "${version}" "6.1"; then
verbose_call docker run -td --name "${CONTAINER}" "${PLATFORM/#/"--platform="}" \
"${IMAGE_TAG}"
if [ "${EDITION}" = "community" ] ||
version_compare_gt "${version}" "6.1"; then
verbose_call docker run -td --name "${CONTAINER}" -e "DEFAULT_TTL=30d" \
"${PLATFORM/#/"--platform="}" "${IMAGE_TAG}"
else
# Must supply a feature key when version is prior to 6.1.
verbose_call docker run -td --name "${CONTAINER}" "${PLATFORM/#/"--platform="}" \
-v "/$(pwd)/res/":/asfeat/ -e "FEATURE_KEY_FILE=/asfeat/eval_features.conf" \
"${IMAGE_TAG}"
verbose_call docker run -td --name "${CONTAINER}" \
"${PLATFORM/#/"--platform="}" -v "/$(pwd)/res/":/asfeat/ \
-e "DEFAULT_TTL=30d" \
-e "FEATURE_KEY_FILE=/asfeat/eval_features.conf" "${IMAGE_TAG}"
fi
}

Expand Down Expand Up @@ -173,6 +175,14 @@ function check_container() {
log_failure "**(${tool}) Aerospike database does not have namespace 'test' - '${namespace}'"
fi

default_ttl=$(try 5 docker exec -t "${CONTAINER}" bash -c 'asinfo -v "get-config:context=namespace;id=test" -l' | grep default-ttl | grep -oE "[0-9]+")

if (( ${default_ttl} == 2592000 )); then
log_success "Found expected 30d ttl - '${default_ttl}'"
else
log_failure "Did not find expected 30d ttl - '${default_ttl}'"
fi

log_info "------ Verify docker image completed successfully"
}

Expand Down

0 comments on commit 5636057

Please sign in to comment.