]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/rgw/rgw_multi/tests.py: decode retval of bucket.get_policy()
authorKefu Chai <kchai@redhat.com>
Mon, 6 Apr 2020 15:20:32 +0000 (23:20 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 13:51:23 +0000 (21:51 +0800)
return value of bucket.get_policy() is a bytes, so we need to decode it
before comparing it with a string, since the content of policy is ASCII,
it'd be suffice to decode it with 'ascii'.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/rgw/rgw_multi/tests.py

index 5a496d39665fa14775a4abeb809da98d0548ded4..018aa4bd4ec48b6c4e33948b2bf069af7f085e61 100644 (file)
@@ -1093,7 +1093,7 @@ def test_set_bucket_policy():
     buckets, zone_bucket = create_bucket_per_zone_in_realm()
     for _, bucket in zone_bucket:
         bucket.set_policy(policy)
-        assert(bucket.get_policy() == policy)
+        assert(bucket.get_policy().decode('ascii') == policy)
 
 def test_bucket_sync_disable():
     zonegroup = realm.master_zonegroup()