From: Kefu Chai Date: Mon, 27 May 2019 05:04:41 +0000 (+0800) Subject: test/librados_test_stub: define more stub functions X-Git-Tag: v15.1.0~2612^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28250%2Fhead;p=ceph.git test/librados_test_stub: define more stub functions this change helps to silence warnings like: Failed to load class: cas (/home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libcls_cas.so): /home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libcls_cas.so: undefined symbol: _Z27cls_cxx_chunk_write_and_setPviiPN4ceph6buffer7v14_2_04listEjS4_i currently, LibradosTestStub.cc only offers the minimum set of APIs used by class objects to support librbd related tests. but when `TestClassHandler::open_class()` enumates the object classes and then tries to load them, some of the classes fail to load due to unresolvable symbols. it's fine in the sense that these classes are not tested by the librbd tests. but these warning messages are just annoying and sometimes misleading, so in this change, the missing symbols are added as dummy stubs which just returns `-ENOTSUP` to silence the messages. Signed-off-by: Kefu Chai --- diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 11db4308b1b6..7b7093f85715 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -1475,3 +1475,21 @@ int cls_register_cxx_filter(cls_handle_t hclass, ceph_release_t cls_get_required_osd_release(cls_handle_t hclass) { return ceph_release_t::nautilus; } + +// stubs to silence TestClassHandler::open_class() +PGLSFilter::~PGLSFilter() +{} + +int cls_gen_rand_base64(char *, int) { + return -ENOTSUP; +} + +int cls_cxx_chunk_write_and_set(cls_method_handle_t, int, + int, bufferlist *, + uint32_t, bufferlist *, int) { + return -ENOTSUP; +} + +int cls_cxx_map_read_header(cls_method_handle_t, bufferlist *) { + return -ENOTSUP; +}