-
Notifications
You must be signed in to change notification settings - Fork 255
CLDSRV-717: Test S3C setup like in Integration #5914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bert-e
merged 2 commits into
development/9.0
from
improvement/CLDSRV-717-s3c-tests-setup
Aug 26, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,63 @@ | ||
| { | ||
| "port": 8000, | ||
| "maxScannedLifecycleListingEntries": 10000, | ||
| "metricsPort": 8001, | ||
| "internalPort": 8004, | ||
| "replicationGroupId": "RG001", | ||
| "restEndpoints": { | ||
| "s3.amazonaws.com": "dc-1", | ||
| "localhost": "dc-1", | ||
| "scality.scality.com": "dc-1", | ||
| "127.0.0.1": "dc-1", | ||
| "node1.scality.com": "dc-1" | ||
| }, | ||
| "websiteEndpoints": ["s3-website-us-east-1.scality.com"], | ||
| "bucketd": { | ||
| "bootstrap": ["0.0.0.0:9000"] | ||
| }, | ||
| "vaultd": { | ||
| "host": "127.0.0.1", | ||
| "port": 8500 | ||
| }, | ||
| "clusters": 5, | ||
| "kmsHideScalityArn": true, | ||
| "healthChecks": { | ||
| "allowFrom": ["127.0.0.1", "::1"] | ||
| }, | ||
| "localCache": { | ||
| "host": "localhost", | ||
| "port": 6379, | ||
| "password": "" | ||
| }, | ||
| "log": { | ||
| "logLevel": "info", | ||
| "dumpLevel": "error" | ||
| }, | ||
| "replicationEndpoints": [ | ||
| {"site": "zenko", "servers": ["127.0.0.1:9080"], "echo": false, "default": true}, | ||
| {"site": "us-east-2", "servers": ["127.0.0.1:9080"]} | ||
| ], | ||
| "requests": { | ||
| "extractClientIPFromHeader": "x-forwarded-for", | ||
| "extractProtocolFromHeader": "x-forwarded-proto", | ||
| "trustedProxyCIDRs": [ | ||
| "127.0.0.1/32", | ||
| "::ffff:127.0.0.1/128", | ||
| "127.0.0.1" | ||
| ], | ||
| "viaProxy": true | ||
| }, | ||
| "multiObjectDeleteEnableOptimizations": false, | ||
| "supportedLifecycleRules": [ | ||
| "Expiration", | ||
| "NoncurrentVersionExpiration", | ||
| "AbortIncompleteMultipartUpload" | ||
| ], | ||
| "bucketNotificationDestinations": [ | ||
| { | ||
| "resource": "target1", | ||
| "type": "dummy", | ||
| "host": "localhost:6000" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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
This file contains hidden or 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,29 @@ | ||
| { | ||
| "raftSessions": 1, | ||
| "raftMembers": 5, | ||
| "bucketdCount": 1, | ||
| "bucketdWorkers": 1, | ||
| "basePorts": { | ||
| "bucketd": 9000, | ||
| "repd": 4200, | ||
| "repdAdmin": 4250 | ||
| }, | ||
| "logLevel": "info", | ||
| "env": { | ||
| "METADATA_NEW_BUCKETS_VFORMAT": "v0", | ||
| "S3_VERSION_ID_ENCODING_TYPE":"hex" | ||
| }, | ||
| "migration": { | ||
| "deploy": false, | ||
| "raftSessions": 0, | ||
| "raftMembers": 5, | ||
| "bucketdCount": 1, | ||
| "bucketdWorkers": 1, | ||
| "basePorts": { | ||
| "bucketd": 9001, | ||
| "repd": 4700, | ||
| "repdAdmin": 4750 | ||
| }, | ||
| "logLevel": "info" | ||
| } | ||
| } |
This file contains hidden or 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,62 @@ | ||
| #!/bin/bash | ||
|
|
||
| # setup S3C environment just like | ||
| # https://github.com/scality/Integration/blob/development/9.5/tests/setup-environment/index.js | ||
|
|
||
| set -e -o pipefail | ||
|
|
||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
|
||
| VAULTCLIENT=$SCRIPT_DIR/../../node_modules/vaultclient/bin/vaultclient | ||
| CONFIG=$SCRIPT_DIR/admin.json | ||
|
|
||
| echo "Deleting and setting up S3C accounts like Integration (follow conf/authdata.json)" | ||
|
|
||
| $VAULTCLIENT --config $CONFIG delete-account --name Bart || true | ||
| $VAULTCLIENT --config $CONFIG create-account \ | ||
| --name Bart \ | ||
| --email sampleaccount1@sampling.com \ | ||
| --accountid 123456789012 \ | ||
| --canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be | ||
| $VAULTCLIENT --config $CONFIG generate-account-access-key \ | ||
| --name Bart \ | ||
| --accesskey ACC1AK00000000000000 \ | ||
| --secretkey ACC1SK0000000000000000000000000000000000 | ||
|
|
||
| $VAULTCLIENT --config $CONFIG delete-account --name Lisa || true | ||
| $VAULTCLIENT --config $CONFIG create-account \ | ||
| --name Lisa \ | ||
| --email sampleaccount2@sampling.com \ | ||
| --accountid 123456789013 \ | ||
| --canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2bf | ||
| $VAULTCLIENT --config $CONFIG generate-account-access-key \ | ||
| --name Lisa \ | ||
| --accesskey ACC2AK00000000000000 \ | ||
| --secretkey ACC2SK0000000000000000000000000000000000 | ||
|
|
||
| # Replication account for backbeat replication tests | ||
| $VAULTCLIENT --config $CONFIG delete-account --name Replication || true | ||
| # Cannot use url as canonicalid for service account | ||
| $VAULTCLIENT --config $CONFIG create-account \ | ||
| --name Replication \ | ||
| --email inspector@replication.info \ | ||
| --accountid 123456789015 \ | ||
| --canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2ba | ||
| $VAULTCLIENT --config $CONFIG generate-account-access-key \ | ||
| --name Replication \ | ||
| --accesskey ACCREPAK000000000000 \ | ||
| --secretkey ACCREPSK00000000000000000000000000000000 | ||
|
|
||
| echo "Copying s3c credentials to mem credentials" | ||
| cp \ | ||
| $SCRIPT_DIR/../../tests/functional/aws-node-sdk/lib/json/s3c_credentials.json \ | ||
| $SCRIPT_DIR/../../tests/functional/aws-node-sdk/lib/json/mem_credentials.json | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this file supposed to be added in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No this is executed in the CI |
||
|
|
||
| echo "Update conf/authdata.json account Replication canonicalID" | ||
| REP_CANONICAL_ID=$( | ||
| $VAULTCLIENT --config $CONFIG get-account --account-name Replication | jq -r .canonicalId | ||
| ) | ||
|
|
||
| # might need to undo changes if script was already ran before (manuallyoutside CI) | ||
| git checkout -- $SCRIPT_DIR/../../conf/authdata.json || true | ||
| sed -i "s/http:\/\/acs.zenko.io\/accounts\/service\/replication/$REP_CANONICAL_ID/g" $SCRIPT_DIR/../../conf/authdata.json | ||
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
tests/functional/aws-node-sdk/lib/json/s3c_credentials.json
This file contains hidden or 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,14 @@ | ||
| { | ||
| "default": { | ||
| "accessKey": "ACC1AK00000000000000", | ||
| "secretKey": "ACC1SK0000000000000000000000000000000000" | ||
| }, | ||
| "lisa": { | ||
| "accessKey": "ACC2AK00000000000000", | ||
| "secretKey": "ACC2SK0000000000000000000000000000000000" | ||
| }, | ||
| "replication": { | ||
| "accessKey": "ACCREPAK000000000000", | ||
| "secretKey": "ACCREPSK00000000000000000000000000000000" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are specifying those credentials in
s3c_credentials.jsonshould we read from it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, I've hardcoded here so we can easily rerun manually and quickly troubleshoot without having to look for creds. Same for Integration, it will be hardcoded