Skip to content

Commit

Permalink
Testing permissions and uid/gid.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Aug 19, 2024
1 parent 86f76db commit d67d512
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ jobs:
export GROUP_ID="$(id -g)"
echo "${GROUP_ID}:${USER_ID}"
docker compose up -d
- name: Run CLI tests
working-directory: docker/tests
run: |
echo "Testing adding subscription"
# test adding a subscription
docker exec subscriber bash -c "source /home/wis2downloader/.venv/bin/activate && wis2downloader add-subscription --topic cache/a/wis2/+/services/#"
# test listing subscriptions
echo "Testing listing subscriptions"
docker exec subscriber bash -c "source /home/wis2downloader/.venv/bin/activate && wis2downloader list-subscriptions"
# publish a test message
echo "Publishing test message"
docker exec publisher pywis-pubsub publish --topic cache/a/wis2/my-centre/services/downloader \
--config /pywis-pubsub/config/config.yml \
-i test -u "http://subscriber:5000/openapi"
sleep 1s
echo "Verifying data downloaded"
# cat file contents (check the published file has been downloaded)
cat "./data/$(date +'%Y')/$(date +'%m')/$(date +'%d')/cache/a/wis2/my-centre/services/downloader/openapi.bin"
echo "Testing removing subscription"
# test deleting subscriptions
docker exec subscriber bash -c "source /home/wis2downloader/.venv/bin/activate && wis2downloader remove-subscription --topic cache/a/wis2/+/services/#"
- name: Run API tests
working-directory: docker/tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion docker/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ services:
- broker
volumes:
- ./data:/home/wis2downloader/app/data/downloads
user: "${GROUP_ID}:${USER_ID}"
user: 127:1001

0 comments on commit d67d512

Please sign in to comment.