Commit graph

42 commits

Author SHA1 Message Date
Andrew Gaul
e29168f8b9 Annotate tests which create non-RFC2616 headers
Signed-off-by: Andrew Gaul <andrew@gaul.org>
2016-06-06 16:30:26 -07:00
Javier M. Mellid
520eaa0b62 rgw: aws4: fix test_object_create_missing_signed_header_aws4
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2016-06-02 21:32:00 +00:00
Javier M. Mellid
ff9fb2d8ea rgw: aws4: fix test_object_create_missing_signed_custom_header_aws4
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2016-06-02 21:08:41 +00:00
Robin H. Johnson
d98d7956c1 Improve proxy error support: "Bad Request" case
If you are run the S3 testsuite against a reverse proxy (eg haproxy)
rather than RGW directly, some of the tests will return errors from the
proxy, rather than haproxy itself.

Some proxies differ from RGW in the exact case of 'Bad Request', so do
the match in a case-insensitive manner. Haproxy for example returns 'Bad
request'.

This removes the need for some of the prior fails_on_dho test tags, as
the failure was due to haproxy.

Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
2015-12-18 11:50:11 -08:00
Javier M. Mellid
914b0f36c1 rgw: add AWS4 auth testing support
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2015-12-18 00:22:11 +01:00
Robin H. Johnson
c5ba8c4e0f tests must have unique names, otherwise they override existing tests.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2015-06-14 22:10:35 -07:00
Yehuda Sadeh
1daa9ec8ec Merge pull request #37 from andrewgaul/empty-content-length
Do not check error_code with empty content length

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-02-27 10:38:21 -08:00
Yehuda Sadeh
923bf8845c Merge pull request #18 from andrewgaul/bad-digest
Test to find mismatched MD5

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-02-27 10:26:44 -08:00
Yehuda Sadeh
de985d8e14 Merge pull request #12 from andrewgaul/short-write-disable-retries
Disable retries to test short writes

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-02-27 10:17:48 -08:00
Yehuda Sadeh
a9dab59337 s3tests: fix test_bucket_create_bad_contentlength_empty
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-02-27 10:23:09 -08:00
Andrew Gaul
c280ade220 Do not check error_code with empty content length
This matches test_bucket_create_bad_contentlength_negative.
2015-01-06 13:54:15 -08:00
Andrew Gaul
9b17da16cd Test to find mismatched MD5
Also clarify the invalid digest test.
2014-12-22 20:26:39 -08:00
Yehuda Sadeh
8f6c109882 test_object_create_bad_authorization_incorrect: fixes
The test should expect BadSignature. Also, provide a key that does not
already exist on aws.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-12-16 12:56:53 -08:00
Andrew Gaul
74a08169b1 Disable retries to test short writes
Previously test_object_create_bad_contentlength_mismatch_above failed
with:

Traceback (most recent call last):
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/gaul/work/s3-tests/s3tests/functional/test_headers.py", line 343, in test_object_create_bad_contentlength_mismatch_above
    e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, content)
  File "/home/gaul/work/s3-tests/s3tests/functional/utils.py", line 11, in assert_raises
    callableObj(*args, **kwargs)
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/s3/key.py", line 1379, in set_contents_from_string
    encrypt_key=encrypt_key)
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/s3/key.py", line 1246, in set_contents_from_file
    chunked_transfer=chunked_transfer, size=size)
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/s3/key.py", line 725, in send_file
    chunked_transfer=chunked_transfer, size=size)
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/s3/key.py", line 914, in _send_file_internal
    query_args=query_args
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/s3/connection.py", line 658, in make_request
    retry_handler=retry_handler
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/connection.py", line 1048, in make_request
    retry_handler=retry_handler)
  File "/home/gaul/work/s3-tests/virtualenv/local/lib/python2.7/site-packages/boto/connection.py", line 1004, in _mexe
    raise BotoServerError(response.status, response.reason, body)
BotoServerError: BotoServerError: 400 Bad Request
2014-08-01 21:47:13 -07:00
Wyllys Ingersoll
30ed65e6ba Fixed contentlength_negative tests to ignore the error_code 2013-06-03 15:07:21 -04:00
Yehuda Sadeh
509715810d rgw: remove fails_on_dho tags
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-01-18 10:33:02 -08:00
Mark Kampe
a268bcfbef RGW test-case annotation for inventory.
Annotated S3 functional and error-detection test cases
with resource/method/operation/assertion properties to
enable automatic test case inventory generation.

Signed-off-by: Mark Kampe <mark.kampe@dreamhost.com>
2011-12-22 16:09:21 -08:00
Yehuda Sadeh
f7dde840a3 test_bucket_create_bad_contentlength_empty should use its own connection
since it can leave the connection in a wierd state
2011-11-22 14:46:53 -08:00
Yehuda Sadeh
a030d88e58 add bucket header tests 2011-11-22 13:25:42 -08:00
Stephon Striplin
83755e2782 remove fails_on_{dho,rgw} on passing tests 2011-10-07 12:30:15 -07:00
Sage Weil
211df8dc22 add fails_on_dho to test_object_create_bad_authorization_unreadable 2011-09-26 13:37:16 -07:00
Stephon Striplin
2fcdc79299 add fail_on_rgw on test_object_create_bad_authorization_unreadable 2011-09-23 15:14:26 -07:00
Stephon Striplin
377e968120 Rename object acl test 2011-09-22 13:07:02 -07:00
Stephon Striplin
dc732021d6 add no Content-Length PUT object acl test 2011-09-22 12:50:13 -07:00
Stephon Striplin
e4d78eccbb add test for missing Content-Length header bucket creation 2011-08-25 17:46:25 -07:00
Stephon Striplin
adcfe6f681 remove contentlength zero header test
This test effectively tells the server that this request will contain no
data and any data in the body should be interpreted to be part of the
next request. By luck, we close the tcp connection beforehand so we
don't see this additional data. However, the issues caused here would
not be at the rgw/dho level.
2011-08-11 11:01:56 -07:00
Tommi Virtanen
230ec11852 Flag test_object_create_bad_contenttype_unreadable as failing on both RGW and DHO. 2011-08-11 09:35:06 -07:00
Tommi Virtanen
6577c8266c Flag some fails_on_dho tests as fails_on_rgw too. 2011-08-11 08:47:25 -07:00
Tommi Virtanen
199b8b46c5 Test S3 api for handling of Content-MD5 that does not match.
The existing test_object_create_bad_md5_invalid is not valid
base64, and hence triggers a different code path. This time,
submit valid base64, but have the result not match the expected
md5sum.
2011-08-10 14:55:34 -07:00
Stephon Striplin
a1102aaaad add Authorization header tests 2011-07-28 16:46:53 -07:00
Stephon Striplin
1dedf26b95 refactor header update logic 2011-07-28 11:34:52 -07:00
Stephon Striplin
832b297cec support multiple boto versions for header writing
Depending on the version of boto, different methods are necessary for
manipulating headers. We now support 2.0rc1 and 2.0 by sub-classing
boto.s3.connection.S3Connection and overloading
boto.connection.HTTPRequest.authorize, respectfully.
2011-07-27 20:04:33 -07:00
Stephon Striplin
ade49565db change utf8 -> unreadable on header tests 2011-07-27 11:49:18 -07:00
Stephon Striplin
3b15fc7547 add Date header tests 2011-07-27 10:31:00 -07:00
Stephon Striplin
28c4b432c4 add a Content-Type header test 2011-07-27 10:30:24 -07:00
Stephon Striplin
ab7b4eb03d update Content-Length header tests
* Add more tests
* Add nose.with_setup on some tests
2011-07-27 10:30:00 -07:00
Stephon Striplin
73a2f8fd7f add another Expect header test 2011-07-27 10:29:37 -07:00
Stephon Striplin
2b63bfc18d update MD5 header tests
* Rename a test
* Add more tests
2011-07-27 10:29:06 -07:00
Stephon Striplin
405f33e10c add User-Agent header tests 2011-07-27 10:28:03 -07:00
Stephon Striplin
82ac4f0138 subclass S3Connection class for headers
This makes it possible to overwrite all headers
2011-07-27 10:27:45 -07:00
Stephon Striplin
a775f5da04 add Content-Type object tests 2011-07-25 14:12:50 -07:00
Stephon Striplin
2e351e9eb8 add header-manipulation tests
These tests are based on explicitly modifying headers in some way.
2011-07-25 11:25:39 -07:00