Skip to content

Check for either 400 or 416 response code for invalid range test#195

Merged
vasukulkarni merged 1 commit intomasterfrom
wip-fix-416
Nov 7, 2017
Merged

Check for either 400 or 416 response code for invalid range test#195
vasukulkarni merged 1 commit intomasterfrom
wip-fix-416

Conversation

@vasukulkarni
Copy link
Copy Markdown
Contributor

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1501005
Also needs backport to ceph-luminous.

Signed-off-by: Vasu Kulkarni vasu@redhat.com

@vasukulkarni
Copy link
Copy Markdown
Contributor Author

# on RHEL we get response 416, check bugzilla 1501005
valid_status = [400, 416]
if not any(s == e.status for s in valid_status):
raise AssertionError("Invalid response " + str(status))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will accept 400 or 416 for e.status, but the e.reason and e.error_code checks below are still specific to 400 Bad Request - right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't got past due to first assert, my guess was reason and error code should be same, I will know in new runs and update here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. for 416, i would expect e.reason to be Requested Range Not Satisfiable. for e.error_code, i don't think the requirements are well-defined, so it's probably best to ignore it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

@vasukulkarni vasukulkarni Nov 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh checking the branch, it used ceph-master, :(, so it never ran that unit test

@vasukulkarni
Copy link
Copy Markdown
Contributor Author

@cbodley updated, going to retest with force-branch

@vasukulkarni vasukulkarni force-pushed the wip-fix-416 branch 2 times, most recently from f43128c to 626aa98 Compare November 3, 2017 19:35
@vasukulkarni
Copy link
Copy Markdown
Contributor Author

@cbodley

http://magna002.ceph.redhat.com/vasu-2017-11-03_14:52:48-rgw:multifs-luminous---basic-multi/280594/teuthology.log

2017-11-03T16:36:42.374 INFO:teuthology.orchestra.run.clara003.stderr:s3tests.functional.test_s3.test_multipart_copy_invalid_range ... ok

eq(e.error_code, 'InvalidArgument')
# on RHEL we get response 416, check bugzilla 1501005
valid_status = [400, 416]
if not any(s == e.status for s in valid_status):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if e.status not in valid_status:
will also work here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better!, will update

if not any(s == e.status for s in valid_status):
raise AssertionError("Invalid response " + str(status))
valid_reason = ['Bad Request', 'Requested Range Not Satisfiable']
if not any(r == e.reason for r in valid_reason):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to above

@theanalyst
Copy link
Copy Markdown
Member

We need this commit for luminous branch as well now, seeing failures because of this http://pulpito.ceph.com/abhi-2017-11-05_16:46:58-rgw-wip-abhi-testing-2017-11-05-1320-distro-basic-smithi/

eq(e.status, 400)
eq(e.reason, 'Bad Request')
eq(e.error_code, 'InvalidArgument')
# on RHEL we get response 416, check bugzilla 1501005
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary to mention rhel or bugzillas, all versions of radosgw behave this way

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley if all versions behave same, do we need to check for 400 status code? can it be only 416 now? Not sure why it is 400?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's how it was submitted in #179, presumably because the referenced s3proxy change returned 400 there

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
@vasukulkarni
Copy link
Copy Markdown
Contributor Author

@cbodley @theanalyst updated

Copy link
Copy Markdown
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @vasukulkarni!

@cbodley
Copy link
Copy Markdown
Contributor

cbodley commented Nov 7, 2017

@yehudasa can you please review/merge? we had last discussed this in #179 (comment)

@vasukulkarni
Copy link
Copy Markdown
Contributor Author

Tested this internally.

@vasukulkarni vasukulkarni merged commit 33b1589 into master Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants