Motr  M0
pd_ut.c File Reference
#include "lib/trace.h"
#include "ut/ut.h"
#include "fdmi/module.h"
#include "fdmi/fdmi.h"
#include "fdmi/fops.h"
#include "fdmi/service.h"
#include "fdmi/plugin_dock_internal.h"
#include "fdmi/ut/sd_common.h"
#include "lib/string.h"
#include "lib/finject.h"
#include "rpc/item_internal.h"
#include "rpc/packet_internal.h"
#include "rpc/rpc_internal.h"
#include "rpc/rpc_machine_internal.h"
#include "rpc/conn_pool_internal.h"
Include dependency graph for pd_ut.c:

Go to the source code of this file.

Data Structures

struct  pdock_client_conn
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_FDMI
 
#define FID_CTN   0xDEA110C
 
#define FID_KEY   0xDA221ED
 
#define FID_CTN1   0x1FA11ED
 
#define FID_KEY1   0x1A110CA
 
#define M0_FID(c_, k_)   { .f_container = c_, .f_key = k_ }
 

Functions

static int pd_ut_pcb_fdmi_rec (struct m0_uint128 *rec_id, struct m0_buf fdmi_rec, struct m0_fid filter_id)
 
void fdmi_pd_register_filter (void)
 
static void ut_pd_fom_fini (struct m0_fom *fom)
 
int detour_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
void __fdmi_pd_fom_norpc (bool register_filter)
 
void fdmi_pd_fom_norpc (void)
 
void fdmi_pd_rec_inject_fini (void)
 
static void my_item_done (struct m0_rpc_packet *p, struct m0_rpc_item *item, int rc)
 
static int my_packet_ready (struct m0_rpc_packet *p)
 
void fdmi_pd_fake_rec_reg (void)
 
void fdmi_pd_fake_rec_release (void)
 
void fdmi_pd_fake_release_rep (void)
 
struct m0_rpc_conn_poolut_pdock_conn_pool (void)
 
void fdmi_pd_fake_release_nomem ()
 

Variables

static struct m0_semaphore g_sem
 
struct m0_uint128 frid_new = M0_UINT128(0xEEEE, 0xEEEE)
 
struct m0_uint128frid_watch
 
int(* native_create )(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh) = NULL
 
struct m0_fom_type_ops fomt_ops = { .fto_create = detour_create }
 
struct m0_fid ffid = M0_FID(FID_CTN, FID_KEY)
 
struct m0_uint128 frid = M0_UINT128(0xBEC02, 0xF11ED)
 
struct m0_fid ffids [2]
 
struct m0_fdmi_flt_id_arr farr
 
static struct pdock_client_conn g_cc
 
static struct test_rpc_env g_rpc_env
 
static struct m0_rpc_packetg_rpc_packet
 
const struct m0_rpc_frm_ops frm_ops
 
struct fdmi_sd_ut_ctx g_sd_ut
 
const struct m0_filterc_ops filterc_send_notif_ops
 
struct m0_rpc_item_ops release_ri_ops
 
struct m0_fop_type m0_fop_fdmi_rec_release_rep_fopt
 
struct m0_ut_suite fdmi_pd_ut
 

Macro Definition Documentation

◆ FID_CTN

#define FID_CTN   0xDEA110C

Definition at line 182 of file pd_ut.c.

◆ FID_CTN1

#define FID_CTN1   0x1FA11ED

Definition at line 184 of file pd_ut.c.

◆ FID_KEY

#define FID_KEY   0xDA221ED

Definition at line 183 of file pd_ut.c.

◆ FID_KEY1

#define FID_KEY1   0x1A110CA

Definition at line 185 of file pd_ut.c.

◆ M0_FID

#define M0_FID (   c_,
  k_ 
)    { .f_container = c_, .f_key = k_ }

Definition at line 186 of file pd_ut.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_FDMI

Definition at line 24 of file pd_ut.c.

Function Documentation

◆ __fdmi_pd_fom_norpc()

void __fdmi_pd_fom_norpc ( bool  register_filter)

Definition at line 255 of file pd_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detour_create()

int detour_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)

Definition at line 125 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_fake_rec_reg()

void fdmi_pd_fake_rec_reg ( void  )

Definition at line 447 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_fake_rec_release()

void fdmi_pd_fake_rec_release ( void  )

Definition at line 471 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_fake_release_nomem()

void fdmi_pd_fake_release_nomem ( )

Definition at line 611 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_fake_release_rep()

void fdmi_pd_fake_release_rep ( void  )

Definition at line 537 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_fom_norpc()

void fdmi_pd_fom_norpc ( void  )

Definition at line 371 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_rec_inject_fini()

void fdmi_pd_rec_inject_fini ( void  )

Definition at line 381 of file pd_ut.c.

Here is the call graph for this function:

◆ fdmi_pd_register_filter()

void fdmi_pd_register_filter ( void  )

Definition at line 51 of file pd_ut.c.

Here is the call graph for this function:

◆ my_item_done()

static void my_item_done ( struct m0_rpc_packet p,
struct m0_rpc_item item,
int  rc 
)
static

Definition at line 422 of file pd_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ my_packet_ready()

static int my_packet_ready ( struct m0_rpc_packet p)
static

Definition at line 430 of file pd_ut.c.

Here is the call graph for this function:

◆ pd_ut_pcb_fdmi_rec()

static int pd_ut_pcb_fdmi_rec ( struct m0_uint128 rec_id,
struct m0_buf  fdmi_rec,
struct m0_fid  filter_id 
)
static

Definition at line 229 of file pd_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ut_pd_fom_fini()

static void ut_pd_fom_fini ( struct m0_fom fom)
static

Definition at line 191 of file pd_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ut_pdock_conn_pool()

struct m0_rpc_conn_pool* ut_pdock_conn_pool ( void  )

Definition at line 57 of file plugin_dock.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ farr

struct m0_fdmi_flt_id_arr farr
Initial value:
= {
.fmf_flt_id = ffids,
.fmf_count = ARRAY_SIZE(ffids)
}
struct m0_fid ffids[2]
Definition: pd_ut.c:220
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 224 of file pd_ut.c.

◆ fdmi_pd_ut

struct m0_ut_suite fdmi_pd_ut
Initial value:
= {
.ts_name = "fdmi-pd-ut",
.ts_tests = {
{ "fdmi-pd-register-filter", fdmi_pd_register_filter },
{ "fdmi-pd-fom-norpc", fdmi_pd_fom_norpc },
{ "fdmi-pd-rec-inject-fini", fdmi_pd_rec_inject_fini },
{ "fdmi-pd-fake-release-nomem", fdmi_pd_fake_release_nomem },
{ "fdmi-pd-fake-release-rep", fdmi_pd_fake_release_rep },
{ "fdmi-pd-fake-rec-release", fdmi_pd_fake_rec_release },
{ "fdmi-pd-fake-rec-reg", fdmi_pd_fake_rec_reg },
{ NULL, NULL },
},
}
#define NULL
Definition: misc.h:38
void fdmi_pd_register_filter(void)
Definition: pd_ut.c:51
void fdmi_pd_fake_rec_reg(void)
Definition: pd_ut.c:447
void fdmi_pd_fake_release_rep(void)
Definition: pd_ut.c:537
void fdmi_pd_fom_norpc(void)
Definition: pd_ut.c:371
void fdmi_pd_fake_release_nomem()
Definition: pd_ut.c:611
void fdmi_pd_rec_inject_fini(void)
Definition: pd_ut.c:381
void fdmi_pd_fake_rec_release(void)
Definition: pd_ut.c:471

Definition at line 704 of file pd_ut.c.

◆ ffid

struct m0_fid ffid = M0_FID(FID_CTN, FID_KEY)

Definition at line 188 of file pd_ut.c.

◆ ffids

struct m0_fid ffids[2]
Initial value:
= {
}
#define FID_CTN
Definition: pd_ut.c:182
#define M0_FID(c_, k_)
Definition: pd_ut.c:186
#define FID_CTN1
Definition: pd_ut.c:184
#define FID_KEY
Definition: pd_ut.c:183
#define FID_KEY1
Definition: pd_ut.c:185

Definition at line 220 of file pd_ut.c.

◆ filterc_send_notif_ops

const struct m0_filterc_ops filterc_send_notif_ops

Definition at line 79 of file sd_send_not.c.

◆ fomt_ops

struct m0_fom_type_ops fomt_ops = { .fto_create = detour_create }

Definition at line 179 of file pd_ut.c.

◆ frid

struct m0_uint128 frid = M0_UINT128(0xBEC02, 0xF11ED)

Definition at line 189 of file pd_ut.c.

◆ frid_new

struct m0_uint128 frid_new = M0_UINT128(0xEEEE, 0xEEEE)

Definition at line 115 of file pd_ut.c.

◆ frid_watch

struct m0_uint128* frid_watch

Definition at line 116 of file pd_ut.c.

◆ frm_ops

const struct m0_rpc_frm_ops frm_ops
Initial value:
= {
.fo_packet_ready = my_packet_ready,
}
static int my_packet_ready(struct m0_rpc_packet *p)
Definition: pd_ut.c:430

Definition at line 438 of file pd_ut.c.

◆ g_cc

struct pdock_client_conn g_cc
static

◆ g_rpc_env

struct test_rpc_env g_rpc_env
static

Definition at line 419 of file pd_ut.c.

◆ g_rpc_packet

struct m0_rpc_packet* g_rpc_packet
static

Definition at line 420 of file pd_ut.c.

◆ g_sd_ut

struct fdmi_sd_ut_ctx g_sd_ut

Definition at line 41 of file sd_common.c.

◆ g_sem

struct m0_semaphore g_sem
static

Definition at line 114 of file pd_ut.c.

◆ m0_fop_fdmi_rec_release_rep_fopt

struct m0_fop_type m0_fop_fdmi_rec_release_rep_fopt

Definition at line 50 of file fops.c.

◆ native_create

int(* native_create) (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh) = NULL

Definition at line 121 of file pd_ut.c.

◆ release_ri_ops

struct m0_rpc_item_ops release_ri_ops

Definition at line 321 of file plugin_dock.c.