From 001b7f3f55e01a99380f6db3aa48ca05afb3dda8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 2 Jun 2022 12:25:24 -0400 Subject: [PATCH] remove tests that fail on boto3's parameter validation Fixes: https://tracker.ceph.com/issues/55193 Signed-off-by: Casey Bodley --- s3tests_boto3/functional/test_headers.py | 22 ----------- s3tests_boto3/functional/test_s3.py | 49 ------------------------ 2 files changed, 71 deletions(-) diff --git a/s3tests_boto3/functional/test_headers.py b/s3tests_boto3/functional/test_headers.py index 47df776..9d77d8f 100644 --- a/s3tests_boto3/functional/test_headers.py +++ b/s3tests_boto3/functional/test_headers.py @@ -273,28 +273,6 @@ def test_object_create_bad_contentlength_none(): eq(status, 411) eq(error_code, 'MissingContentLength') -@tag('auth_common') -@attr(resource='object') -@attr(method='put') -@attr(operation='create w/content length too long') -@attr(assertion='fails 400') -# TODO: remove 'fails_on_rgw' and once we have learned how to remove the content-length header -@attr('fails_on_rgw') -def test_object_create_bad_contentlength_mismatch_above(): - content = 'bar' - length = len(content) + 1 - - client = get_client() - bucket_name = get_new_bucket() - key_name = 'foo' - headers = {'Content-Length': str(length)} - add_headers = (lambda **kwargs: kwargs['params']['headers'].update(headers)) - client.meta.events.register('before-sign.s3.PutObject', add_headers) - - e = assert_raises(ClientError, client.put_object, Bucket=bucket_name, Key=key_name, Body=content) - status, error_code = _get_status_and_error_code(e.response) - eq(status, 400) - @tag('auth_common') @attr(resource='object') @attr(method='put') diff --git a/s3tests_boto3/functional/test_s3.py b/s3tests_boto3/functional/test_s3.py index 9b04a5f..a3ecab4 100644 --- a/s3tests_boto3/functional/test_s3.py +++ b/s3tests_boto3/functional/test_s3.py @@ -4181,18 +4181,6 @@ def check_invalid_bucketname(invalid_name): status, error_code = _get_status_and_error_code(e.response) return (status, error_code) -@attr(resource='bucket') -@attr(method='put') -@attr(operation='empty name') -@attr(assertion='fails 405') -# TODO: remove this fails_on_rgw when I fix it -@attr('fails_on_rgw') -def test_bucket_create_naming_bad_short_empty(): - invalid_bucketname = '' - status, error_code = check_invalid_bucketname(invalid_bucketname) - eq(status, 405) - eq(error_code, 'MethodNotAllowed') - @attr(resource='bucket') @attr(method='put') @attr(operation='short (one character) name') @@ -4207,27 +4195,6 @@ def test_bucket_create_naming_bad_short_one(): def test_bucket_create_naming_bad_short_two(): check_bad_bucket_name('aa') -# Breaks DNS with SubdomainCallingFormat -@attr('fails_with_subdomain') -@attr(resource='bucket') -@attr(method='put') -@attr(operation='excessively long names') -@attr(assertion='fails with subdomain: 400') -# TODO: remove this fails_on_rgw when I fix it -@attr('fails_on_rgw') -def test_bucket_create_naming_bad_long(): - invalid_bucketname = 256*'a' - status, error_code = check_invalid_bucketname(invalid_bucketname) - eq(status, 400) - - invalid_bucketname = 280*'a' - status, error_code = check_invalid_bucketname(invalid_bucketname) - eq(status, 400) - - invalid_bucketname = 3000*'a' - status, error_code = check_invalid_bucketname(invalid_bucketname) - eq(status, 400) - def check_good_bucket_name(name, _prefix=None): """ Attempt to create a bucket with a specified name @@ -4350,22 +4317,6 @@ def test_bucket_list_long_name(): def test_bucket_create_naming_bad_ip(): check_bad_bucket_name('192.168.5.123') -# Breaks DNS with SubdomainCallingFormat -@attr('fails_with_subdomain') -@attr(resource='bucket') -@attr(method='put') -@attr(operation='create w/! in name') -@attr(assertion='fails with subdomain') -# TODO: remove this fails_on_rgw when I fix it -@attr('fails_on_rgw') -def test_bucket_create_naming_bad_punctuation(): - # characters other than [a-zA-Z0-9._-] - invalid_bucketname = 'alpha!soup' - status, error_code = check_invalid_bucketname(invalid_bucketname) - # TODO: figure out why a 403 is coming out in boto3 but not in boto2. - eq(status, 400) - eq(error_code, 'InvalidBucketName') - # test_bucket_create_naming_dns_* are valid but not recommended @attr(resource='bucket') @attr(method='put')