Motr  M0
confc.c File Reference
#include "lib/trace.h"
#include "conf/confc.h"
#include "conf/obj_ops.h"
#include "conf/helpers.h"
#include "conf/ut/confc.h"
#include "conf/ut/common.h"
#include "conf/ut/rpc_helpers.h"
#include "rpc/rpclib.h"
#include "lib/finject.h"
#include "lib/errno.h"
#include "lib/fs.h"
#include "lib/memory.h"
#include "ut/misc.h"
#include "ut/ut.h"
Include dependency graph for confc.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT
 
#define NAME(ext)   "ut_confd" ext
 

Functions

static void root_open_test (struct m0_confc *confc)
 
static void sync_open_test (struct m0_conf_obj *nodes_dir)
 
static void sdev_disk_check (struct m0_confc *confc)
 
static void nodes_open (struct m0_conf_obj **result, struct m0_confc *confc)
 
static void _proc_cores_add (const struct m0_conf_obj *obj)
 
static bool _proc_has_services (const struct m0_conf_obj *obj)
 
 M0_BASSERT (M0_CONF_DIREND==0)
 
static int dir_entries_use (struct m0_conf_obj *dir, void(*use)(const struct m0_conf_obj *), bool(*stop_at)(const struct m0_conf_obj *))
 
static void dir_test (struct m0_confc *confc)
 
static void _retrieval_initiate (struct m0_confc_ctx *ctx)
 
static void misc_test (struct m0_confc *confc)
 
static void open_by_fid_test (struct m0_confc *confc)
 
static void confc_test (const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *conf_str)
 
static void test_confc_local (void)
 
static void test_confc_multiword_core_mask (void)
 
static void test_confc_net (void)
 
static void test_confc_invalid_input (void)
 

Variables

static uint8_t g_num
 
static uint8_t g_num_normal [] = {4, 2, 2}
 
static uint8_t * g_num_expected = g_num_normal
 
struct m0_ut_suite confc_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT

Definition at line 23 of file confc.c.

◆ NAME

#define NAME (   ext)    "ut_confd" ext

Function Documentation

◆ _proc_cores_add()

static void _proc_cores_add ( const struct m0_conf_obj obj)
static

Definition at line 167 of file confc.c.

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

◆ _proc_has_services()

static bool _proc_has_services ( const struct m0_conf_obj obj)
static

Definition at line 173 of file confc.c.

Here is the caller graph for this function:

◆ _retrieval_initiate()

static void _retrieval_initiate ( struct m0_confc_ctx ctx)
static

Definition at line 260 of file confc.c.

Here is the caller graph for this function:

◆ confc_test()

static void confc_test ( const char *  confd_addr,
struct m0_rpc_machine rpc_mach,
const char *  conf_str 
)
static

Definition at line 345 of file confc.c.

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

◆ dir_entries_use()

static int dir_entries_use ( struct m0_conf_obj dir,
void(*)(const struct m0_conf_obj *)  use,
bool(*)(const struct m0_conf_obj *)  stop_at 
)
static

Definition at line 181 of file confc.c.

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

◆ dir_test()

static void dir_test ( struct m0_confc confc)
static

Definition at line 225 of file confc.c.

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

◆ M0_BASSERT()

M0_BASSERT ( M0_CONF_DIREND  = =0)

◆ misc_test()

static void misc_test ( struct m0_confc confc)
static

Definition at line 269 of file confc.c.

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

◆ nodes_open()

static void nodes_open ( struct m0_conf_obj **  result,
struct m0_confc confc 
)
static

Definition at line 151 of file confc.c.

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

◆ open_by_fid_test()

static void open_by_fid_test ( struct m0_confc confc)
static

Definition at line 320 of file confc.c.

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

◆ root_open_test()

static void root_open_test ( struct m0_confc confc)
static

Definition at line 44 of file confc.c.

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

◆ sdev_disk_check()

static void sdev_disk_check ( struct m0_confc confc)
static

Definition at line 92 of file confc.c.

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

◆ sync_open_test()

static void sync_open_test ( struct m0_conf_obj nodes_dir)
static

Definition at line 58 of file confc.c.

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

◆ test_confc_invalid_input()

static void test_confc_invalid_input ( void  )
static

Definition at line 464 of file confc.c.

Here is the call graph for this function:

◆ test_confc_local()

static void test_confc_local ( void  )
static

Definition at line 368 of file confc.c.

Here is the call graph for this function:

◆ test_confc_multiword_core_mask()

static void test_confc_multiword_core_mask ( void  )
static

Definition at line 402 of file confc.c.

Here is the call graph for this function:

◆ test_confc_net()

static void test_confc_net ( void  )
static

Definition at line 430 of file confc.c.

Here is the call graph for this function:

Variable Documentation

◆ confc_ut

struct m0_ut_suite confc_ut
Initial value:
= {
.ts_name = "confc-ut",
.ts_tests = {
{ "local", test_confc_local },
{ "mw-core-mask", test_confc_multiword_core_mask },
{ "net", test_confc_net },
{ "bad-input", test_confc_invalid_input },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_confc_net(void)
Definition: confc.c:430
static void test_confc_local(void)
Definition: confc.c:368
M0_INTERNAL int m0_conf_ut_ast_thread_fini(void)
Definition: common.c:96
M0_INTERNAL int m0_conf_ut_ast_thread_init(void)
Definition: common.c:86
static void test_confc_invalid_input(void)
Definition: confc.c:464
static void test_confc_multiword_core_mask(void)
Definition: confc.c:402

Definition at line 477 of file confc.c.

◆ g_num

uint8_t g_num
static

Definition at line 40 of file confc.c.

◆ g_num_expected

uint8_t* g_num_expected = g_num_normal
static

Definition at line 42 of file confc.c.

◆ g_num_normal

uint8_t g_num_normal[] = {4, 2, 2}
static

Definition at line 41 of file confc.c.