Motr  M0
cm.c File Reference
#include "lib/trace.h"
#include <unistd.h>
#include "sns/cm/cm.h"
#include "cm/ut/common_service.h"
#include "rpc/rpclib.h"
#include "lib/fs.h"
#include "ut/misc.h"
#include "ut/ut.h"
Include dependency graph for cm.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CM
 

Functions

static void cm_ut_server_start (void)
 
static void cm_ut_server_stop (void)
 
static struct m0_cmcm_ut_sctx2cm (void)
 
static int cm_ut_init (void)
 
static int cm_ut_fini (void)
 
static void cm_setup_ut (void)
 
static void cm_init_failure_ut (void)
 
static void cm_setup_failure_ut (void)
 
static void cm_prepare_failure_ut (void)
 
static void cm_ready_failure_ut (void)
 
static void cm_start_failure_ut (void)
 
static void ag_id_assign (struct m0_cm_ag_id *id, uint64_t hi_hi, uint64_t hi_lo, uint64_t lo_hi, uint64_t lo_lo)
 
static void ag_id_test_cmp ()
 
static void ag_id_test_find ()
 
static void ag_list_test_sort ()
 
static void cm_ag_ut (void)
 

Variables

static struct m0_rpc_server_ctx cm_ut_sctx
 
static const char * SERVER_LOGFILE = "cm_ut.log"
 
char * cm_ut_server_args []
 
struct m0_ut_suite cm_generic_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CM

Definition at line 23 of file cm.c.

Function Documentation

◆ ag_id_assign()

static void ag_id_assign ( struct m0_cm_ag_id id,
uint64_t  hi_hi,
uint64_t  hi_lo,
uint64_t  lo_hi,
uint64_t  lo_lo 
)
static

Definition at line 232 of file cm.c.

Here is the caller graph for this function:

◆ ag_id_test_cmp()

static void ag_id_test_cmp ( )
static

Definition at line 241 of file cm.c.

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

◆ ag_id_test_find()

static void ag_id_test_find ( )
static

Definition at line 258 of file cm.c.

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

◆ ag_list_test_sort()

static void ag_list_test_sort ( )
static

Definition at line 278 of file cm.c.

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

◆ cm_ag_ut()

static void cm_ag_ut ( void  )
static

Definition at line 293 of file cm.c.

Here is the call graph for this function:

◆ cm_init_failure_ut()

static void cm_init_failure_ut ( void  )
static

Definition at line 144 of file cm.c.

Here is the call graph for this function:

◆ cm_prepare_failure_ut()

static void cm_prepare_failure_ut ( void  )
static

Definition at line 169 of file cm.c.

Here is the call graph for this function:

◆ cm_ready_failure_ut()

static void cm_ready_failure_ut ( void  )
static

Definition at line 186 of file cm.c.

Here is the call graph for this function:

◆ cm_setup_failure_ut()

static void cm_setup_failure_ut ( void  )
static

Definition at line 158 of file cm.c.

Here is the call graph for this function:

◆ cm_setup_ut()

static void cm_setup_ut ( void  )
static

Definition at line 108 of file cm.c.

Here is the call graph for this function:

◆ cm_start_failure_ut()

static void cm_start_failure_ut ( void  )
static

Definition at line 208 of file cm.c.

Here is the call graph for this function:

◆ cm_ut_fini()

static int cm_ut_fini ( void  )
static

Definition at line 99 of file cm.c.

Here is the call graph for this function:

◆ cm_ut_init()

static int cm_ut_init ( void  )
static

Definition at line 81 of file cm.c.

Here is the call graph for this function:

◆ cm_ut_sctx2cm()

static struct m0_cm* cm_ut_sctx2cm ( void  )
static

Definition at line 69 of file cm.c.

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

◆ cm_ut_server_start()

static void cm_ut_server_start ( void  )
static

Definition at line 49 of file cm.c.

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

◆ cm_ut_server_stop()

static void cm_ut_server_stop ( void  )
static

Definition at line 64 of file cm.c.

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

Variable Documentation

◆ cm_generic_ut

struct m0_ut_suite cm_generic_ut
Initial value:
= {
.ts_name = "cm-ut",
.ts_init = &cm_ut_init,
.ts_fini = &cm_ut_fini,
.ts_tests = {
{ "cm_setup_ut", cm_setup_ut },
{ "cm_setup_failure_ut", cm_setup_failure_ut },
{ "cm_init_failure_ut", cm_init_failure_ut },
{ "cm_prepare_failure_ut", cm_prepare_failure_ut },
{ "cm_ready_failure_ut", cm_ready_failure_ut },
{ "cm_start_failure_ut", cm_start_failure_ut },
{ "cm_ag_ut", cm_ag_ut },
{ NULL, NULL }
}
}
static int cm_ut_init(void)
Definition: cm.c:81
#define NULL
Definition: misc.h:38
static void cm_setup_failure_ut(void)
Definition: cm.c:158
static void cm_prepare_failure_ut(void)
Definition: cm.c:169
static void cm_ready_failure_ut(void)
Definition: cm.c:186
static void cm_start_failure_ut(void)
Definition: cm.c:208
static void cm_ag_ut(void)
Definition: cm.c:293
static void cm_setup_ut(void)
Definition: cm.c:108
static void cm_init_failure_ut(void)
Definition: cm.c:144
static int cm_ut_fini(void)
Definition: cm.c:99

Definition at line 336 of file cm.c.

◆ cm_ut_sctx

struct m0_rpc_server_ctx cm_ut_sctx
static

Definition at line 35 of file cm.c.

◆ cm_ut_server_args

char* cm_ut_server_args[]
Initial value:
= {
"m0d", "-T", "LINUX",
"-D", "sr_db", "-S", "sr_stob",
"-A", "linuxstob:sr_addb_stob",
"-w", "10",
"-F",
"-G", M0_NET_XPRT_PREFIX_DEFAULT":0@lo:12345:34:1",
"-e", M0_NET_XPRT_PREFIX_DEFAULT":0@lo:12345:34:1",
"-c", M0_UT_PATH("conf.xc")
}
#define M0_NET_XPRT_PREFIX_DEFAULT
Definition: net.h:98
#define M0_UT_CONF_PROCESS
Definition: misc.h:45
#define M0_UT_PATH(name)
Definition: misc.h:41

Definition at line 37 of file cm.c.

◆ SERVER_LOGFILE

const char* SERVER_LOGFILE = "cm_ut.log"
static

Definition at line 36 of file cm.c.