Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Add support for running old hub bins in hybrid in simple testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Aug 5, 2022
1 parent 39a3528 commit 32f3fa8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 5 additions & 5 deletions testing/simple/docker-compose.yml
Expand Up @@ -79,7 +79,7 @@ services:
image: toolset.safing.network/dev
entrypoint: "/opt/shared/entrypoint.sh"
volumes:
- ${SPN_TEST_BIN}:/opt/hub6:ro
- ${SPN_TEST_OLD_BIN}:/opt/hub6:ro
- ${SPN_TEST_DATA_DIR}/hub6:/opt/data
- ${SPN_TEST_SHARED_DATA_DIR}:/opt/shared
networks:
Expand All @@ -92,7 +92,7 @@ services:
image: toolset.safing.network/dev
entrypoint: "/opt/shared/entrypoint.sh"
volumes:
- ${SPN_TEST_BIN}:/opt/hub7:ro
- ${SPN_TEST_OLD_BIN}:/opt/hub7:ro
- ${SPN_TEST_DATA_DIR}/hub7:/opt/data
- ${SPN_TEST_SHARED_DATA_DIR}:/opt/shared
networks:
Expand All @@ -105,7 +105,7 @@ services:
image: toolset.safing.network/dev
entrypoint: "/opt/shared/entrypoint.sh"
volumes:
- ${SPN_TEST_BIN}:/opt/hub8:ro
- ${SPN_TEST_OLD_BIN}:/opt/hub8:ro
- ${SPN_TEST_DATA_DIR}/hub8:/opt/data
- ${SPN_TEST_SHARED_DATA_DIR}:/opt/shared
networks:
Expand All @@ -118,7 +118,7 @@ services:
image: toolset.safing.network/dev
entrypoint: "/opt/shared/entrypoint.sh"
volumes:
- ${SPN_TEST_BIN}:/opt/hub9:ro
- ${SPN_TEST_OLD_BIN}:/opt/hub9:ro
- ${SPN_TEST_DATA_DIR}/hub9:/opt/data
- ${SPN_TEST_SHARED_DATA_DIR}:/opt/shared
networks:
Expand All @@ -131,7 +131,7 @@ services:
image: toolset.safing.network/dev
entrypoint: "/opt/shared/entrypoint.sh"
volumes:
- ${SPN_TEST_BIN}:/opt/hub10:ro
- ${SPN_TEST_OLD_BIN}:/opt/hub10:ro
- ${SPN_TEST_DATA_DIR}/hub10:/opt/data
- ${SPN_TEST_SHARED_DATA_DIR}:/opt/shared
networks:
Expand Down
14 changes: 11 additions & 3 deletions testing/simple/run.sh
Expand Up @@ -30,15 +30,23 @@ if [[ ! -d "$SPN_TEST_SHARED_DATA_DIR" ]]; then
mkdir "$SPN_TEST_SHARED_DATA_DIR"
fi

# Check if there is an old binary for testing.
SPN_TEST_OLD_BIN=$SPN_TEST_BIN
if [[ -f "./testdata/old-hub" ]]; then
SPN_TEST_OLD_BIN="$(realpath ./testdata/old-hub)"
echo "WARNING: running in hybrid mode with old version at $SPN_TEST_OLD_BIN"
fi

# Export variables
export SPN_TEST_BIN
export SPN_TEST_OLD_BIN
export SPN_TEST_DATA_DIR
export SPN_TEST_SHARED_DATA_DIR

# Copy files.
cp config-template.json data/shared/config-template.json
cp entrypoint.sh data/shared/entrypoint.sh
chmod 555 data/shared/entrypoint.sh
cp config-template.json ./testdata/shared/config-template.json
cp entrypoint.sh ./testdata/shared/entrypoint.sh
chmod 555 ./testdata/shared/entrypoint.sh

# Run!
docker-compose -p spn-test-simple up --remove-orphans

0 comments on commit 32f3fa8

Please sign in to comment.