]> 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>
Wed, 3 Jun 2020 11:56:59 +0000 (19:56 +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 01529c59d9d8b129ece8707757d73e53476ab0b5..201b2815738afb93078f1658387989c43b5d1202 100644 (file)
@@ -1106,7 +1106,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()