From 69e1d653ce3e9fc3e750a04b75a6276a41072060 Mon Sep 17 00:00:00 2001 From: Cesar Celis Hernandez Date: Wed, 25 May 2022 13:24:04 -0400 Subject: [PATCH] To update replication test accordingly (#2038) --- integration/user_api_bucket_test.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/integration/user_api_bucket_test.go b/integration/user_api_bucket_test.go index 196ade0e7..14c80457f 100644 --- a/integration/user_api_bucket_test.go +++ b/integration/user_api_bucket_test.go @@ -2787,7 +2787,10 @@ func TestReplication(t *testing.T) { } finalResponse := inspectHTTPResponse(response) if response != nil { - assert.Equal(204, response.StatusCode, finalResponse) + // https://github.com/minio/minio/pull/14972 + // Disallow deletion of arn when active replication config + // no longer 204 is expected due to above change + assert.Equal(500, response.StatusCode, finalResponse) } // 6. Delete 2nd rule only with dedicated end point for single rules: @@ -2804,7 +2807,10 @@ func TestReplication(t *testing.T) { } finalResponse = inspectHTTPResponse(response) if response != nil { - assert.Equal(204, response.StatusCode, finalResponse) + // https://github.com/minio/minio/pull/14972 + // Disallow deletion of arn when active replication config + // 204 is no longer expected but 500 + assert.Equal(500, response.StatusCode, finalResponse) } // 7. Delete remaining Bucket Replication Rule with generic end point: @@ -2819,7 +2825,10 @@ func TestReplication(t *testing.T) { } finalResponse = inspectHTTPResponse(response) if response != nil { - assert.Equal(204, response.StatusCode, finalResponse) + // https://github.com/minio/minio/pull/14972 + // Disallow deletion of arn when active replication config + // 204 is no longer expected but 500 + assert.Equal(500, response.StatusCode, finalResponse) } // 8. Get replication, at this point zero rules are expected @@ -2841,8 +2850,9 @@ func TestReplication(t *testing.T) { log.Println(err) assert.Nil(err) } - - assert.Equal(len(structBucketRepl.Rules), 0, "Delete failed") + expected := 3 // none got deleted due to https://github.com/minio/minio/pull/14972 + actual := len(structBucketRepl.Rules) + assert.Equal(expected, actual, "Delete failed") } func GetBucketVersioning(bucketName string) (*http.Response, error) {