]> git.apps.os.sepia.ceph.com Git - ceph.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>
Sun, 14 Jun 2020 08:34:52 +0000 (16:34 +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>
(cherry picked from commit ea63b52b1705e80977ce1fe6d2dc276ea9477344)

src/test/rgw/rgw_multi/tests.py

index d7b5f84ed9963457d946bf50ad8ac635801b7029..a9d617699a464659e4bbdc6ccbe1cfcad12499f0 100644 (file)
@@ -1099,7 +1099,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()