This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
forked from kubernetes-sigs/cosi-driver-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from scality/feature/COSI-14-add-iam-s3-loggin…
…g-and-cleanup-in-CI COSI-14: E2E test setup for S3 and IAM
- Loading branch information
Showing
6 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VAULT_IMAGE="ghcr.io/scality/vault:7.70.26" | ||
CLOUDSERVER_IMAGE="ghcr.io/scality/cloudserver:7.70.55" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"port": 8000, | ||
"listenOn": [], | ||
"restEndpoints": { | ||
"localhost": "us-east-1", | ||
"127.0.0.1": "us-east-1", | ||
"cloudserver-front": "us-east-1", | ||
"s3.docker.test": "us-east-1", | ||
"127.0.0.2": "us-east-1", | ||
"s3.amazonaws.com": "us-east-1" | ||
}, | ||
"websiteEndpoints": [ | ||
"s3-website-us-east-1.amazonaws.com", | ||
"s3-website.us-east-2.amazonaws.com", | ||
"s3-website-us-west-1.amazonaws.com", | ||
"s3-website-us-west-2.amazonaws.com", | ||
"s3-website.ap-south-1.amazonaws.com", | ||
"s3-website.ap-northeast-2.amazonaws.com", | ||
"s3-website-ap-southeast-1.amazonaws.com", | ||
"s3-website-ap-southeast-2.amazonaws.com", | ||
"s3-website-ap-northeast-1.amazonaws.com", | ||
"s3-website.eu-central-1.amazonaws.com", | ||
"s3-website-eu-west-1.amazonaws.com", | ||
"s3-website-sa-east-1.amazonaws.com", | ||
"s3-website.localhost", | ||
"s3-website.scality.test" | ||
], | ||
"vaultd": { | ||
"host": "localhost", | ||
"port": 8500 | ||
}, | ||
"clusters": 1, | ||
"log": { | ||
"logLevel": "trace", | ||
"dumpLevel": "error" | ||
}, | ||
"healthChecks": { | ||
"allowFrom": ["127.0.0.1/8", "::1"] | ||
}, | ||
"recordLog": { | ||
"enabled": false, | ||
"recordLogName": "s3-recordlog" | ||
}, | ||
"requests": { | ||
"viaProxy": false, | ||
"trustedProxyCIDRs": [], | ||
"extractClientIPFromHeader": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
services: | ||
s3: | ||
profiles: ['iam_s3'] | ||
image: ${CLOUDSERVER_IMAGE} | ||
network_mode: host | ||
environment: | ||
S3VAULT: scality | ||
S3_CONFIG_FILE: /conf/config.json | ||
command: /bin/sh -c "yarn run mem_backend > /logs/s3/s3.log 2>&1" | ||
volumes: | ||
- ./cloudserver-config.json:/conf/config.json:ro | ||
- ./logs/s3:/logs/s3 | ||
|
||
iam: | ||
profiles: ['iam_s3'] | ||
image: ${VAULT_IMAGE} | ||
network_mode: host | ||
command: /bin/sh -c "chmod 400 tests/utils/keyfile && yarn start > /logs/iam/iam.log 2>&1" | ||
environment: | ||
VAULT_CONFIG_FILE: /conf/config.json | ||
VAULT_DB_BACKEND: LEVELDB | ||
volumes: | ||
- ./vault-config.json:/conf/config.json:ro | ||
- ./data/vaultdb:/data | ||
- ./logs/iam:/logs/iam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"clusters": 1, | ||
"healthChecks": { | ||
"allowFrom": ["127.0.0.1/8", "::1"] | ||
}, | ||
"interfaces": { | ||
"S3": { | ||
"address": "0.0.0.0", | ||
"port": 8500, | ||
"allowFrom": ["0.0.0.0/8", "::1"] | ||
}, | ||
"administration": { | ||
"address": "0.0.0.0", | ||
"port": 8600 | ||
}, | ||
"sts": { | ||
"address": "127.0.0.1", | ||
"port": 8800 | ||
}, | ||
"sso": { | ||
"address": "127.0.0.1", | ||
"port": 8700, | ||
"cert": "./tests/utils/sso/defaultCert.crt", | ||
"key": "./tests/utils/sso/defaultCert.key" | ||
} | ||
}, | ||
"sso": { | ||
"clients": [ | ||
{ | ||
"id": "grafana", | ||
"secret": "123123", | ||
"redirectUri": [ | ||
"http://localhost:3000/login/generic_oauth", | ||
"https://localhost:3000/login/generic_oauth" | ||
], | ||
"scopes": ["dev", "prod"] | ||
} | ||
], | ||
"publicClients": [ | ||
{ | ||
"id": "identisee", | ||
"redirectUri": "https://127.0.0.1:8700/user/info", | ||
"scopes": ["admin", "superadmin"] | ||
} | ||
], | ||
"authCodeTTL": 480, | ||
"accessTokenTTL": 7600 | ||
}, | ||
"map": ["127.0.0.1:4300", "127.0.0.2:4301", "127.0.0.3:4302", "127.0.0.4:4303", "127.0.0.5:4304"], | ||
"keyFilePath": "./tests/utils/keyfile", | ||
"adminCredentialsFilePath": "./tests/utils/admincredentials.json.encrypted", | ||
"log": { | ||
"level": "trace", | ||
"dump": "error" | ||
}, | ||
"accountSeeds": [ | ||
{ | ||
"role": { | ||
"roleName": "scality-role1", | ||
"trustPolicy": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { "AWS": "arn:aws:iam::000000000000:user/root" }, | ||
"Action": "sts:AssumeRole", | ||
"Condition": {} | ||
} | ||
] | ||
} | ||
}, | ||
"permissionPolicy": { | ||
"policyName": "scality-policy1", | ||
"policyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "FullAccess", | ||
"Effect": "Allow", | ||
"Action": ["s3:*"], | ||
"Resource": ["*"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"utapi": { | ||
"host": "127.0.0.1", | ||
"port": 8100 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
wait_for_local_port() { | ||
local port=$1 | ||
local timeout=$2 | ||
local count=0 | ||
local ret=1 | ||
echo "waiting for storage-service:$port" | ||
while [[ "$ret" -eq "1" && "$count" -lt "$timeout" ]] ; do | ||
nc -z -w 1 localhost $port | ||
ret=$? | ||
if [ ! "$ret" -eq "0" ]; then | ||
echo -n . | ||
sleep 1 | ||
count=$(($count+1)) | ||
fi | ||
done | ||
|
||
echo "" | ||
|
||
if [[ "$count" -eq "$timeout" ]]; then | ||
echo "Server did not start in less than $timeout seconds. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
echo "Server got ready in ~${count} seconds. Starting test now..." | ||
} | ||
|
||
wait_for_local_port $1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters