23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT 101 M0_CONF_ROOT_NODES_FID,
103 M0_CONF_NODE_PROCESSES_FID,
105 M0_CONF_PROCESS_SERVICES_FID,
107 M0_CONF_SERVICE_SDEVS_FID,
114 M0_CONF_ROOT_SITES_FID,
116 M0_CONF_SITE_RACKS_FID,
118 M0_CONF_RACK_ENCLS_FID,
120 M0_CONF_ENCLOSURE_CTRLS_FID,
122 M0_CONF_CONTROLLER_DRIVES_FID,
134 M0_CONF_ROOT_NODES_FID,
136 M0_CONF_NODE_PROCESSES_FID,
138 M0_CONF_PROCESS_SERVICES_FID,
140 M0_CONF_SERVICE_SDEVS_FID,
197 if (stop_at !=
NULL && stop_at(entry)) {
208 if (
rc != 0 || entry ==
NULL )
212 if (stop_at !=
NULL && stop_at(entry))
232 M0_CONF_ROOT_NODES_FID,
234 M0_CONF_NODE_PROCESSES_FID);
263 M0_CONF_ROOT_NODES_FID,
265 M0_CONF_NODE_PROCESSES_FID,
346 const char *conf_str)
372 char *confstr =
NULL;
376 "bad configuration string");
386 M0_CONF_ROOT_PROFILES_FID,
393 M0_CONF_ROOT_PROFILES_FID,
406 char *confstr =
NULL;
408 uint8_t mw_core_num[] = {12, 10, 2};
418 M0_CONF_ROOT_PROFILES_FID,
434 #define NAME(ext) "ut_confd" ext 436 NAME(
""),
"-T",
"AD",
"-D",
NAME(
".db"),
437 "-S",
NAME(
".stob"),
"-A",
"linuxstob:"NAME(
"-addb_stob"),
447 .rsx_log_file_name =
NAME(
".log")
467 char *confstr =
NULL;
490 #undef M0_TRACE_SUBSYSTEM const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
static void misc_test(struct m0_confc *confc)
static void sync_open_test(struct m0_conf_obj *nodes_dir)
static void open_by_fid_test(struct m0_confc *confc)
struct m0_conf_obj * cc_root
static void nodes_open(struct m0_conf_obj **result, struct m0_confc *confc)
static void dir_test(struct m0_confc *confc)
struct m0_conf_obj rt_obj
M0_INTERNAL int m0_file_read(const char *path, char **out)
M0_INTERNAL void m0_conf_ut_waiter_fini(struct m0_conf_ut_waiter *w)
M0_BASSERT(M0_CONF_DIREND==0)
int m0_rpc_server_start(struct m0_rpc_server_ctx *sctx)
#define M0_FID_INIT(container, key)
static struct net_test_cmd_node * node
M0_INTERNAL int m0_ut_rpc_machine_start(struct m0_rpc_machine *mach, struct m0_net_xprt *xprt, const char *ep_addr)
M0_INTERNAL int m0_conf_ut_waiter_wait(struct m0_conf_ut_waiter *w, struct m0_conf_obj **result)
M0_INTERNAL int m0_confc_init(struct m0_confc *confc, struct m0_sm_group *sm_group, const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *local_conf)
M0_INTERNAL void m0_confc_fini(struct m0_confc *confc)
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 struct m0_addb2_mach * mach
M0_INTERNAL size_t m0_bitmap_set_nr(const struct m0_bitmap *map)
static uint8_t * g_num_expected
struct m0_conf_cache * co_cache
#define M0_SRC_PATH(name)
M0_INTERNAL void m0_confc_open_by_fid(struct m0_confc_ctx *ctx, const struct m0_fid *fid)
#define CLIENT_ENDPOINT_ADDR
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
#define m0_confc_open(ctx, origin,...)
M0_INTERNAL int m0_confc_root_open(struct m0_confc *confc, struct m0_conf_root **root)
static bool _proc_has_services(const struct m0_conf_obj *obj)
static void test_confc_net(void)
struct m0_confc_ctx w_ctx
static void confc_test(const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *conf_str)
#define M0_FID_TINIT(type, container, key)
static void sdev_disk_check(struct m0_confc *confc)
M0_INTERNAL void m0_confc_ctx_fini(struct m0_confc_ctx *ctx)
static void test_confc_local(void)
M0_INTERNAL int m0_conf_ut_ast_thread_fini(void)
static struct m0_confc * confc
M0_INTERNAL int m0_confc_ctx_init(struct m0_confc_ctx *ctx, struct m0_confc *confc)
struct m0_conf_cache cc_cache
const char * confd_addr[]
struct m0_net_xprt * m0_net_xprt_default_get(void)
struct m0_net_xprt ** rsx_xprts
static const struct m0_fid m0_ut_conf_fids[]
struct m0_sm_group m0_conf_ut_grp
static const struct m0_fid fids[]
#define M0_CONF_CAST(ptr, type)
#define m0_confc_open_sync(result, origin,...)
static uint8_t g_num_normal[]
M0_INTERNAL int m0_conf_ut_ast_thread_init(void)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL void m0_confc__open(struct m0_confc_ctx *ctx, struct m0_conf_obj *origin, const struct m0_fid *path)
M0_INTERNAL void m0_conf_ut_waiter_init(struct m0_conf_ut_waiter *w, struct m0_confc *confc)
#define M0_UT_CONF_PROCESS
struct m0_net_xprt ** m0_net_all_xprt_get(void)
static void _proc_cores_add(const struct m0_conf_obj *obj)
enum m0_conf_status co_status
static void m0_fi_enable_once(const char *func, const char *tag)
M0_INTERNAL struct m0_confc * m0_confc_from_obj(const struct m0_conf_obj *obj)
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
M0_INTERNAL void m0_ut_rpc_machine_stop(struct m0_rpc_machine *mach)
void m0_rpc_server_stop(struct m0_rpc_server_ctx *sctx)
#define SERVER_ENDPOINT_ADDR
static void root_open_test(struct m0_confc *confc)
const struct m0_conf_obj_type M0_CONF_DIR_TYPE
static void test_confc_invalid_input(void)
M0_INTERNAL int m0_confc_readdir_sync(struct m0_conf_obj *dir, struct m0_conf_obj **pptr)
M0_INTERNAL int m0_confc_open_by_fid_sync(struct m0_confc *confc, const struct m0_fid *fid, struct m0_conf_obj **result)
static void test_confc_multiword_core_mask(void)
static void _retrieval_initiate(struct m0_confc_ctx *ctx)
struct m0_ut_suite confc_ut
M0_INTERNAL int m0_confc_readdir(struct m0_confc_ctx *ctx, struct m0_conf_obj *dir, struct m0_conf_obj **pptr)