From ccafc64d3c707cd2a23477b33552ada31961ef96 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 12:28:23 -0700 Subject: [PATCH 01/22] Seperatng test concerns. --- travis/regression_test_script | 8 +- travis/test_hyrax_service_version | 146 +++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 6 deletions(-) diff --git a/travis/regression_test_script b/travis/regression_test_script index 02728fbf..3f3be7b2 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -555,10 +555,10 @@ function run_the_tests() { loggy "$prolog wait_for_hyrax status: $wait_for_hyrax_status" if test $wait_for_hyrax_status -ne 0; then exit $wait_for_hyrax_status; fi - check_version "$DOCKER_ID" "$HYRAX_END_POINT" "$EXPECTED_HYRAX_VERSION" - local check_version_status=$? - loggy "$prolog check_version status: $check_version_status" - if test $check_version_status -ne 0; then exit $check_version_status; fi + $TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "$HYRAX_END_POINT" "$EXPECTED_HYRAX_VERSION" + local test_status=$? + loggy "$prolog test_hyrax_service_version status: $test_status" + if test $test_status -ne 0; then exit $test_status; fi run_regression_tests "$TEST_IMAGE_NAME" "$HYRAX_END_POINT" "$DOCKER_ID" local run_regression_tests_status=$? diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 04829372..9ce39bca 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -57,6 +57,148 @@ function test_hyrax_version_response(){ return 0 } -# test_hyrax_service_version +function check_contents_html_version(){ + + local end_point_url="$1" + if test -z "$end_point_url"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" + return 2 + fi + + local expected_hyrax_version="$2" + if test -z "$expected_hyrax_version"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" + return 3 + fi + + local status + local contents_url="$end_point_url/hyrax/contents.html" + + ##################################################################### + # Check contents.html + # + loggy "$HR1" + loggy "$prolog Checking contents.html for correct Hyrax version." + some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" + # loggy "$prolog $contents_url: " + # loggy "$some_page" + echo "$some_page" | grep "$expected_hyrax_version" + status=$? + if test $status -ne 0 + then + loggy "$prolog ERROR! The expected version string as not found in the contents.html page." + return $status + fi +} + + +######################################################################################################### +# test_HyraxVersion_class_endpoints() +# Verify that we have the expected server version +function test_HyraxVersion_class_endpoints() { + local prolog="test_HyraxVersion_class_endpoints() -" + loggy "$HR0" + loggy "$prolog BEGIN" + + local end_point_url="$1" + if test -z "$end_point_url"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" + return 2 + fi + loggy "$prolog end_point_url: $end_point_url" + + local expected_hyrax_version="$2" + if test -z "$expected_hyrax_version"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" + return 3 + fi + loggy "$prolog expected_hyrax_version: $expected_hyrax_version" + + local status + local some_page + + ##################################################################### + # Check contents.html + # + loggy "$HR1" + loggy "$prolog Checking contents.html for correct Hyrax version." + local contents_url="$end_point_url/hyrax/contents.html" + loggy "$prolog contents_url: $contents_url" + some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" + # loggy "$prolog $contents_url: " + # loggy "$some_page" + echo "$some_page" | grep "$expected_hyrax_version" + status=$? + if test $status -ne 0 + then + loggy "$prolog ERROR! The expected version string as not found in the contents.html page." + return $status + fi + + ##################################################################### + # Check DAP4 Data Request Form + # + loggy "$HR1" + loggy "$prolog Checking DAP4 Data Request Form page for correct version." + local ifh_url="$end_point_url/hyrax/data/nc/fnoc1.nc.dmr.html" + loggy "$prolog ifh_url: $ifh_url" + some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$ifh_url")" + # loggy "$prolog $ifh_url: " + # loggy "$some_page" + echo "$some_page" | grep "$expected_hyrax_version" + status=$? + if test $status -ne 0 + then + loggy "$prolog ERROR! The expected version string as not found in the Data Request Form page." + return $status + fi + + loggy "$prolog END" + loggy "$HR0" + return 0 +} + + +######################################################################################################### +######################################################################################################### +######################################################################################################### +######################################################################################################### + + +############################################################################# +# Processing Command Line Options (Inline Execution) +# +prolog="test_docker_image_version[] -" + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + # Run the script invoked as an application, + loggy "$HR0" + loggy "$prolog BEGIN" + + end_point_url="$1" + if test -z "$end_point_url"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" + return 2 + fi + + expected_hyrax_version="$2" + if test -z "$expected_hyrax_version"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" + return 3 + fi + + + set -e + test_hyrax_version_response "$end_point_url" "$expected_hyrax_version" + test_HyraxVersion_class_endpoints "$end_point_url" "$expected_hyrax_version" + + + loggy "$prolog END" + loggy "$HR0" +else + # Otherwise... + # Just source it into the current shell. + loggy "$prolog SUCCESS! The test_docker_image_version functions have been loaded in to the current shell." +fi + -test_hyrax_version_response $1 $2 From a8b3678ad91edf9425284c3cde20a56be5375fe6 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 12:41:39 -0700 Subject: [PATCH 02/22] Removing unused code from regression_test_script --- travis/regression_test_script | 167 ++---------------------------- travis/test_hyrax_service_version | 4 + 2 files changed, 10 insertions(+), 161 deletions(-) diff --git a/travis/regression_test_script b/travis/regression_test_script index 3f3be7b2..de98b72a 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -255,163 +255,6 @@ function clean_and_start() { loggy "$HR0" } -######################################################################################################### -# check_version() -# Verify that we have the expected server version -function check_version() { - local prolog="check_version() -" - loggy "$HR0" - loggy "$prolog BEGIN" - - local d_id="$1" - if test -z "$d_id"; then - loggy "$prolog ERROR! You must pass valid docker id as parameter 1" - return 1 - fi - - local end_point_url="$2" - if test -z "$end_point_url"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" - return 2 - fi - - local expected_hyrax_version="$3" - if test -z "$expected_hyrax_version"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" - return 3 - fi - - local docker_version_label - local docker_version_status - local status - local version_url - local version_response - local hyrax_version_value - local version_url="$end_point_url/hyrax/version" - local contents_url="$end_point_url/hyrax/contents.html" - local ifh_url="$end_point_url/hyrax/data/nc/fnoc1.nc.dmr.html" - - ##################################################### - # Get Hyrax version response from the running server - loggy "$prolog Retrieving Hyrax Version Response from: '$version_url'" - version_response="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$version_url")" - loggy "$prolog Hyrax Version Response:" - loggy "$version_response" - loggy "$HR1" - - ############################################################ - # Verify Hyrax Version Injection - # Get this line from the version response: - # - # and then use awk to get the actual value of ########## - hyrax_version_value="$(echo "$version_response" | grep " Date: Mon, 30 Mar 2026 13:10:48 -0700 Subject: [PATCH 03/22] Removing unused code from regression_test_script --- travis/test_hyrax_service_version | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index e686db9a..49202164 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -58,6 +58,8 @@ function test_hyrax_version_response(){ } function check_contents_html_version(){ + local prolog="check_contents_html_version() -" + loggy "$prolog BEGIN" local end_point_url="$1" if test -z "$end_point_url"; then @@ -89,6 +91,7 @@ function check_contents_html_version(){ loggy "$prolog ERROR! The expected version string as not found in the contents.html page." return $status fi + loggy "$prolog END" } @@ -172,7 +175,7 @@ function test_HyraxVersion_class_endpoints() { ############################################################################# # Processing Command Line Options (Inline Execution) # -prolog="test_docker_image_version[] -" +prolog="test_hyrax_service_version[] -" if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Run the script invoked as an application, @@ -202,7 +205,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then else # Otherwise... # Just source it into the current shell. - loggy "$prolog SUCCESS! The test_docker_image_version functions have been loaded in to the current shell." + loggy "$prolog SUCCESS! The test_hyrax_service_version functions have been loaded in to the current shell." fi From 7cacab457a2fba77850e491aa91604793b9ec909 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 13:23:03 -0700 Subject: [PATCH 04/22] Removing unused code from regression_test_script --- .travis.yml | 2 ++ travis/regression_test_script | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c458303a..d1008f10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,6 +119,8 @@ jobs: - echo "Running Test Scripts" - ./travis/test_docker_image_version "$OS_BUILD_VERSION_TAG" - ./travis/regression_test_script -i "$OS_SNAPSHOT_IMAGE_TAG" -l "$TESTS_LOG_BASE" -V "$HYRAX_WEB_UI_VERSION" + - $TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "http://localhost:8080/opendap" "$HYRAX_WEB_UI_VERSION" + - stage: BUILD name: "Build opendap/besd" diff --git a/travis/regression_test_script b/travis/regression_test_script index de98b72a..64b7da81 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -409,7 +409,6 @@ function run_the_tests() { loggy "$prolog test_hyrax_service_version status: $test_status" if test $test_status -ne 0; then exit $test_status; fi - test_beslog2json "$DOCKER_ID" local test_beslog2json_status=$? loggy "$prolog test_beslog2json status: $test_beslog2json_status" From 6d4dddb72019cbc7698d1cdabfedace803f4acec Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 13:35:51 -0700 Subject: [PATCH 05/22] Removing unused code from regression_test_script --- travis/regression_test_script | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/travis/regression_test_script b/travis/regression_test_script index 64b7da81..472a711e 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -10,6 +10,13 @@ set -e # -i "$OS_BUILD_VERSION_TAG" \ # -l "deployed-image-regression-tests-$TRAVIS_JOB_NUMBER" # +# This script starts the target docker image and then runs the +# hyrax_regression_tests on the new server. +# +# !! NOTE !! +# As written this script leaves the docker container running so that downstream +# service tests can be easily run. +# HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" HR2="--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---" From d031951ba937972b7df172a3b0f9a7cec9dac1e4 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 13:44:06 -0700 Subject: [PATCH 06/22] Cleanup --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1008f10..7face288 100644 --- a/.travis.yml +++ b/.travis.yml @@ -143,8 +143,8 @@ jobs: - docker image ls -a - cd "$TRAVIS_BUILD_DIR" - echo "Running Test Scripts" - - ./travis/test_docker_image_version "$OS_BUILD_VERSION_TAG" - ./travis/test_image_starts_without_crashing.sh "$OS_BUILD_VERSION_TAG" + - ./travis/test_docker_image_version "$OS_BUILD_VERSION_TAG" - stage: BUILD name: "Build opendap/hyrax_ncwms" @@ -235,6 +235,7 @@ jobs: - cd "$TRAVIS_BUILD_DIR" - echo "Running Hyrax Regression Test Script on $OS_BUILD_VERSION_TAG" >&2 - $TRAVIS_BUILD_DIR/travis/regression_test_script -V "$HYRAX_WEB_UI_VERSION" -i "$OS_BUILD_VERSION_TAG" -l "deployed-image-regression-tests-$TRAVIS_JOB_NUMBER" + - $TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "http://localhost:8080/opendap" "$HYRAX_WEB_UI_VERSION" - export DEPLOY_ME="false" after_success: From 5ef8094e058bf274c495054f66a34c895ea84a0f Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 13:45:34 -0700 Subject: [PATCH 07/22] Cleanup --- travis/regression_test_script | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis/regression_test_script b/travis/regression_test_script index 472a711e..695fb344 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -411,10 +411,10 @@ function run_the_tests() { if test $run_regression_tests_status -ne 0; then exit $run_regression_tests_status; fi # We run this here because we have a running Hyrax server to interrogate. - $TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "$HYRAX_END_POINT" "$EXPECTED_HYRAX_VERSION" - local test_status=$? - loggy "$prolog test_hyrax_service_version status: $test_status" - if test $test_status -ne 0; then exit $test_status; fi + #$TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "$HYRAX_END_POINT" "$EXPECTED_HYRAX_VERSION" + #local test_status=$? + #loggy "$prolog test_hyrax_service_version status: $test_status" + #if test $test_status -ne 0; then exit $test_status; fi test_beslog2json "$DOCKER_ID" local test_beslog2json_status=$? From 37936523751d23fe54c9424c7016f571392dce5e Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Mon, 30 Mar 2026 14:16:25 -0700 Subject: [PATCH 08/22] Cleanup --- travis/regression_test_script | 6 ------ 1 file changed, 6 deletions(-) diff --git a/travis/regression_test_script b/travis/regression_test_script index 695fb344..f33622af 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -410,12 +410,6 @@ function run_the_tests() { loggy "$prolog run_regression_tests status: $run_regression_tests_status" if test $run_regression_tests_status -ne 0; then exit $run_regression_tests_status; fi - # We run this here because we have a running Hyrax server to interrogate. - #$TRAVIS_BUILD_DIR/travis/test_hyrax_service_version "$HYRAX_END_POINT" "$EXPECTED_HYRAX_VERSION" - #local test_status=$? - #loggy "$prolog test_hyrax_service_version status: $test_status" - #if test $test_status -ne 0; then exit $test_status; fi - test_beslog2json "$DOCKER_ID" local test_beslog2json_status=$? loggy "$prolog test_beslog2json status: $test_beslog2json_status" From afa8ad232e2d4d41a2014eaa539c4a21e25b0a69 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 07:33:56 -0700 Subject: [PATCH 09/22] Cleanup --- travis/test_docker_image_version | 5 +++-- travis/test_hyrax_service_version | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/travis/test_docker_image_version b/travis/test_docker_image_version index 92cea459..938ee29e 100755 --- a/travis/test_docker_image_version +++ b/travis/test_docker_image_version @@ -187,10 +187,11 @@ function test_docker_hyrax_versions() { ################################################################# # The NGAP build has a static landing page that needs to match. if test "$DOCKER_NAME" = "ngap"; then - test_file_in_docker_image "$d_id" "/usr/share/tomcat/webapps/$deployment_context/docs/ngap/ngap.html" "$expected_version_str" + local ngap_html="/usr/share/tomcat/webapps/$deployment_context/docs/ngap/ngap.html" + test_file_in_docker_image "$d_id" "$ngap_html" "$expected_version_str" status=$? if test $status -ne 0; then - loggy "$prolog ERROR! The expected version string was not found in the file." + loggy "$prolog ERROR! The expected version string was not found in: '$ngap_html'" return $status fi fi diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 49202164..71af89a9 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -90,6 +90,8 @@ function check_contents_html_version(){ then loggy "$prolog ERROR! The expected version string as not found in the contents.html page." return $status + else + loggy "$prolog SUCCESS! The contents.html response contained the expected_hyrax_version: '$expected_hyrax_version'" fi loggy "$prolog END" } From b3cab965c03e98dc08ecca66b3db0e1c0a89908b Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 09:06:45 -0700 Subject: [PATCH 10/22] Cleanup --- travis/test_hyrax_service_version | 115 +++++++++++++++++++----------- 1 file changed, 75 insertions(+), 40 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 71af89a9..3bf6d5ea 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -1,4 +1,20 @@ #!/bin/bash +############################################################################# +# test_hyrax_service_version +# +# Travis invocation: +# +# - $TRAVIS_BUILD_DIR/travis/test_hyrax_service_version \ +# "http://localhost:8080/opendap" \ +# "$HYRAX_WEB_UI_VERSION" +# +# This script tests a running Hyrax service to see if various HTTP responses +# contain the expected version information. +# +# !! NOTE !! +# As written this script leaves the docker container running so that downstream +# service tests can be easily run. +# HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" @@ -9,6 +25,10 @@ function loggy() { echo "$@" | awk '{ print "# "$0;}' >&2 } +############################################################################# +# test_hyrax_version_response() +# Test the Hyrax version response document for the +# expected version string. function test_hyrax_version_response(){ local prolog="test_hyrax_version_response() -" loggy "$HR1" @@ -57,43 +77,48 @@ function test_hyrax_version_response(){ return 0 } -function check_contents_html_version(){ +############################################################################# +# check_contents_html_version() +# Test one of the contents.html responses (dynamic) for the presence of the +# expected_hyrax_version string +function test_response_content(){ local prolog="check_contents_html_version() -" loggy "$prolog BEGIN" - local end_point_url="$1" - if test -z "$end_point_url"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" - return 2 + local test_url="$1" + if test -z "$test_url"; then + loggy "$prolog ERROR! You must pass a test url string as parameter 1" + return 1 fi - local expected_hyrax_version="$2" - if test -z "$expected_hyrax_version"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" - return 3 + local expected_string="$2" + if test -z "$expected_string"; then + loggy "$prolog ERROR! You must pass an expected string as parameter 2" + return 2 fi local status - local contents_url="$end_point_url/hyrax/contents.html" + local some_page ##################################################################### # Check contents.html # - loggy "$HR1" - loggy "$prolog Checking contents.html for correct Hyrax version." - some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" + loggy "$prolog Checking '$test_url' for correct the expected string: '$expected_string'" + some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$test_url")" # loggy "$prolog $contents_url: " # loggy "$some_page" - echo "$some_page" | grep "$expected_hyrax_version" + echo "$some_page" | grep "$expected_string" status=$? if test $status -ne 0 then - loggy "$prolog ERROR! The expected version string as not found in the contents.html page." + loggy "$prolog ERROR! The expected string: '$expected_string' was not found in the '$test_url' page." return $status else - loggy "$prolog SUCCESS! The contents.html response contained the expected_hyrax_version: '$expected_hyrax_version'" + loggy "$prolog SUCCESS! The test url: '$test_url' response contained the expected string: '$expected_string'" fi + loggy "$prolog END" + return 0 } @@ -120,47 +145,57 @@ function test_HyraxVersion_class_endpoints() { loggy "$prolog expected_hyrax_version: $expected_hyrax_version" local status - local some_page +# local some_page + ##################################################################### # Check contents.html # - loggy "$HR1" - loggy "$prolog Checking contents.html for correct Hyrax version." + loggy "$prolog Checking a contents.html page for the expected version string." local contents_url="$end_point_url/hyrax/contents.html" loggy "$prolog contents_url: $contents_url" - some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" + test_response_content "$contents_url" "$expected_hyrax_version" + +# loggy "$HR1" +# loggy "$prolog Checking contents.html for correct Hyrax version." +# local contents_url="$end_point_url/hyrax/contents.html" +# loggy "$prolog contents_url: $contents_url" +# some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" # loggy "$prolog $contents_url: " # loggy "$some_page" - echo "$some_page" | grep "$expected_hyrax_version" - status=$? - if test $status -ne 0 - then - loggy "$prolog ERROR! The expected version string as not found in the contents.html page." - return $status - else - loggy "$prolog SUCCESS! The the '$contents_url' response contained the version string: '$expected_hyrax_version'" - fi +# echo "$some_page" | grep "$expected_hyrax_version" +# status=$? +# if test $status -ne 0 +# then +# loggy "$prolog ERROR! The expected version string as not found in the contents.html page." +# return $status +# else +# loggy "$prolog SUCCESS! The '$contents_url' response contained the version string: '$expected_hyrax_version'" +# fi + + + ##################################################################### # Check DAP4 Data Request Form # loggy "$HR1" + test_response_content "$ifh_url" "$expected_hyrax_version" loggy "$prolog Checking DAP4 Data Request Form page for correct version." - local ifh_url="$end_point_url/hyrax/data/nc/fnoc1.nc.dmr.html" loggy "$prolog ifh_url: $ifh_url" - some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$ifh_url")" + +# some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$ifh_url")" # loggy "$prolog $ifh_url: " # loggy "$some_page" - echo "$some_page" | grep "$expected_hyrax_version" - status=$? - if test $status -ne 0 - then - loggy "$prolog ERROR! The expected version string as not found in the Data Request Form page." - return $status - else - loggy "$prolog SUCCESS! The the '$ifh_url' response contained the version string: '$expected_hyrax_version'" - fi +# echo "$some_page" | grep "$expected_hyrax_version" +# status=$? +# if test $status -ne 0 +# then +# loggy "$prolog ERROR! The expected version string as not found in the Data Request Form page." +# return $status +# else +# loggy "$prolog SUCCESS! The the '$ifh_url' response contained the version string: '$expected_hyrax_version'" +# fi loggy "$prolog END" loggy "$HR0" From b4604a99c2bfe5bea4ac79b0da7e1d48e8829275 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 09:14:48 -0700 Subject: [PATCH 11/22] Cleanup --- travis/test_hyrax_service_version | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 3bf6d5ea..294bcee0 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -78,11 +78,11 @@ function test_hyrax_version_response(){ } ############################################################################# -# check_contents_html_version() +# test_response_content() # Test one of the contents.html responses (dynamic) for the presence of the # expected_hyrax_version string function test_response_content(){ - local prolog="check_contents_html_version() -" + local prolog="test_response_content() -" loggy "$prolog BEGIN" local test_url="$1" @@ -132,15 +132,15 @@ function test_HyraxVersion_class_endpoints() { local end_point_url="$1" if test -z "$end_point_url"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" - return 2 + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 1" + return 1 fi loggy "$prolog end_point_url: $end_point_url" local expected_hyrax_version="$2" if test -z "$expected_hyrax_version"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 3" - return 3 + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" + return 2 fi loggy "$prolog expected_hyrax_version: $expected_hyrax_version" @@ -153,7 +153,7 @@ function test_HyraxVersion_class_endpoints() { # loggy "$prolog Checking a contents.html page for the expected version string." local contents_url="$end_point_url/hyrax/contents.html" - loggy "$prolog contents_url: $contents_url" + loggy "$prolog Using contents_url: $contents_url" test_response_content "$contents_url" "$expected_hyrax_version" # loggy "$HR1" @@ -180,9 +180,10 @@ function test_HyraxVersion_class_endpoints() { # Check DAP4 Data Request Form # loggy "$HR1" - test_response_content "$ifh_url" "$expected_hyrax_version" loggy "$prolog Checking DAP4 Data Request Form page for correct version." - loggy "$prolog ifh_url: $ifh_url" + local ifh_url="$end_point_url/hyrax/data/nc/fnoc1.nc.dmr.html" + loggy "$prolog Using ifh_url: $ifh_url" + test_response_content "$ifh_url" "$expected_hyrax_version" # some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$ifh_url")" # loggy "$prolog $ifh_url: " From a6419b8f89a6b1b1a92ffd3aba2d9d1edd7cfbf7 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 09:37:09 -0700 Subject: [PATCH 12/22] Cleanup --- travis/test_hyrax_service_version | 128 ++++++++++++------------------ 1 file changed, 50 insertions(+), 78 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 294bcee0..0aeaa962 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -25,6 +25,51 @@ function loggy() { echo "$@" | awk '{ print "# "$0;}' >&2 } + +############################################################################# +# test_response_content() +# Test one of the contents.html responses (dynamic) for the presence of the +# expected_hyrax_version string +function test_response_content(){ + local prolog="test_response_content() -" + loggy "$HR1" + loggy "$prolog BEGIN" + + local test_url="$1" + if test -z "$test_url"; then + loggy "$prolog ERROR! You must pass a test url string as parameter 1" + return 1 + fi + + local expected_string="$2" + if test -z "$expected_string"; then + loggy "$prolog ERROR! You must pass an expected string as parameter 2" + return 2 + fi + + local status + local some_page + + ##################################################################### + # Check contents.html + # + loggy "$prolog Checking '$test_url' for correct the expected string: '$expected_string'" + some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$test_url")" + # loggy "$prolog $contents_url: " + # loggy "$some_page" + echo "$some_page" | grep "$expected_string" + status=$? + if test $status -ne 0 + then + loggy "$prolog ERROR! The expected string: '$expected_string' was not found in the '$test_url' page." + return $status + else + loggy "$prolog SUCCESS! The test url: '$test_url' response contained the expected string: '$expected_string'" + fi + loggy "$prolog END" + return 0 +} + ############################################################################# # test_hyrax_version_response() # Test the Hyrax version response document for the @@ -42,11 +87,12 @@ function test_hyrax_version_response(){ local version_url="$end_point_url/hyrax/version" - loggy "$prolog version_url: $end_point_url" + loggy "$prolog version_url: $version_url" ##################################################### # Get Hyrax version response from the running server loggy "$prolog Retrieving Hyrax Version Response from: '$version_url'" + local version_response version_response="$(curl -s -c cookies -b cookies -n $NETRC_FILE -L "$version_url")" loggy "$prolog Hyrax Version Response:" loggy "$version_response" @@ -72,52 +118,11 @@ function test_hyrax_version_response(){ in this production environment!" return 1 fi - loggy "$prolog END" - loggy "$HR1" - return 0 -} - -############################################################################# -# test_response_content() -# Test one of the contents.html responses (dynamic) for the presence of the -# expected_hyrax_version string -function test_response_content(){ - local prolog="test_response_content() -" - loggy "$prolog BEGIN" - - local test_url="$1" - if test -z "$test_url"; then - loggy "$prolog ERROR! You must pass a test url string as parameter 1" - return 1 - fi - - local expected_string="$2" - if test -z "$expected_string"; then - loggy "$prolog ERROR! You must pass an expected string as parameter 2" - return 2 - fi - local status - local some_page - - ##################################################################### - # Check contents.html - # - loggy "$prolog Checking '$test_url' for correct the expected string: '$expected_string'" - some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$test_url")" - # loggy "$prolog $contents_url: " - # loggy "$some_page" - echo "$some_page" | grep "$expected_string" - status=$? - if test $status -ne 0 - then - loggy "$prolog ERROR! The expected string: '$expected_string' was not found in the '$test_url' page." - return $status - else - loggy "$prolog SUCCESS! The test url: '$test_url' response contained the expected string: '$expected_string'" - fi + test_response_content "$version_url" "$expected_version_str" loggy "$prolog END" + loggy "$HR1" return 0 } @@ -145,8 +150,6 @@ function test_HyraxVersion_class_endpoints() { loggy "$prolog expected_hyrax_version: $expected_hyrax_version" local status -# local some_page - ##################################################################### # Check contents.html @@ -156,25 +159,6 @@ function test_HyraxVersion_class_endpoints() { loggy "$prolog Using contents_url: $contents_url" test_response_content "$contents_url" "$expected_hyrax_version" -# loggy "$HR1" -# loggy "$prolog Checking contents.html for correct Hyrax version." -# local contents_url="$end_point_url/hyrax/contents.html" -# loggy "$prolog contents_url: $contents_url" -# some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$contents_url")" - # loggy "$prolog $contents_url: " - # loggy "$some_page" -# echo "$some_page" | grep "$expected_hyrax_version" -# status=$? -# if test $status -ne 0 -# then -# loggy "$prolog ERROR! The expected version string as not found in the contents.html page." -# return $status -# else -# loggy "$prolog SUCCESS! The '$contents_url' response contained the version string: '$expected_hyrax_version'" -# fi - - - ##################################################################### # Check DAP4 Data Request Form @@ -185,19 +169,6 @@ function test_HyraxVersion_class_endpoints() { loggy "$prolog Using ifh_url: $ifh_url" test_response_content "$ifh_url" "$expected_hyrax_version" -# some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$ifh_url")" - # loggy "$prolog $ifh_url: " - # loggy "$some_page" -# echo "$some_page" | grep "$expected_hyrax_version" -# status=$? -# if test $status -ne 0 -# then -# loggy "$prolog ERROR! The expected version string as not found in the Data Request Form page." -# return $status -# else -# loggy "$prolog SUCCESS! The the '$ifh_url' response contained the version string: '$expected_hyrax_version'" -# fi - loggy "$prolog END" loggy "$HR0" return 0 @@ -238,6 +209,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then test_HyraxVersion_class_endpoints "$end_point_url" "$expected_hyrax_version" + loggy "$prolog END" loggy "$HR0" else From a9bf541ca3a55b5bf36a5471de34483485ff480d Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 09:41:50 -0700 Subject: [PATCH 13/22] Cleanup --- travis/test_hyrax_service_version | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 0aeaa962..cee0f851 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -118,8 +118,9 @@ function test_hyrax_version_response(){ in this production environment!" return 1 fi + local version_str=" Date: Tue, 31 Mar 2026 10:36:09 -0700 Subject: [PATCH 14/22] Cleanup --- travis/test_hyrax_service_version | 87 +++++++++++++------------------ 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index cee0f851..c8b8d209 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -85,42 +85,11 @@ function test_hyrax_version_response(){ local expected_version_str="$2" loggy "$prolog expected_version_str: $expected_version_str" - local version_url="$end_point_url/hyrax/version" loggy "$prolog version_url: $version_url" - ##################################################### - # Get Hyrax version response from the running server - loggy "$prolog Retrieving Hyrax Version Response from: '$version_url'" - local version_response - version_response="$(curl -s -c cookies -b cookies -n $NETRC_FILE -L "$version_url")" - loggy "$prolog Hyrax Version Response:" - loggy "$version_response" - loggy "$HR1" - - ############################################################ - # Verify Hyrax Version Injection - # Get this line from the version response: - # - # and then use awk to get the actual value of ########## - local hyrax_version_value - hyrax_version_value="$(echo "$version_response" | grep " Date: Tue, 31 Mar 2026 10:49:04 -0700 Subject: [PATCH 15/22] Cleanup --- travis/test_hyrax_service_version | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index c8b8d209..f752f1db 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -16,16 +16,17 @@ # service tests can be easily run. # +verbose="${verbose:""}" HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" HR2="--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---" + ############################################################################# # loggy() function loggy() { echo "$@" | awk '{ print "# "$0;}' >&2 } - ############################################################################# # test_response_content() # Test one of the contents.html responses (dynamic) for the presence of the @@ -55,8 +56,13 @@ function test_response_content(){ # loggy "$prolog Checking '$test_url' for correct the expected string: '$expected_string'" some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$test_url")" - # loggy "$prolog $contents_url: " - # loggy "$some_page" + + if test -n "$verbose" + then + loggy "$prolog response document: " + loggy "$some_page" + fi + echo "$some_page" | grep "$expected_string" status=$? if test $status -ne 0 @@ -97,11 +103,11 @@ function test_hyrax_version_response(){ } -######################################################################################################### +############################################################################# # test_HyraxVersion_class_endpoints() # Verify that we have the expected server version -function test_version_from_hyrax_service_endpoints() { - local prolog="test_HyraxVersion_class_endpoints() -" +function test_hyrax_service_endpoints() { + local prolog="test_hyrax_service_endpoints() -" loggy "$HR0" loggy "$prolog BEGIN" @@ -142,7 +148,10 @@ function test_version_from_hyrax_service_endpoints() { local contents_url="$end_point_url/hyrax/contents.html" loggy "$prolog Using contents_url: $contents_url" - test_response_content "$contents_url" "$expected_hyrax_version" + local contents_version="OPeNDAP Hyrax ($expected_hyrax_version)" + loggy "$prolog Using contents_version: $contents_version" + + test_response_content "$contents_url" "$contents_version" ##################################################################### @@ -154,7 +163,10 @@ function test_version_from_hyrax_service_endpoints() { local ifh_url="$end_point_url/hyrax/data/nc/fnoc1.nc.dmr.html" loggy "$prolog Using ifh_url: $ifh_url" - test_response_content "$ifh_url" "$expected_hyrax_version" + local ifh_version="OPeNDAP Hyrax ($expected_hyrax_version)" + loggy "$prolog Using ifh_version: $ifh_version" + + test_response_content "$ifh_url" "$ifh_version" loggy "$prolog END" loggy "$HR0" @@ -192,7 +204,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then loggy "$prolog BEGIN" set -e - test_version_from_hyrax_service_endpoints "$end_point_url" "$expected_hyrax_version" + test_hyrax_service_endpoints "$end_point_url" "$expected_hyrax_version" loggy "$prolog END" loggy "$HR0" From 4bec3b434f626b6afba7edcebfe6fd1b1547c1e2 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 10:58:42 -0700 Subject: [PATCH 16/22] Cleanup --- travis/test_docker_image_version | 9 ------ travis/test_hyrax_service_version | 50 ++++++++----------------------- 2 files changed, 13 insertions(+), 46 deletions(-) diff --git a/travis/test_docker_image_version b/travis/test_docker_image_version index 938ee29e..bdf52248 100755 --- a/travis/test_docker_image_version +++ b/travis/test_docker_image_version @@ -243,12 +243,3 @@ else loggy "$prolog SUCCESS! The test_docker_image_version functions have been loaded in to the current shell." fi - - - - - - - - - diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index f752f1db..9f0a9e35 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -52,13 +52,14 @@ function test_response_content(){ local some_page ##################################################################### - # Check contents.html - # + # Retrieve the response foe test_url and check for the presence of + # expected_string within. loggy "$prolog Checking '$test_url' for correct the expected string: '$expected_string'" some_page="$(curl -s -c cookies -b cookies -n "$NETRC_FILE" -L "$test_url")" if test -n "$verbose" then + # Show the response when in verbose mode. loggy "$prolog response document: " loggy "$some_page" fi @@ -76,36 +77,12 @@ function test_response_content(){ return 0 } -############################################################################# -# test_hyrax_version_response() -# Test the Hyrax version response document for the -# expected version string. -function test_hyrax_version_response(){ - local prolog="test_hyrax_version_response() -" - loggy "$HR1" - loggy "$prolog BEGIN" - - local end_point_url="$1" - loggy "$prolog end_point_url: $end_point_url" - - local expected_version_str="$2" - loggy "$prolog expected_version_str: $expected_version_str" - - local version_url="$end_point_url/hyrax/version" - loggy "$prolog version_url: $version_url" - - local version_response_str=" Date: Tue, 31 Mar 2026 11:47:12 -0700 Subject: [PATCH 17/22] Switch to el8 build --- travis-build-recipe | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/travis-build-recipe b/travis-build-recipe index 21a47a3a..1f7ccc2d 100644 --- a/travis-build-recipe +++ b/travis-build-recipe @@ -1,5 +1,5 @@ -TARGET_OS: el9 -TOMCAT_MAJOR_VERSION: 11 +TARGET_OS: el8 +TOMCAT_MAJOR_VERSION: 9 libdap4-3.21.1-420 2026-03-25T00:36:16+0000 bes-3.21.1-1202 2026-03-30T21:56:11+0000 -olfs-1.18.15-806 2026-03-30T22:31:01+0000 +olfs-1.18.15-805 2026-03-30T22:10:14+0000 From c97e7491986940cc922acd09dbedb977a7ba5062 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 16:34:57 -0700 Subject: [PATCH 18/22] Cleanup --- travis/test_hyrax_service_version | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 9f0a9e35..1300b4c1 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -29,8 +29,10 @@ function loggy() { ############################################################################# # test_response_content() -# Test one of the contents.html responses (dynamic) for the presence of the -# expected_hyrax_version string +# This function dereferences $test_url and then uses grep to search the +# response document for the $expected_string. If the $expected_string is +# found in the response then the test is a success. If the $expected_string +# is not found in response then the test fails. function test_response_content(){ local prolog="test_response_content() -" loggy "$HR1" @@ -80,9 +82,10 @@ function test_response_content(){ ############################################################################# # test_hyrax_service_endpoints() -# Verify that we have the expected server versions showing up in the -# Hyrax version response, the contents.html pages (navigation pages) and in -# the Data Request Form pages. +# Verify that we have the expected server versions showing up in: +# - The Hyrax version response +# - The contents.html pages (blue-bar navigation pages) +# - The Data Request Form pages. function test_hyrax_service_endpoints() { local prolog="test_hyrax_service_endpoints() -" loggy "$HR0" From 86d1fc067977255ef422dab1ae3fc22974b43602 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Tue, 31 Mar 2026 16:39:33 -0700 Subject: [PATCH 19/22] Cleanup --- travis/test_docker_image_version | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/travis/test_docker_image_version b/travis/test_docker_image_version index bdf52248..fa3b4f0c 100755 --- a/travis/test_docker_image_version +++ b/travis/test_docker_image_version @@ -1,4 +1,17 @@ #!/bin/bash +############################################################################# +# test_docker_image_version +# +# Travis invocation: +# +# - ./travis/test_docker_image_version "$OS_BUILD_VERSION_TAG" +# +# This script examines an OPeNDAP docker image to see if the version numbers +# of the components have been correctly injected into the image by our CICD. +# +# The docker image does not need to be running in a contsainer to run this +# test as the image is interrogated directly. +# HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" From 1dd175cb7368815894cdadafbd0c102cfe3e1143 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Wed, 1 Apr 2026 06:07:04 -0700 Subject: [PATCH 20/22] Cleanup --- travis/test_docker_image_version | 105 +++++++++++++++++++++--------- travis/test_hyrax_service_version | 34 +++++----- 2 files changed, 93 insertions(+), 46 deletions(-) diff --git a/travis/test_docker_image_version b/travis/test_docker_image_version index fa3b4f0c..b49b4fd3 100755 --- a/travis/test_docker_image_version +++ b/travis/test_docker_image_version @@ -9,7 +9,7 @@ # This script examines an OPeNDAP docker image to see if the version numbers # of the components have been correctly injected into the image by our CICD. # -# The docker image does not need to be running in a contsainer to run this +# The docker image does not need to be running in a container to run this # test as the image is interrogated directly. # @@ -25,7 +25,7 @@ function loggy() { ######################################################################################################### # test_docker_image_label() # Looks at the metadata of docker image 'd_id' ($1) using docker 'inspect' -# to retrieve the value of 'label_key' ($2) from the docker .Config.Labels +# to retrieve the value of 'label_key' ($2) from the docker ".Config.Labels" # The retrieved value is compared with the 'expected_value' ($3) # function test_docker_image_label() { @@ -34,8 +34,22 @@ function test_docker_image_label() { loggy "$prolog BEGIN" local d_id="$1" + if test -z "$d_id"; then + loggy "$prolog ERROR! You must pass valid docker id as parameter 1" + return 1 + fi + local label_key="$2" + if test -z "$label_key"; then + loggy "$prolog ERROR! You must a docker label key name as parameter 2" + return 2 + fi + local expected_value="$3" + if test -z "$expected_value"; then + loggy "$prolog ERROR! You must pass the expected value as parameter 3" + return 3 + fi local docker_labels local status @@ -65,34 +79,52 @@ function test_docker_image_label() { return 0 } - ######################################################################################################### # test_file_in_docker_image() # Looks inside docker image 'd_id' ($1) in the file # named file_path ($2) for the string 'expected_value' ($3) # +# This is accomplished by starting the container with "--rm" in order to 'cat' +# the target file. +# +# The "--rm" switch causes the automatic removal of the container and its associated +# anonymous volumes when the "cat" command exits. +# function test_file_in_docker_image() { local prolog="test_file_in_docker_image() -" loggy "$HR2" loggy "$prolog BEGIN" local d_id="$1" + if test -z "$d_id"; then + loggy "$prolog ERROR! You must pass valid docker id as parameter 1" + return 1 + fi local file_path="$2" - local expected_value="$3" + if test -z "$file_path"; then + loggy "$prolog ERROR! You must pass a fully qualified file path as 2" + return 3 + fi + + local search_value="$3" + if test -z "$search_value"; then + loggy "$prolog ERROR! You must pass the search value as parameter 3" + return 3 + fi local status local some_file - loggy "$prolog Checking for '$expected_value' in '$d_id::$file_path'" + loggy "$prolog Checking for '$search_value' in '$d_id::$file_path'" some_file="$(docker run --rm --entrypoint cat "$d_id" "$file_path")" #loggy "$prolog $d_id::$file_path: " #loggy "$some_file" - echo "$some_file" | grep "$expected_value" + echo "$some_file" | grep "$search_value" status=$? if test $status -ne 0; then - loggy "$prolog ERROR! The expected value '$expected_value' was not found in the file '$file_path'" + loggy "$prolog ERROR! The expected value '$search_value' was not found in the file '$file_path'" loggy "$prolog $d_id::$file_path: " loggy "$some_file" return $status @@ -104,28 +136,38 @@ function test_file_in_docker_image() { loggy "$HR2" return 0 } -#docker cp $CONTAINER_ID:/path/in/container /path/on/host - ######################################################################################################### # get_docker_label_version_key() -# Returns the purported Docker .Config.Labels entry for the current application build. -# Relies on the global variable DOCKER_NAME and embodies some inside knowledge of the irregularities -# In our docker labeling scheme.In particular some applications like ngap and hyrax_ncwms use -# the "hyrax" version in their Docker labels. -function get_docker_label_version_key(){ +# Returns the purported Docker ".Config.Labels" version keyname for the current application build. +# +# Relies on the global variable DOCKER_NAME and embodies some inside knowledge of the irregularities +# I +# n our docker labeling scheme.In particular some applications like ngap and hyrax_ncwms use +# the "hyrax" version in their Docker labels. +# +function get_docker_label_version_key() { local prolog="get_docker_label_version_key() -" - local app_key="$DOCKER_NAME" # default + local app_key="$DOCKER_NAME" # default # if test -n "$DOCKER_DIR"; then app_key="$DOCKER_DIR"; fi # DOCKER_DIR if it's in use. - if test "$app_key" = "ngap" -o "$app_key" = "hyrax_ncwms"; then app_key="hyrax"; fi # ngap is Hyrax so.... + if test "$app_key" = "ngap" -o "$app_key" = "hyrax_ncwms"; then app_key="hyrax"; fi # ngap is Hyrax so.... local label_version_key="org.opendap.$app_key.version" loggy "$prolog label_version_key: $label_version_key" echo "$label_version_key" } - -function get_expected_docker_label_version_value(){ +######################################################################################################### +# get_expected_docker_label_version_value() +# Returns the value of the docker label version string for the current application build. +# +# Relies on the global variable DOCKER_NAME. BES_VERSION. OLFS_VERSION, and HYRAX_WEB_UI_VERSION. +# +# This function embodies some inside knowledge of the irregularities in our +# docker labeling scheme. In particular the olfs and besd applications use their version specific +# version values (and not the Hyrax version) in their Docker ".Config.Labels" metadata labels. +# +function get_expected_docker_label_version_value() { local prolog="get_expected_docker_label_version_value() -" ################################################################################################# # Target specific tweaking using global values @@ -139,9 +181,10 @@ function get_expected_docker_label_version_value(){ ######################################################################################################### # test_docker_version_label() -# Examine the .Config.Labels metadata in "d_id" and test that the application version for our -# application is correct. -function test_docker_version_label(){ +# Examine the .Config.Labels metadata in "d_id" and test that the application version for the +# current application build is correct. +# +function test_docker_version_label() { local prolog="test_docker_version_label() -" local d_id="$1" @@ -169,11 +212,11 @@ function test_docker_version_label(){ } - ######################################################################################################### # test_docker_hyrax_version() # Examine the Hyrax deployment in "d_id" and check the value of the Hyrax version strings # in the expected locations. +# function test_docker_hyrax_versions() { local prolog="test_docker_hyrax_versions() -" loggy "$HR1" @@ -211,8 +254,9 @@ function test_docker_hyrax_versions() { ################################################################# # All the service deployments (except the besd) have the OLFS - # installed in Tomcat. We check the version.xsl static file for - # the Hyrax version (not the OLFS version, at least in that location) + # installed in Tomcat. For these we check the version.xsl static + # file for the Hyrax version (not the OLFS version, at least in + # that location) if test "$DOCKER_NAME" != "besd"; then local version_xsl="/usr/share/tomcat/webapps/$deployment_context/xsl/version.xsl" test_file_in_docker_image "$d_id" "$version_xsl" "$HYRAX_WEB_UI_VERSION" @@ -228,18 +272,22 @@ function test_docker_hyrax_versions() { } ############################################################################# -# Processing Command Line Options (Inline Execution) -# +############################################################################# +############################################################################# + prolog="test_docker_image_version[] -" +############################################################################# +# Run or source? What doing? if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Run the script invoked as an application, loggy "$HR0" loggy "$prolog BEGIN" + # ################################# + # Processing Command Line Option docker_image_id="$1" - if test -z "$docker_image_id" - then + if test -z "$docker_image_id"; then loggy "ERROR! You must supply a docker id to use theis script." exit 1 fi @@ -255,4 +303,3 @@ else # Just source it into the current shell. loggy "$prolog SUCCESS! The test_docker_image_version functions have been loaded in to the current shell." fi - diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 1300b4c1..2db89fcc 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -158,30 +158,30 @@ function test_hyrax_service_endpoints() { ######################################################################################################### ######################################################################################################### - -############################################################################# -# Processing Command Line Options (Inline Execution) -# - prolog="test_hyrax_service_version[] -" -end_point_url="$1" -if test -z "$end_point_url"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 1" - return 1 -fi - -expected_hyrax_version="$2" -if test -z "$expected_hyrax_version"; then - loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" - return 2 -fi - +############################################################################# +# Run or source? What doing? if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Run the script invoked as an application, loggy "$HR0" loggy "$prolog BEGIN" + ############################################################################# + # Processing Command Line Options + # + end_point_url="$1" + if test -z "$end_point_url"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 1" + return 1 + fi + + expected_hyrax_version="$2" + if test -z "$expected_hyrax_version"; then + loggy "$prolog ERROR! You must pass a Hyrax endpoint url string as parameter 2" + return 2 + fi + set -e test_hyrax_service_endpoints "$end_point_url" "$expected_hyrax_version" From 6ad7b820aa730c903b0e840b03fc5abb7377e64d Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Wed, 1 Apr 2026 06:09:00 -0700 Subject: [PATCH 21/22] docs --- travis/regression_test_script | 2 ++ 1 file changed, 2 insertions(+) diff --git a/travis/regression_test_script b/travis/regression_test_script index f33622af..58545fcd 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -435,6 +435,8 @@ loggy "$prolog TEST_NAMES: $TEST_NAMES" loggy "$prolog TESTS_LOG_BASE: $TESTS_LOG_BASE" loggy "$prolog DOCKER_ID: $DOCKER_ID" +############################################################################# +# Run or source? What doing? if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Run the script invoked as an application, set -e From 386523a3eeda4ea47aa5cf67771a72c745eb86d2 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Wed, 1 Apr 2026 06:56:12 -0700 Subject: [PATCH 22/22] docs --- travis/regression_test_script | 4 ++-- travis/test_hyrax_service_version | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/travis/regression_test_script b/travis/regression_test_script index 58545fcd..dc3ba073 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -14,8 +14,8 @@ set -e # hyrax_regression_tests on the new server. # # !! NOTE !! -# As written this script leaves the docker container running so that downstream -# service tests can be easily run. +# As written this script leaves the tested hyrax docker container +# running so that downstream service tests can be easily run. # HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" diff --git a/travis/test_hyrax_service_version b/travis/test_hyrax_service_version index 2db89fcc..4ec1a18f 100755 --- a/travis/test_hyrax_service_version +++ b/travis/test_hyrax_service_version @@ -12,10 +12,8 @@ # contain the expected version information. # # !! NOTE !! -# As written this script leaves the docker container running so that downstream -# service tests can be easily run. +# As written this script requires a running Hyrax service! # - verbose="${verbose:""}" HR0="#######################################################################" HR1="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"