Motr  M0
service_ctx.c File Reference
#include <unistd.h>
#include "reqh/reqh_service_internal.h"
#include "rpc/rpclib.h"
#include "ut/misc.h"
#include "ut/ut.h"
Include dependency graph for service_ctx.c:

Go to the source code of this file.

Macros

#define SERVER_LOG_FILE_NAME   "reqh_service_ctx.log"
 

Functions

static void reqh_service_ctx_ut_test_helper (char *ut_argv[], int ut_argc, void(*ut_body)(void))
 
static int reqh_service_ctx_ut__remote_rmach_init (void)
 
static void reqh_service_ctx_ut__remote_rmach_fini (void)
 
static struct m0_reqh_service_ctxreqh_service_ctx_ut__find (struct m0_fid *fid, int stype, const char *ep)
 
static struct m0_reqh_service_ctxreqh_service_ctx_ut__find_remote (void)
 
static bool ut_dead_end__cb (struct m0_clink *clink)
 
static void ut_dead_end__connecting (void)
 
static void test_dead_end_connect (void)
 
static void reqh_service_ctx_ut__wait_online (struct m0_reqh_service_ctx *ctx)
 
static void reqh_service_ctx_ut__wait_all_online (void)
 
static void ut_dead_end__disconnecting (void)
 
static void ut_dead_end__disconnected (void)
 
static void test_dead_end_disconnect (void)
 

Variables

static struct m0_rpc_server_ctx ut_sctx
 
static struct m0_net_domain ut_client_net_dom
 
static struct m0_rpc_machine ut_rmach
 
static const char * ut_ep_addr_remote = "0@lo:12345:34:999"
 
static struct m0_net_buffer_pool ut_buf_pool
 
static struct m0_reqh ut_reqh
 
static char * sargs []
 
static struct m0_semaphore g_sem
 
struct m0_ut_suite reqh_service_ctx_ut
 

Macro Definition Documentation

◆ SERVER_LOG_FILE_NAME

#define SERVER_LOG_FILE_NAME   "reqh_service_ctx.log"

Definition at line 28 of file service_ctx.c.

Function Documentation

◆ reqh_service_ctx_ut__find()

static struct m0_reqh_service_ctx* reqh_service_ctx_ut__find ( struct m0_fid fid,
int  stype,
const char *  ep 
)
static

Definition at line 96 of file service_ctx.c.

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

◆ reqh_service_ctx_ut__find_remote()

static struct m0_reqh_service_ctx* reqh_service_ctx_ut__find_remote ( void  )
static

Definition at line 108 of file service_ctx.c.

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

◆ reqh_service_ctx_ut__remote_rmach_fini()

static void reqh_service_ctx_ut__remote_rmach_fini ( void  )
static

Definition at line 87 of file service_ctx.c.

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

◆ reqh_service_ctx_ut__remote_rmach_init()

static int reqh_service_ctx_ut__remote_rmach_init ( void  )
static

Definition at line 62 of file service_ctx.c.

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

◆ reqh_service_ctx_ut__wait_all_online()

static void reqh_service_ctx_ut__wait_all_online ( void  )
static

Definition at line 170 of file service_ctx.c.

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

◆ reqh_service_ctx_ut__wait_online()

static void reqh_service_ctx_ut__wait_online ( struct m0_reqh_service_ctx ctx)
static

Definition at line 153 of file service_ctx.c.

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

◆ reqh_service_ctx_ut_test_helper()

static void reqh_service_ctx_ut_test_helper ( char *  ut_argv[],
int  ut_argc,
void(*)(void)  ut_body 
)
static

Definition at line 46 of file service_ctx.c.

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

◆ test_dead_end_connect()

static void test_dead_end_connect ( void  )
static

Definition at line 147 of file service_ctx.c.

Here is the call graph for this function:

◆ test_dead_end_disconnect()

static void test_dead_end_disconnect ( void  )
static

Definition at line 222 of file service_ctx.c.

Here is the call graph for this function:

◆ ut_dead_end__cb()

static bool ut_dead_end__cb ( struct m0_clink clink)
static

Definition at line 117 of file service_ctx.c.

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

◆ ut_dead_end__connecting()

static void ut_dead_end__connecting ( void  )
static

Definition at line 123 of file service_ctx.c.

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

◆ ut_dead_end__disconnected()

static void ut_dead_end__disconnected ( void  )
static

Definition at line 197 of file service_ctx.c.

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

◆ ut_dead_end__disconnecting()

static void ut_dead_end__disconnecting ( void  )
static

Definition at line 184 of file service_ctx.c.

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

Variable Documentation

◆ g_sem

struct m0_semaphore g_sem
static

Definition at line 115 of file service_ctx.c.

◆ reqh_service_ctx_ut

struct m0_ut_suite reqh_service_ctx_ut
Initial value:
= {
.ts_name = "reqh-service-ctx-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "dead-end-conn", test_dead_end_connect },
{ "dead-end-disc", test_dead_end_disconnect },
{ NULL, NULL },
},
.ts_owners = "Igor Vartanov",
}
#define NULL
Definition: misc.h:38
static void test_dead_end_connect(void)
Definition: service_ctx.c:147
static void test_dead_end_disconnect(void)
Definition: service_ctx.c:222

Definition at line 233 of file service_ctx.c.

◆ sargs

char* sargs[]
static
Initial value:
= {"m0d", "-T", "linux",
"-D", "cs_sdb", "-S", "cs_stob",
"-A", "linuxstob:cs_addb_stob",
"-e", M0_NET_XPRT_PREFIX_DEFAULT":0@lo:12345:34:1",
"-H", "0@lo:12345:34:1",
"-w", "10",
"-c", M0_SRC_PATH("reqh/ut/service_ctx.xc")
}
#define M0_SRC_PATH(name)
Definition: misc.h:48
#define M0_NET_XPRT_PREFIX_DEFAULT
Definition: net.h:98

Definition at line 37 of file service_ctx.c.

◆ ut_buf_pool

struct m0_net_buffer_pool ut_buf_pool
static

Definition at line 34 of file service_ctx.c.

◆ ut_client_net_dom

struct m0_net_domain ut_client_net_dom
static

Definition at line 31 of file service_ctx.c.

◆ ut_ep_addr_remote

const char* ut_ep_addr_remote = "0@lo:12345:34:999"
static

Definition at line 33 of file service_ctx.c.

◆ ut_reqh

struct m0_reqh ut_reqh
static

Definition at line 35 of file service_ctx.c.

◆ ut_rmach

struct m0_rpc_machine ut_rmach
static

Definition at line 32 of file service_ctx.c.

◆ ut_sctx

struct m0_rpc_server_ctx ut_sctx
static

Definition at line 30 of file service_ctx.c.