Project

General

Profile

Actions

Bug #977

closed

radosgw should provide error code for bad bucket name errors

Added by Anonymous about 13 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

s3 test

def check_bad_bucket_name(name):
    e = assert_raises(boto.exception.S3ResponseError, s3.main.create_bucket, name)
    eq(e.status, 400)
    eq(e.reason, 'Bad Request')
    eq(e.error_code, 'InvalidBucketName')

def test_bucket_create_naming_bad_starts_nonalpha():
    check_bad_bucket_name('_alphasoup')

fails because rgw does not provide error_code (or any body) in the response:

$ S3TEST_CONF=tv.conf ./virtualenv/bin/nosetests test_s3:test_bucket_create_naming_bad_starts_nonalpha
F
======================================================================
FAIL: test_s3.test_bucket_create_naming_bad_starts_nonalpha
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tv/src/s3-tests.git/virtualenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/tv/src/s3-tests.git/test_s3.py", line 246, in test_bucket_create_naming_bad_starts_nonalpha
    check_bad_bucket_name('_alphasoup')
  File "/home/tv/src/s3-tests.git/test_s3.py", line 237, in check_bad_bucket_name
    eq(e.error_code, 'InvalidBucketName')
  File "/home/tv/src/s3-tests.git/virtualenv/lib/python2.6/site-packages/nose/tools.py", line 31, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: None != 'InvalidBucketName'
-------------------- >> begin captured logging << --------------------
boto: DEBUG: path=/
boto: DEBUG: auth_path=/
boto: DEBUG: Canonical: GET

Tue, 05 Apr 2011 00:05:58 GMT
/
boto: DEBUG: Method: GET
boto: DEBUG: Path: /
boto: DEBUG: Data: 
boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS TKKZ1DX83O7ZCTWHE0YD:0zR721JhyORnuoCq5atq6KgdwaI=', 'User-Agent': 'Boto/2.0b4 (linux2)'}
boto: DEBUG: Host: localhost:7280
boto: DEBUG: establishing HTTP connection
boto: DEBUG: path=/
boto: DEBUG: auth_path=/
boto: DEBUG: Canonical: GET

Tue, 05 Apr 2011 00:05:58 GMT
/
boto: DEBUG: Method: GET
boto: DEBUG: Path: /
boto: DEBUG: Data: 
boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS O54XVCC9MQ9Q72TWP5Y1:okLeEzCDxd+VwYB5zMyA2AfVpGg=', 'User-Agent': 'Boto/2.0b4 (linux2)'}
boto: DEBUG: Host: localhost:7280
boto: DEBUG: establishing HTTP connection
boto: DEBUG: path=/_alphasoup/
boto: DEBUG: auth_path=/_alphasoup/
boto: DEBUG: Canonical: PUT

Tue, 05 Apr 2011 00:05:58 GMT
/_alphasoup/
boto: DEBUG: Method: PUT
boto: DEBUG: Path: /_alphasoup/
boto: DEBUG: Data: 
boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS O54XVCC9MQ9Q72TWP5Y1:4PiClxBCbuIA0DjKyLorZPQUnoI=', 'User-Agent': 'Boto/2.0b4 (linux2)'}
boto: DEBUG: Host: localhost:7280
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 0.037s

FAILED (failures=1)
Actions

Also available in: Atom PDF