Skip to content

Commit

Permalink
host and container use same user 1 e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardsn committed Mar 22, 2024
1 parent 4b04ec2 commit dbd72ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions e2e-tests/storage/backup-restore/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3.7"
services:
nodeA:
user: "$USER:$USER"
image: "${IMAGE_NODE_A:-nutsfoundation/nuts-node:master}"
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
Expand Down
10 changes: 6 additions & 4 deletions e2e-tests/storage/backup-restore/run-test.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/usr/bin/env bash

source ../../util.sh
USER=$UID

echo "------------------------------------"
echo "Cleaning up running Docker containers and volumes, and key material..."
echo "------------------------------------"
docker compose down
docker compose rm -f -v
rm -rf ./node-data/*
rm -rf ./node-backup/*
rm -rf ./node-data
rm -rf ./node-backup

echo "------------------------------------"
echo "Starting Docker containers..."
echo "------------------------------------"
mkdir -p ./node-data ./node-backup ./node-backup/vcr/ # 'data' dirs will be created with root owner by docker if they do not exit. This creates permission issues on CI.
mkdir -p ./node-data ./node-backup/vcr/ # 'data' dirs will be created with root owner by docker if they do not exit. This creates permission issues on CI.
docker compose up --wait

echo "------------------------------------"
Expand Down Expand Up @@ -50,7 +51,8 @@ docker compose stop
# Copy files not in BBolt DB, so they can be restored. Then empty data dir.
cp ./node-data/vcr/trusted_issuers.yaml ./node-backup/vcr/
cp -r ./node-data/crypto ./node-backup
runOnAlpine "$(pwd):/host/" rm -rf /host/node-data
rm -rf ./node-data
#runOnAlpine "$(pwd):/host/" rm -rf /host/node-data
mkdir ./node-data
removeNodeDID ./node-A/nuts.yaml
# Restart node, assert node data is empty
Expand Down

0 comments on commit dbd72ce

Please sign in to comment.