diff --git a/docs/development.md b/docs/development.md index 01f917b4..0afdb867 100644 --- a/docs/development.md +++ b/docs/development.md @@ -55,7 +55,7 @@ additional modules. ## Testing -Automated tests require `docker`, `docker-compose`, `curl`, and `mc` (the minio [cli tool](https://github.com/penpyt/asdf-mc)) to be +Automated tests require `docker`, `docker-compose`, `curl`, `md5sum` (or `md5` on MacOS), and `mc` (the minio [cli tool](https://github.com/penpyt/asdf-mc)) to be installed. To run all unit tests and integration tests, run the following command. If you invoke the test script with a plus parameter, you will need to add your NGINX repository keys to the `plus/etc/ssl/nginx` directory diff --git a/test.sh b/test.sh index edb462ba..d90f9ce7 100755 --- a/test.sh +++ b/test.sh @@ -131,7 +131,7 @@ e "${startup_message}" set -o nounset # abort on unbound variable -docker_cmd="$(command -v docker)" +docker_cmd="$(command -v docker || true)" if ! [ -x "${docker_cmd}" ]; then e "required dependency not found: docker not found in the path or not executable" exit ${no_dep_exit_code} @@ -147,7 +147,7 @@ else fi e "Using Docker Compose command: ${docker_compose_cmd}" -curl_cmd="$(command -v curl)" +curl_cmd="$(command -v curl || true)" if ! [ -x "${curl_cmd}" ]; then e "required dependency not found: curl not found in the path or not executable" exit ${no_dep_exit_code} diff --git a/test/integration/test_api.sh b/test/integration/test_api.sh index 1233dbd2..ec49f99f 100644 --- a/test/integration/test_api.sh +++ b/test/integration/test_api.sh @@ -58,18 +58,29 @@ if [ -z "${test_dir}" ]; then e "missing second parameter: path to test data directory" fi -curl_cmd="$(command -v curl)" +curl_cmd="$(command -v curl || true)" if ! [ -x "${curl_cmd}" ]; then e "required dependency not found: curl not found in the path or not executable" exit ${no_dep_exit_code} fi -checksum_cmd="$(command -v md5sum)" -if ! [ -x "${curl_cmd}" ]; then +# Allow for MacOS which does not support "md5sum" +# but has "md5 -r" which can be substituted +checksum_cmd="$(command -v md5sum || command -v md5 || true)" + +if ! [ -x "${checksum_cmd}" ]; then e "required dependency not found: md5sum not found in the path or not executable" exit ${no_dep_exit_code} fi +# If we are using the `md5` executable +# then use the -r flag which makes it behave the same as `md5sum` +# this is done after the `-x` check for ability to execute +# since it will not pass with the flag +if [[ $checksum_cmd =~ \/md5$ ]]; then + checksum_cmd="${checksum_cmd} -r" +fi + assertHttpRequestEquals() { method="$1" path="$2"