diff --git a/template/7/aerospike.template.conf b/template/7/aerospike.template.conf index ac92222..7959cee 100644 --- a/template/7/aerospike.template.conf +++ b/template/7/aerospike.template.conf @@ -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 diff --git a/test.sh b/test.sh index efa0349..5cdc67d 100755 --- a/test.sh +++ b/test.sh @@ -77,13 +77,14 @@ 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}" + 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 } @@ -173,6 +174,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" }