]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_dencoder: set identity_type when creating samples
authorKefu Chai <kchai@redhat.com>
Mon, 16 Aug 2021 08:01:42 +0000 (16:01 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 16 Aug 2021 08:33:10 +0000 (16:33 +0800)
otherwise identity_type is a random number on stack. and there is good
chance that it does not match with the one decoded from the encoded
blob.

this change should address the failures like:

**** rgw_log_entry test 2 binary reencode check failed ****
   ceph-dencoder type rgw_log_entry select_test 2 encode export /tmp/typ-O8hVYK2Gb
   ceph-dencoder type rgw_log_entry select_test 2 encode decode encode export /tmp/typ-G09itHHIC
   cmp /tmp/typ-O8hVYK2Gb /tmp/typ-G09itHHIC

The following tests FAILED:
132 - check-generated.sh (Failed)
..

Fixes: https://tracker.ceph.com/issues/52278
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/rgw_dencoder.cc

index 3ed328c9071cdc0ca0e1609e5151de61aab4b48f..69eb70770cb74da919473cfd83f7eb2244763431 100644 (file)
@@ -82,6 +82,7 @@ void rgw_log_entry::generate_test_instances(list<rgw_log_entry*>& o)
   e->referrer = "referrer";
   e->bucket_id = "10";
   e->trans_id = "trans_id";
+  e->identity_type = TYPE_RGW;
   o.push_back(e);
   o.push_back(new rgw_log_entry);
 }