]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados_test_stub: define more stub functions 28250/head
authorKefu Chai <kchai@redhat.com>
Mon, 27 May 2019 05:04:41 +0000 (13:04 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 27 May 2019 05:12:29 +0000 (13:12 +0800)
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 <kchai@redhat.com>
src/test/librados_test_stub/LibradosTestStub.cc

index 11db4308b1b64a9f22e6003342112c117473fbd0..7b7093f857158fa20d1ce2e1e65cabae6b073200 100644 (file)
@@ -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;
+}