mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-23 13:59:26 +00:00
Refactored ops and whitelist processing into its own file (#1306)
This commit is contained in:
13
tests/setuponlytests/ops_from_scratch/docker-compose.yml
Normal file
13
tests/setuponlytests/ops_from_scratch/docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
restart: "no"
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||
OPS: itzg
|
||||
volumes:
|
||||
- ./data:/data
|
||||
3
tests/setuponlytests/ops_from_scratch/verify.sh
Normal file
3
tests/setuponlytests/ops_from_scratch/verify.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].name' --expect=itzg
|
||||
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].uuid' --expect=5cddfd26-fc86-4981-b52e-c42bb10bfdef
|
||||
mc-image-helper assert jsonPathEquals --file=ops.json --path='$[0].level' --expect=4
|
||||
@@ -11,8 +11,8 @@ setupOnlyMinecraftTest(){
|
||||
cd "$folder"
|
||||
result=0
|
||||
|
||||
if ! logs=$(docker compose run --quiet-pull mc 2>&1); then
|
||||
echo "${folder} setup FAILED"
|
||||
if ! logs=$(docker-compose run mc 2>&1); then
|
||||
echo "${folder} test scenario FAILED"
|
||||
echo ":::::::::::: LOGS ::::::::::::::::
|
||||
$logs
|
||||
::::::::::::::::::::::::::::::::::
|
||||
@@ -29,7 +29,7 @@ $logs
|
||||
echo "${folder} PASS"
|
||||
fi
|
||||
|
||||
docker compose down -v --remove-orphans
|
||||
docker-compose down -v --remove-orphans
|
||||
cd ..
|
||||
|
||||
return $result
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
restart: "no"
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||
WHITELIST: itzg
|
||||
ENFORCE_WHITELIST: "true"
|
||||
OVERRIDE_SERVER_PROPERTIES: "true"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
4
tests/setuponlytests/whitelist_from_scratch/verify.sh
Normal file
4
tests/setuponlytests/whitelist_from_scratch/verify.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
mc-image-helper assert jsonPathEquals --file=whitelist.json --path='$[0].name' --expect=itzg
|
||||
mc-image-helper assert jsonPathEquals --file=whitelist.json --path='$[0].uuid' --expect=5cddfd26-fc86-4981-b52e-c42bb10bfdef
|
||||
mc-image-helper assert propertyEquals --file=server.properties --property=white-list --expect=true
|
||||
mc-image-helper assert propertyEquals --file=server.properties --property=enforce-whitelist --expect=true
|
||||
Reference in New Issue
Block a user