From ee6abd0e8a778da16874db392586b924b6ecb3d3 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Wed, 15 Jan 2025 06:55:22 -0800 Subject: [PATCH] test(client-s3): disable checksum calculation and validation in legacy tests (#6804) --- features/s3/step_definitions/buckets.js | 4 ++++ features/s3/step_definitions/hooks.js | 2 ++ features/s3/step_definitions/objects.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/features/s3/step_definitions/buckets.js b/features/s3/step_definitions/buckets.js index ff6b49318400..abfb96e8b928 100644 --- a/features/s3/step_definitions/buckets.js +++ b/features/s3/step_definitions/buckets.js @@ -21,6 +21,8 @@ After({ tags: "@buckets" }, function (callback) { Given("I am using the S3 {string} region", function (region, callback) { this.s3 = new this.S3({ region: region, + requestChecksumCalculation: "WHEN_REQUIRED", + responseChecksumValidation: "WHEN_REQUIRED", }); callback(); }); @@ -235,6 +237,8 @@ When("I create a bucket with a DNS compatible name that contains a dot", functio Given("I force path style requests", function (callback) { this.s3 = new this.S3({ forcePathStyle: true, + requestChecksumCalculation: "WHEN_REQUIRED", + responseChecksumValidation: "WHEN_REQUIRED", }); callback(); }); diff --git a/features/s3/step_definitions/hooks.js b/features/s3/step_definitions/hooks.js index abfeda1fb730..d422d69d3143 100644 --- a/features/s3/step_definitions/hooks.js +++ b/features/s3/step_definitions/hooks.js @@ -4,6 +4,8 @@ Before({ tags: "@s3" }, function (scenario, callback) { const { S3 } = require("../../../clients/client-s3"); this.service = this.s3 = new S3({ maxRetries: 100, + requestChecksumCalculation: "WHEN_REQUIRED", + responseChecksumValidation: "WHEN_REQUIRED", }); callback(); }); diff --git a/features/s3/step_definitions/objects.js b/features/s3/step_definitions/objects.js index 61e9b7f6ccb2..2cc5cb4972a8 100644 --- a/features/s3/step_definitions/objects.js +++ b/features/s3/step_definitions/objects.js @@ -95,7 +95,7 @@ Then("the object {string} should contain {string}", function (key, contents, nex }); Then("the HTTP response should have a content length of {int}", function (contentLength, next) { - this.assert.equal(this.data.Body.headers["content-length"], contentLength); + this.assert.equal(this.data.ContentLength, contentLength); next(); });