From a28cb27f725ee6d216c67d82330cac7f11ed1edb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 27 May 2019 13:04:41 +0800 Subject: [PATCH] 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 --- .../librados_test_stub/LibradosTestStub.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 11db4308b1b..7b7093f8571 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; +} -- 2.39.5