From 102d5e17bf72f642fbd80e161b260b72306ee8e1 Mon Sep 17 00:00:00 2001 From: Leonid Chernin Date: Wed, 22 Jan 2025 20:08:48 +0200 Subject: [PATCH] nvmeofgw*: test for encode/decode of new types added for epoch-filter feature Signed-off-by: Leonid Chernin --- src/test/test_nvmeof_mon_encoding.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/test/test_nvmeof_mon_encoding.cc b/src/test/test_nvmeof_mon_encoding.cc index d66efb77fe6..d7cbf44fd3a 100644 --- a/src/test/test_nvmeof_mon_encoding.cc +++ b/src/test/test_nvmeof_mon_encoding.cc @@ -79,12 +79,21 @@ void test_MNVMeofGwMap() { ceph::buffer::list bl; encode(map, bl, CEPH_FEATURES_ALL); - dout(0) << "encode: " << map << dendl; + dout(0) << "encoded: " << map << dendl; decode(map, bl); dout(0) << "decode: " << map << dendl; BeaconSubsystem sub = { nqn, {}, {} }; NVMeofGwMap pending_map; + pending_map.epoch = 2; + auto msg1 = make_message(pending_map); + dout(0) << "before encode empty msg: " << *msg1 << " epoch " << msg1->get_gwmap_epoch() << dendl; + msg1->encode_payload(CEPH_FEATURES_ALL); + dout(0) << "after encode empty msg: " << *msg1 << dendl; + msg1->decode_payload(); + int epoch = msg1->get_gwmap_epoch(); + dout(0) << "after decode empty msg: " << *msg1 << " epoch " << epoch << dendl; + pending_map.cfg_add_gw("GW1" ,group_key); pending_map.cfg_add_gw("GW2" ,group_key); pending_map.cfg_add_gw("GW3" ,group_key); @@ -101,7 +110,9 @@ void test_MNVMeofGwMap() { dout(0) << "False pending map: " << pending_map << dendl; auto msg = make_message(pending_map); - msg->encode_payload(0); + dout(0) << "before encode msg: " << *msg << dendl; + msg->encode_payload(CEPH_FEATURES_ALL); + dout(0) << "after encode msg: " << *msg << dendl; msg->decode_payload(); dout(0) << "decode msg: " << *msg << dendl; -- 2.47.3