]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
check for either 400 or 416 response code for invalid range test wip-fix-416 195/head
authorVasu Kulkarni <vasu@redhat.com>
Fri, 3 Nov 2017 18:21:39 +0000 (11:21 -0700)
committerVasu Kulkarni <vasu@redhat.com>
Mon, 6 Nov 2017 19:35:32 +0000 (11:35 -0800)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
s3tests/functional/test_s3.py

index 915b9dad1ad5d60982a52fd6cb07ed11a28cf10c..b2813ecea9100d020b61b928abc9c0dae5a877da 100644 (file)
@@ -5351,9 +5351,14 @@ def test_multipart_copy_invalid_range():
     bucket, key = _create_key_with_random_content('source', size=5)
     upload = bucket.initiate_multipart_upload('dest')
     e = assert_raises(boto.exception.S3ResponseError, copy_part, bucket.name, key.name, bucket, 'dest', upload.id, 0, 0, 21)
-    eq(e.status, 400)
-    eq(e.reason, 'Bad Request')
-    eq(e.error_code, 'InvalidArgument')
+    valid_status = [400, 416]
+    if not e.status in valid_status:
+       raise AssertionError("Invalid response " + str(status))
+    valid_reason = ['Bad Request', 'Requested Range Not Satisfiable']
+    if not e.reason in valid_reason:
+       raise AssertionError("Invalid reason " + e.reason )
+    # no standard error code defined 
+    # eq(e.error_code, 'InvalidArgument')
 
 @attr(resource='object')
 @attr(method='put')