From 20ce60742bf65341613d3c867fc505cbeb328efa Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sat, 7 Oct 2023 02:25:45 +0200 Subject: [PATCH] Added test for fcrepo6 file backend. --- .../build.gradle.kts | 6 +++++ .../docker-compose.yml | 24 +++++++++++++++++++ .../ServiceStartsWithBackendFile/test.sh | 15 ++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 fcrepo6/tests/ServiceStartsWithBackendFile/build.gradle.kts create mode 100644 fcrepo6/tests/ServiceStartsWithBackendFile/docker-compose.yml create mode 100755 fcrepo6/tests/ServiceStartsWithBackendFile/test.sh diff --git a/fcrepo6/tests/ServiceStartsWithBackendFile/build.gradle.kts b/fcrepo6/tests/ServiceStartsWithBackendFile/build.gradle.kts new file mode 100644 index 00000000..dc591889 --- /dev/null +++ b/fcrepo6/tests/ServiceStartsWithBackendFile/build.gradle.kts @@ -0,0 +1,6 @@ +import plugins.TestsPlugin.DockerComposeUp + +tasks.named("test") { + // Remove 143 when https://github.com/Islandora-Devops/isle-buildkit/issues/269 is resolved. + expectExitCodes("fcrepo6", 0, 143) +} diff --git a/fcrepo6/tests/ServiceStartsWithBackendFile/docker-compose.yml b/fcrepo6/tests/ServiceStartsWithBackendFile/docker-compose.yml new file mode 100644 index 00000000..73f4fdae --- /dev/null +++ b/fcrepo6/tests/ServiceStartsWithBackendFile/docker-compose.yml @@ -0,0 +1,24 @@ +# file: docker-compose.yml +# +# Tests that the base values for database environment variables can be +# overridden by prefixing them. +# +# `base/rootfs/etc/cont-init.d/00-container-environment-00-init.sh` +version: "3.8" + +x-common: &common + restart: "no" + +name: fcrepo6-servicestartswithbackendfile +services: + activemq: + <<: *common + image: ${ACTIVEMQ:-islandora/activemq:local} + fcrepo6: + volumes: + - ./test.sh:/test.sh # Test to run. + command: + - /test.sh # Run test and exit. + image: ${FCREPO6:-islandora/fcrepo6:local} + depends_on: + - activemq diff --git a/fcrepo6/tests/ServiceStartsWithBackendFile/test.sh b/fcrepo6/tests/ServiceStartsWithBackendFile/test.sh new file mode 100755 index 00000000..a69afcc2 --- /dev/null +++ b/fcrepo6/tests/ServiceStartsWithBackendFile/test.sh @@ -0,0 +1,15 @@ +#!/command/with-contenv bash +# shellcheck shell=bash + +# shellcheck disable=SC1091 +source /usr/local/share/isle/utilities.sh + +# Wait for fcrepo to start. +wait_20x http://localhost:8080/fcrepo/rest + +# Add some content. +object=$(curl --fail -X POST -H "Authorization: Bearer islandora" -H "Content-Type:text/plain" "http://localhost:8080/fcrepo/rest" 2>/dev/null) +echo "Create Object: $object" + +# All tests were successful +exit 0