Skip to content

Commit c2d6252

Browse files
(wip) functional tests for sse KMS Migration
Needs some more refactoring and cleaning
1 parent 7dcaa28 commit c2d6252

File tree

11 files changed

+2094
-0
lines changed

11 files changed

+2094
-0
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
"ft_test": "npm-run-all -s ft_awssdk ft_s3cmd ft_s3curl ft_node ft_healthchecks ft_management ft_backbeat",
7878
"ft_search": "cd tests/functional/aws-node-sdk && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 test/mdSearch",
7979
"ft_kmip": "cd tests/functional/kmip && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",
80+
"ft_sse_cleanup": "cd tests/functional/sse-kms-migration && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 10000 cleanup.js",
81+
"ft_sse_before_migration": "cd tests/functional/sse-kms-migration && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 10000 cleanup.js beforeMigration.js",
82+
"ft_sse_migration": "cd tests/functional/sse-kms-migration && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 10000 migration.js",
83+
"ft_sse_arn": "cd tests/functional/sse-kms-migration && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 10000 cleanup.js arnPrefix.js",
8084
"install_ft_deps": "yarn install aws-sdk@2.28.0 bluebird@3.3.1 mocha@2.3.4 mocha-junit-reporter@1.23.1 tv4@1.2.7",
8185
"lint": "eslint $(git ls-files '*.js')",
8286
"lint_md": "mdlint $(git ls-files '*.md')",

tests/functional/aws-node-sdk/lib/json/mem_credentials.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"lisa": {
77
"accessKey": "accessKey2",
88
"secretKey": "verySecretKey2"
9+
},
10+
"vault": {
11+
"accessKey": "TESTAK00000000000000",
12+
"secretKey": "TESTSK0000000000000000000000000000000000"
913
}
1014
}

tests/functional/sse-kms-migration/arnPrefix.js

Lines changed: 478 additions & 0 deletions
Large diffs are not rendered by default.

tests/functional/sse-kms-migration/beforeMigration.js

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* eslint-disable */
2+
const helpers = require('./helpers');
3+
const scenarios = require('./scenarios');
4+
5+
// copy part of aws-node-sdk/test/object/encryptionHeaders.js and add more tests
6+
7+
async function cleanup(Bucket) {
8+
try {
9+
void await helpers.cleanup(Bucket);
10+
} catch (e) {
11+
console.log('Ignore error for', Bucket, e.toString());
12+
}
13+
}
14+
15+
describe('SSE KMS Cleanup', () => {
16+
/** Bucket to test CopyObject from and to */
17+
const copyBkt = 'enc-bkt-copy';
18+
const mpuCopyBkt = 'enc-bkt-mpu-copy';
19+
20+
it('Empty and delete buckets for SSE KMS Migration', async () => {
21+
void await helpers.MD.setup();
22+
23+
try {
24+
// pre cleanup
25+
void await cleanup(copyBkt);
26+
void await cleanup(mpuCopyBkt);
27+
void await Promise.all(scenarios.testCases.map(async bktConf => {
28+
void await cleanup(`enc-bkt-${bktConf.name}`);
29+
return await cleanup(`versioned-enc-bkt-${bktConf.name}`);
30+
}));
31+
} catch (e) { void e; }
32+
});
33+
});
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"port": 8000,
3+
"listenOn": [],
4+
"metricsPort": 8002,
5+
"metricsListenOn": [],
6+
"replicationGroupId": "RG001",
7+
"restEndpoints": {
8+
"localhost": "us-east-1",
9+
"127.0.0.1": "us-east-1",
10+
"cloudserver-front": "us-east-1",
11+
"s3.docker.test": "us-east-1",
12+
"127.0.0.2": "us-east-1",
13+
"s3.amazonaws.com": "us-east-1"
14+
},
15+
"websiteEndpoints": ["s3-website-us-east-1.amazonaws.com",
16+
"s3-website.us-east-2.amazonaws.com",
17+
"s3-website-us-west-1.amazonaws.com",
18+
"s3-website-us-west-2.amazonaws.com",
19+
"s3-website.ap-south-1.amazonaws.com",
20+
"s3-website.ap-northeast-2.amazonaws.com",
21+
"s3-website-ap-southeast-1.amazonaws.com",
22+
"s3-website-ap-southeast-2.amazonaws.com",
23+
"s3-website-ap-northeast-1.amazonaws.com",
24+
"s3-website.eu-central-1.amazonaws.com",
25+
"s3-website-eu-west-1.amazonaws.com",
26+
"s3-website-sa-east-1.amazonaws.com",
27+
"s3-website.localhost",
28+
"s3-website.scality.test"],
29+
"replicationEndpoints": [{
30+
"site": "zenko",
31+
"servers": ["127.0.0.1:8000"],
32+
"default": true
33+
}, {
34+
"site": "us-east-2",
35+
"type": "aws_s3"
36+
}],
37+
"cdmi": {
38+
"host": "localhost",
39+
"port": 81,
40+
"path": "/dewpoint",
41+
"readonly": true
42+
},
43+
"bucketd": {
44+
"bootstrap": ["localhost:9000"]
45+
},
46+
"vaultd": {
47+
"host": "localhost",
48+
"port": 8500
49+
},
50+
"clusters": 10,
51+
"log": {
52+
"logLevel": "info",
53+
"dumpLevel": "error"
54+
},
55+
"healthChecks": {
56+
"allowFrom": ["127.0.0.1/8", "::1"]
57+
},
58+
"metadataClient": {
59+
"host": "localhost",
60+
"port": 9990
61+
},
62+
"dataClient": {
63+
"host": "localhost",
64+
"port": 9991
65+
},
66+
"metadataDaemon": {
67+
"bindAddress": "localhost",
68+
"port": 9990
69+
},
70+
"dataDaemon": {
71+
"bindAddress": "localhost",
72+
"port": 9991
73+
},
74+
"recordLog": {
75+
"enabled": false,
76+
"recordLogName": "s3-recordlog"
77+
},
78+
"requests": {
79+
"viaProxy": false,
80+
"trustedProxyCIDRs": [],
81+
"extractClientIPFromHeader": ""
82+
},
83+
"bucketNotificationDestinations": [
84+
{
85+
"resource": "target1",
86+
"type": "dummy",
87+
"host": "localhost:6000"
88+
}
89+
],
90+
"defaultEncryptionKeyPerAccount": true
91+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"port": 8000,
3+
"listenOn": [],
4+
"metricsPort": 8002,
5+
"metricsListenOn": [],
6+
"replicationGroupId": "RG001",
7+
"restEndpoints": {
8+
"localhost": "us-east-1",
9+
"127.0.0.1": "us-east-1",
10+
"cloudserver-front": "us-east-1",
11+
"s3.docker.test": "us-east-1",
12+
"127.0.0.2": "us-east-1",
13+
"s3.amazonaws.com": "us-east-1"
14+
},
15+
"websiteEndpoints": ["s3-website-us-east-1.amazonaws.com",
16+
"s3-website.us-east-2.amazonaws.com",
17+
"s3-website-us-west-1.amazonaws.com",
18+
"s3-website-us-west-2.amazonaws.com",
19+
"s3-website.ap-south-1.amazonaws.com",
20+
"s3-website.ap-northeast-2.amazonaws.com",
21+
"s3-website-ap-southeast-1.amazonaws.com",
22+
"s3-website-ap-southeast-2.amazonaws.com",
23+
"s3-website-ap-northeast-1.amazonaws.com",
24+
"s3-website.eu-central-1.amazonaws.com",
25+
"s3-website-eu-west-1.amazonaws.com",
26+
"s3-website-sa-east-1.amazonaws.com",
27+
"s3-website.localhost",
28+
"s3-website.scality.test"],
29+
"replicationEndpoints": [{
30+
"site": "zenko",
31+
"servers": ["127.0.0.1:8000"],
32+
"default": true
33+
}, {
34+
"site": "us-east-2",
35+
"type": "aws_s3"
36+
}],
37+
"cdmi": {
38+
"host": "localhost",
39+
"port": 81,
40+
"path": "/dewpoint",
41+
"readonly": true
42+
},
43+
"bucketd": {
44+
"bootstrap": ["localhost:9000"]
45+
},
46+
"vaultd": {
47+
"host": "localhost",
48+
"port": 8500
49+
},
50+
"clusters": 10,
51+
"log": {
52+
"logLevel": "debug",
53+
"dumpLevel": "error"
54+
},
55+
"healthChecks": {
56+
"allowFrom": ["127.0.0.1/8", "::1"]
57+
},
58+
"metadataClient": {
59+
"host": "localhost",
60+
"port": 9990
61+
},
62+
"dataClient": {
63+
"host": "localhost",
64+
"port": 9991
65+
},
66+
"metadataDaemon": {
67+
"bindAddress": "localhost",
68+
"port": 9990
69+
},
70+
"dataDaemon": {
71+
"bindAddress": "localhost",
72+
"port": 9991
73+
},
74+
"recordLog": {
75+
"enabled": false,
76+
"recordLogName": "s3-recordlog"
77+
},
78+
"requests": {
79+
"viaProxy": false,
80+
"trustedProxyCIDRs": [],
81+
"extractClientIPFromHeader": ""
82+
},
83+
"bucketNotificationDestinations": [
84+
{
85+
"resource": "target1",
86+
"type": "dummy",
87+
"host": "localhost:6000"
88+
}
89+
],
90+
"defaultEncryptionKeyPerAccount": true,
91+
"kmsHideScalityArn": true,
92+
"sseMigration": {
93+
"previousKeyType": "internal",
94+
"previousKeyProtocol": "file",
95+
"previousKeyProvider": "scality"
96+
},
97+
"kmsAWS": {
98+
"noAwsArn": true,
99+
"providerName": "local",
100+
"region": "us-east-1",
101+
"endpoint": "http://0:8080",
102+
"ak": "456",
103+
"sk": "123"
104+
}
105+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"port": 8000,
3+
"listenOn": [],
4+
"metricsPort": 8002,
5+
"metricsListenOn": [],
6+
"replicationGroupId": "RG001",
7+
"restEndpoints": {
8+
"localhost": "us-east-1",
9+
"127.0.0.1": "us-east-1",
10+
"cloudserver-front": "us-east-1",
11+
"s3.docker.test": "us-east-1",
12+
"127.0.0.2": "us-east-1",
13+
"s3.amazonaws.com": "us-east-1"
14+
},
15+
"websiteEndpoints": ["s3-website-us-east-1.amazonaws.com",
16+
"s3-website.us-east-2.amazonaws.com",
17+
"s3-website-us-west-1.amazonaws.com",
18+
"s3-website-us-west-2.amazonaws.com",
19+
"s3-website.ap-south-1.amazonaws.com",
20+
"s3-website.ap-northeast-2.amazonaws.com",
21+
"s3-website-ap-southeast-1.amazonaws.com",
22+
"s3-website-ap-southeast-2.amazonaws.com",
23+
"s3-website-ap-northeast-1.amazonaws.com",
24+
"s3-website.eu-central-1.amazonaws.com",
25+
"s3-website-eu-west-1.amazonaws.com",
26+
"s3-website-sa-east-1.amazonaws.com",
27+
"s3-website.localhost",
28+
"s3-website.scality.test"],
29+
"replicationEndpoints": [{
30+
"site": "zenko",
31+
"servers": ["127.0.0.1:8000"],
32+
"default": true
33+
}, {
34+
"site": "us-east-2",
35+
"type": "aws_s3"
36+
}],
37+
"cdmi": {
38+
"host": "localhost",
39+
"port": 81,
40+
"path": "/dewpoint",
41+
"readonly": true
42+
},
43+
"bucketd": {
44+
"bootstrap": ["localhost:9000"]
45+
},
46+
"vaultd": {
47+
"host": "localhost",
48+
"port": 8500
49+
},
50+
"clusters": 10,
51+
"log": {
52+
"logLevel": "info",
53+
"dumpLevel": "error"
54+
},
55+
"healthChecks": {
56+
"allowFrom": ["127.0.0.1/8", "::1"]
57+
},
58+
"metadataClient": {
59+
"host": "localhost",
60+
"port": 9990
61+
},
62+
"dataClient": {
63+
"host": "localhost",
64+
"port": 9991
65+
},
66+
"metadataDaemon": {
67+
"bindAddress": "localhost",
68+
"port": 9990
69+
},
70+
"dataDaemon": {
71+
"bindAddress": "localhost",
72+
"port": 9991
73+
},
74+
"recordLog": {
75+
"enabled": false,
76+
"recordLogName": "s3-recordlog"
77+
},
78+
"requests": {
79+
"viaProxy": false,
80+
"trustedProxyCIDRs": [],
81+
"extractClientIPFromHeader": ""
82+
},
83+
"bucketNotificationDestinations": [
84+
{
85+
"resource": "target1",
86+
"type": "dummy",
87+
"host": "localhost:6000"
88+
}
89+
],
90+
"defaultEncryptionKeyPerAccount": true,
91+
"kmsHideScalityArn": false,
92+
"sseMigration": {
93+
"previousKeyType": "internal",
94+
"previousKeyProtocol": "file",
95+
"previousKeyProvider": "scality"
96+
},
97+
"kmsAWS": {
98+
"noAwsArn": true,
99+
"providerName": "local",
100+
"region": "us-east-1",
101+
"endpoint": "http://0:8080",
102+
"ak": "456",
103+
"sk": "123"
104+
}
105+
}

0 commit comments

Comments
 (0)