Skip to content

Commit

Permalink
Added test for fcrepo6 file backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelgbanks committed Oct 7, 2023
1 parent c9ab7e7 commit 20ce607
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fcrepo6/tests/ServiceStartsWithBackendFile/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import plugins.TestsPlugin.DockerComposeUp

tasks.named<DockerComposeUp>("test") {
// Remove 143 when https://github.com/Islandora-Devops/isle-buildkit/issues/269 is resolved.
expectExitCodes("fcrepo6", 0, 143)
}
24 changes: 24 additions & 0 deletions fcrepo6/tests/ServiceStartsWithBackendFile/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions fcrepo6/tests/ServiceStartsWithBackendFile/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 20ce607

Please sign in to comment.