@@ -495,6 +495,18 @@ TEST_F(LibRadosIoPP, XattrListPP) {
495495 }
496496}
497497
498+ TEST_F (LibRadosIoPP, CrcZeroWrite) {
499+ char buf[128 ];
500+ bufferlist bl;
501+
502+ ASSERT_EQ (0 , ioctx.write (" foo" , bl, 0 , 0 ));
503+ ASSERT_EQ (0 , ioctx.write (" foo" , bl, 0 , sizeof (buf)));
504+
505+ ObjectReadOperation read;
506+ read.read (0 , bl.length (), NULL , NULL );
507+ ASSERT_EQ (0 , ioctx.operate (" foo" , &read, &bl));
508+ }
509+
498510TEST_F (LibRadosIoECPP, SimpleWritePP) {
499511 SKIP_IF_CRIMSON ();
500512 char buf[128 ];
@@ -865,6 +877,22 @@ TEST_F(LibRadosIoECPP, RmXattrPP) {
865877 ASSERT_EQ (-ENOENT, ioctx.rmxattr (" foo_rmxattr" , attr2));
866878}
867879
880+ TEST_F (LibRadosIoECPP, CrcZeroWrite) {
881+ SKIP_IF_CRIMSON ();
882+ set_allow_ec_overwrites (pool_name, true );
883+ char buf[128 ];
884+ memset (buf, 0xcc , sizeof (buf));
885+ bufferlist bl;
886+
887+ ASSERT_EQ (0 , ioctx.write (" foo" , bl, 0 , 0 ));
888+ ASSERT_EQ (0 , ioctx.write (" foo" , bl, 0 , sizeof (buf)));
889+
890+ ObjectReadOperation read;
891+ read.read (0 , bl.length (), NULL , NULL );
892+ ASSERT_EQ (0 , ioctx.operate (" foo" , &read, &bl));
893+ recreate_pool ();
894+ }
895+
868896TEST_F (LibRadosIoECPP, XattrListPP) {
869897 SKIP_IF_CRIMSON ();
870898 char buf[128 ];
0 commit comments