Skip to content

Commit a284c9f

Browse files
committed
fixup! CLDSRV-863: PutObject/UploadPart checksum service tests
1 parent e04c96f commit a284c9f

1 file changed

Lines changed: 23 additions & 25 deletions

File tree

tests/functional/raw-node/test/checksumPutObjectUploadPart.js

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const msgSdkMissingTrailer = 'x-amz-sdk-checksum-algorithm specified, but no cor
145145
// urlFn() is called lazily at test runtime so that uploadId is available.
146146
function makeScenarioTests(urlFn) {
147147
itSkipIfAWS(
148-
'testS3PutNoChecksum: signed sha256 in x-amz-content-sha256, no x-amz-checksum header -> 200 OK',
148+
'should return 200 for signed sha256 in x-amz-content-sha256, no x-amz-checksum header',
149149
done => {
150150
doPutRequest(urlFn(), {
151151
'x-amz-content-sha256': testContent2Sha256Hex,
@@ -154,7 +154,7 @@ function makeScenarioTests(urlFn) {
154154
});
155155

156156
itSkipIfAWS(
157-
'testS3PutChecksum: correct sha256 checksum with x-amz-sdk-checksum-algorithm -> 200 OK',
157+
'should return 200 for correct sha256 checksum with x-amz-sdk-checksum-algorithm',
158158
done => {
159159
doPutRequest(urlFn(), {
160160
'x-amz-content-sha256': testContent2Sha256Hex,
@@ -165,7 +165,7 @@ function makeScenarioTests(urlFn) {
165165
});
166166

167167
itSkipIfAWS(
168-
'testS3PutChecksumKo: wrong sha256 checksum with x-amz-sdk-checksum-algorithm -> 400 BadDigest',
168+
'should return 400 BadDigest for wrong sha256 checksum with x-amz-sdk-checksum-algorithm',
169169
done => {
170170
doPutRequest(urlFn(), {
171171
'x-amz-content-sha256': testContent2Sha256Hex,
@@ -177,7 +177,7 @@ function makeScenarioTests(urlFn) {
177177
});
178178

179179
itSkipIfAWS(
180-
'testS3PutChecksumUnsignedPayload: UNSIGNED-PAYLOAD with correct sha256 checksum -> 200 OK',
180+
'should return 200 for UNSIGNED-PAYLOAD with correct sha256 checksum',
181181
done => {
182182
doPutRequest(urlFn(), {
183183
'x-amz-content-sha256': 'UNSIGNED-PAYLOAD',
@@ -188,7 +188,7 @@ function makeScenarioTests(urlFn) {
188188
});
189189

190190
itSkipIfAWS(
191-
'testS3PutTrailerNoBody: TRAILER with empty body -> 400 IncompleteBody',
191+
'should return 400 IncompleteBody for TRAILER with empty body',
192192
done => {
193193
doPutRequest(urlFn(), {
194194
'x-amz-content-sha256': 'STREAMING-UNSIGNED-PAYLOAD-TRAILER',
@@ -200,7 +200,7 @@ function makeScenarioTests(urlFn) {
200200
});
201201

202202
itSkipIfAWS(
203-
'testS3PutTrailerOk: TRAILER with correct sha256 checksum -> 200 OK',
203+
'should return 200 for TRAILER with correct sha256 checksum',
204204
done => {
205205
const body = buildOkTrailerBody();
206206
doPutRequest(urlFn(), {
@@ -212,7 +212,7 @@ function makeScenarioTests(urlFn) {
212212
});
213213

214214
itSkipIfAWS(
215-
'testS3PutTrailerBadDecodedLen: wrong x-amz-decoded-content-length (7 but actual is 32) -> 500 InternalError',
215+
'should return 500 InternalError for wrong x-amz-decoded-content-length',
216216
done => {
217217
// Two chunks of 16 bytes each with a valid crc64nvme trailer.
218218
const body =
@@ -229,8 +229,7 @@ function makeScenarioTests(urlFn) {
229229
});
230230

231231
itSkipIfAWS(
232-
'testS3PutTrailerAlgoMismatch: x-amz-trailer says sha1 but body trailer has sha256 ' +
233-
' -> 400 MalformedTrailerError',
232+
'should return 400 MalformedTrailerError when x-amz-trailer says sha1 but body trailer has sha256',
234233
done => {
235234
// Header announces sha1 but the actual trailer line carries sha256.
236235
const body =
@@ -245,7 +244,7 @@ function makeScenarioTests(urlFn) {
245244
});
246245

247246
itSkipIfAWS(
248-
'testS3PutTrailerBadDigest: TRAILER with wrong sha256 checksum -> 400 BadDigest',
247+
'should return 400 BadDigest for TRAILER with wrong sha256 checksum',
249248
done => {
250249
const wrongSha256 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=';
251250
const body =
@@ -260,7 +259,7 @@ function makeScenarioTests(urlFn) {
260259
});
261260

262261
itSkipIfAWS(
263-
'testS3PutTrailerAndChecksum: x-amz-trailer + x-amz-checksum-crc32 header -> 400 InvalidRequest',
262+
'should return 400 InvalidRequest for x-amz-trailer + x-amz-checksum-crc32 header',
264263
done => {
265264
const body = buildOkTrailerBody();
266265
doPutRequest(urlFn(), {
@@ -274,7 +273,7 @@ function makeScenarioTests(urlFn) {
274273
});
275274

276275
itSkipIfAWS(
277-
'testS3PutTrailerNoTrailerInHeader: no x-amz-trailer header but body has trailer -> 400 MalformedTrailerError',
276+
'should return 400 MalformedTrailerError when no x-amz-trailer header but body has trailer',
278277
done => {
279278
const body = buildOkTrailerBody();
280279
doPutRequest(urlFn(), {
@@ -287,7 +286,7 @@ function makeScenarioTests(urlFn) {
287286
});
288287

289288
itSkipIfAWS(
290-
'testS3PutTrailerContentLength: TRAILER with explicit Content-Length -> 200 OK',
289+
'should return 200 for TRAILER with explicit Content-Length',
291290
done => {
292291
const body = buildOkTrailerBody();
293292
doPutRequest(urlFn(), {
@@ -299,7 +298,7 @@ function makeScenarioTests(urlFn) {
299298
});
300299

301300
itSkipIfAWS(
302-
'testS3PutTrailerSDK: TRAILER with matching x-amz-sdk-checksum-algorithm:SHA256 -> 200 OK',
301+
'should return 200 for TRAILER with matching x-amz-sdk-checksum-algorithm:SHA256',
303302
done => {
304303
const body = buildOkTrailerBody();
305304
doPutRequest(urlFn(), {
@@ -312,8 +311,7 @@ function makeScenarioTests(urlFn) {
312311
});
313312

314313
itSkipIfAWS(
315-
'testS3PutTrailerSDKMismatch: x-amz-sdk-checksum-algorithm:SHA1 but x-amz-trailer is sha256 ' +
316-
'-> 400 InvalidRequest',
314+
'should return 400 InvalidRequest when x-amz-sdk-checksum-algorithm:SHA1 but x-amz-trailer is sha256',
317315
done => {
318316
const body = buildOkTrailerBody();
319317
doPutRequest(urlFn(), {
@@ -327,7 +325,7 @@ function makeScenarioTests(urlFn) {
327325
});
328326

329327
itSkipIfAWS(
330-
'testS3PutTrailerUnknownTrailerAlgo: x-amz-trailer:x-amz-checksum-sha3 (unknown) -> 400 InvalidRequest',
328+
'should return 400 InvalidRequest for x-amz-trailer:x-amz-checksum-sha3 (unknown algo)',
331329
done => {
332330
const body = buildOkTrailerBody();
333331
doPutRequest(urlFn(), {
@@ -340,7 +338,7 @@ function makeScenarioTests(urlFn) {
340338
});
341339

342340
itSkipIfAWS(
343-
'testS3PutTrailerInvalidTrailerHeader: x-amz-trailer with non-checksum value -> 400 InvalidRequest',
341+
'should return 400 InvalidRequest for x-amz-trailer with non-checksum value',
344342
done => {
345343
const body = buildOkTrailerBody();
346344
doPutRequest(urlFn(), {
@@ -353,7 +351,7 @@ function makeScenarioTests(urlFn) {
353351
});
354352

355353
itSkipIfAWS(
356-
'testS3PutTrailerInvalidTrailerBody: trailer body has invalid base64 checksum value -> 400 InvalidRequest',
354+
'should return 400 InvalidRequest for trailer body with invalid base64 checksum value',
357355
done => {
358356
const body = 'f\r\ntrailer content\r\n0\r\nx-amz-checksum-sha256:BAD\n\r\n\r\n\r\n';
359357
doPutRequest(urlFn(), {
@@ -366,7 +364,7 @@ function makeScenarioTests(urlFn) {
366364
});
367365

368366
itSkipIfAWS(
369-
'testS3PutTrailerSDKMissingTrailer: x-amz-sdk-checksum-algorithm without x-amz-trailer -> 400 InvalidRequest',
367+
'should return 400 InvalidRequest for x-amz-sdk-checksum-algorithm without x-amz-trailer',
370368
done => {
371369
const body = buildOkTrailerBody();
372370
doPutRequest(urlFn(), {
@@ -380,7 +378,7 @@ function makeScenarioTests(urlFn) {
380378
});
381379

382380
itSkipIfAWS(
383-
'testS3PutTrailerNoTrailerInBody: x-amz-trailer header but body has no trailer -> 400 MalformedTrailerError',
381+
'should return 400 MalformedTrailerError when x-amz-trailer header present but body has no trailer',
384382
done => {
385383
// Body ends with "0\r\n\r\n" — empty trailer section, no checksum line.
386384
const body = 'f\r\ntrailer content\r\n0\r\n\r\n';
@@ -394,7 +392,7 @@ function makeScenarioTests(urlFn) {
394392
});
395393

396394
itSkipIfAWS(
397-
'testS3PutTrailerNoTrailerInBodyAndHeader: no x-amz-trailer, no body trailer -> 200 OK',
395+
'should return 200 when no x-amz-trailer and no body trailer',
398396
done => {
399397
// No x-amz-trailer header; body just has chunked data with no trailer.
400398
const body = 'f\r\ntrailer content\r\n0\r\n\r\n';
@@ -407,7 +405,7 @@ function makeScenarioTests(urlFn) {
407405
});
408406

409407
itSkipIfAWS(
410-
'testS3PutTrailerDataAfterCRLF: data after final CRLF is ignored -> 200 OK',
408+
'should return 200 and ignore data after final CRLF',
411409
done => {
412410
// No x-amz-trailer; after the terminating CRLF there is extra data.
413411
// TrailingChecksumTransform discards everything after streamClosed=true.
@@ -421,7 +419,7 @@ function makeScenarioTests(urlFn) {
421419
});
422420

423421
itSkipIfAWS(
424-
'testS3PutTrailerWithContentMD5: TRAILER + correct Content-MD5 header -> 200 OK',
422+
'should return 200 for TRAILER with correct Content-MD5 header',
425423
done => {
426424
const body = buildOkTrailerBody();
427425
doPutRequest(urlFn(), {
@@ -435,7 +433,7 @@ function makeScenarioTests(urlFn) {
435433
});
436434

437435
itSkipIfAWS(
438-
'testS3PutTrailerWithWhitespace: trailer line with whitespace around name and value -> 200 OK',
436+
'should return 200 for trailer line with whitespace around name and value',
439437
done => {
440438
// TrailingChecksumTransform trims both name and value, so whitespace is accepted.
441439
const body =

0 commit comments

Comments
 (0)