2022-12-22 14:37:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
. ../util.sh
|
|
|
|
current_test=$(basename $(pwd))
|
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
export CERT_DIR=$(mktemp -d)
|
|
|
|
|
|
|
|
openssl genrsa -des3 -passout pass:test -out "$CERT_DIR/rootCA.key" 4096
|
2022-12-22 14:37:51 +01:00
|
|
|
openssl req -passin pass:test \
|
|
|
|
-subj "/C=DE/ST=BE/O=IntegrationTest, Inc." \
|
2023-09-02 15:17:46 +02:00
|
|
|
-x509 -new -key "$CERT_DIR/rootCA.key" -sha256 -days 1 -out "$CERT_DIR/rootCA.crt"
|
2022-12-22 14:37:51 +01:00
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
openssl genrsa -out "$CERT_DIR/minio.key" 4096
|
|
|
|
openssl req -new -sha256 -key "$CERT_DIR/minio.key" \
|
2022-12-22 14:37:51 +01:00
|
|
|
-subj "/C=DE/ST=BE/O=IntegrationTest, Inc./CN=minio" \
|
2023-09-02 15:17:46 +02:00
|
|
|
-out "$CERT_DIR/minio.csr"
|
2022-12-22 14:37:51 +01:00
|
|
|
|
|
|
|
openssl x509 -req -passin pass:test \
|
2023-09-02 15:17:46 +02:00
|
|
|
-in "$CERT_DIR/minio.csr" \
|
|
|
|
-CA "$CERT_DIR/rootCA.crt" -CAkey "$CERT_DIR/rootCA.key" -CAcreateserial \
|
2022-12-22 14:37:51 +01:00
|
|
|
-extfile san.cnf \
|
2023-09-02 15:17:46 +02:00
|
|
|
-out "$CERT_DIR/minio.crt" -days 1 -sha256
|
2022-12-22 14:37:51 +01:00
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
openssl x509 -in "$CERT_DIR/minio.crt" -noout -text
|
2022-12-22 14:37:51 +01:00
|
|
|
|
2023-08-27 19:19:11 +02:00
|
|
|
docker compose up -d --quiet-pull
|
2022-12-22 14:37:51 +01:00
|
|
|
sleep 5
|
|
|
|
|
2023-01-07 18:50:27 +01:00
|
|
|
docker compose exec backup backup
|
2022-12-22 14:37:51 +01:00
|
|
|
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
expect_running_containers "3"
|
|
|
|
|
2023-03-16 19:32:44 +01:00
|
|
|
docker run --rm \
|
2022-12-22 14:37:51 +01:00
|
|
|
-v minio_backup_data:/minio_data \
|
|
|
|
alpine \
|
|
|
|
ash -c 'tar -xvf /minio_data/backup/test.tar.gz -C /tmp && test -f /tmp/backup/app_data/offen.db'
|
|
|
|
|
|
|
|
pass "Found relevant files in untared remote backups."
|