Skip to content

Commit 221a78d

Browse files
tst bucket website
1 parent 993ea41 commit 221a78d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,29 @@ describe('SSE KMS before migration', () => {
153153
: bkt.kmsKeyInfo.masterKeyId;
154154
}
155155
void await s3.createBucket(({ Bucket: bkt.name })).promise();
156+
// test reading website
157+
void await s3.putBucketWebsite({ Bucket: bkt.name, WebsiteConfiguration: { IndexDocument: { Suffix: 'index.html' }} }).promise();
158+
159+
const bpolicy = {
160+
"Version": "2012-10-17",
161+
"Statement": [
162+
{
163+
"Sid": "PublicReadGetObject",
164+
"Effect": "Allow",
165+
"Principal": "*",
166+
"Action": [
167+
"s3:GetObject"
168+
],
169+
"Resource": [
170+
`arn:aws:s3:::${bkt.name}/*`
171+
]
172+
}
173+
]
174+
}
175+
void await s3.putBucketPolicy({
176+
Bucket: bkt.name,
177+
Policy: JSON.stringify(bpolicy),
178+
}).promise();
156179
void await s3.createBucket(({ Bucket: bkt.vname })).promise();
157180
if (bktConf.algo) {
158181
// bucket encryption will be asserted in bucket test
@@ -184,6 +207,7 @@ describe('SSE KMS before migration', () => {
184207
? obj.kmsKeyInfo.masterKeyArn
185208
: obj.kmsKeyInfo.masterKeyId;
186209
}
210+
void await putEncryptedObject(bkt.name, `${objConf.name}/index.html`, objConf, obj.kmsKey, obj.body)
187211
return await putEncryptedObject(bkt.name, obj.name, objConf, obj.kmsKey, obj.body);
188212
}));
189213
};

0 commit comments

Comments
 (0)