From 5636057538ab7dc83b7d3c37c914c926c01da9b1 Mon Sep 17 00:00:00 2001 From: Kevin Porter Date: Fri, 18 Oct 2024 15:57:38 -0700 Subject: [PATCH 1/2] Fix to allow non-numeric formats. --- template/7/aerospike.template.conf | 4 ++-- test.sh | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/template/7/aerospike.template.conf b/template/7/aerospike.template.conf index ac92222..2c910f0 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..5e5cf1d 100755 --- a/test.sh +++ b/test.sh @@ -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 } @@ -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" } From 0e651f3ea04a93fd97b196d9be52d9a9e2ba51eb Mon Sep 17 00:00:00 2001 From: Kevin Porter Date: Fri, 18 Oct 2024 16:14:35 -0700 Subject: [PATCH 2/2] Review. --- template/7/aerospike.template.conf | 4 ++-- test.sh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/template/7/aerospike.template.conf b/template/7/aerospike.template.conf index 2c910f0..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 5e5cf1d..5cdc67d 100755 --- a/test.sh +++ b/test.sh @@ -76,8 +76,7 @@ function run_docker() { log_info "------ Running docker image ${IMAGE_TAG} ..." - if [ "${EDITION}" = "community" ] || - version_compare_gt "${version}" "6.1"; then + 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 @@ -177,7 +176,7 @@ function check_container() { 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 + if ((default_ttl == 2592000)); then log_success "Found expected 30d ttl - '${default_ttl}'" else log_failure "Did not find expected 30d ttl - '${default_ttl}'"