28 #if !defined(_GNU_SOURCE) 47 #define UT_SANDBOX "./ut-sandbox" 326 int main(
int argc,
char *argv[])
331 bool list_ut =
false;
332 bool with_tests =
false;
333 bool list_owners =
false;
334 bool yaml_output =
false;
335 bool finject_stats_before =
false;
336 bool finject_stats_after =
false;
337 bool parse_trace =
false;
341 const char *fault_point =
NULL;
342 const char *fp_file_name =
NULL;
343 const char *trace_mask =
NULL;
346 const char *tests_select =
NULL;
347 const char *tests_exclude =
NULL;
348 const char *start_suite =
NULL;
349 static char performance_counters[0x1000];
364 " where level is one of call|debug|info|" 365 "notice|warn|error|fatal",
366 LAMBDA(
void, (
const char *str) {
370 "[:integer[:integer]]",
371 LAMBDA(
void, (
const char *str) {
376 " of fault points to enable",
377 LAMBDA(
void, (
const char *str) {
381 M0_FORMATARG(
'H',
"shuffle test suites before execution. " 382 "The argument is a seed value. " 383 "0 to shuffle randomly",
"%i", &
seed),
387 "Set small transaction credits.",
391 M0_VOIDARG(
'L',
"list available test suites with" 397 M0_STRINGARG(
'm',
"trace mask, either numeric (HEX/DEC) or" 398 " comma-separated list of subsystem names" 399 " (use ! at the beginning to invert)",
400 LAMBDA(
void, (
const char *str) {
403 M0_VOIDARG(
'M',
"print available trace subsystems",
410 LAMBDA(
void, (
const char *str) {
416 " none, func, short, full",
417 LAMBDA(
void, (
const char *str) {
420 M0_FLAGARG(
's',
"report fault injection stats before UT",
421 &finject_stats_before),
422 M0_FLAGARG(
'S',
"report fault injection stats after UT",
423 &finject_stats_after),
426 LAMBDA(
void, (
const char *str) {
430 M0_FLAGARG(
'T',
"parse trace log produced earlier" 431 " (trace data is read from STDIN)",
435 LAMBDA(
void, (
const char *str) {
439 M0_FLAGARG(
'Y',
"produce lists in YAML format", &yaml_output),
448 if ((tests_select !=
NULL && tests_exclude !=
NULL) ||
449 (list_ut && (tests_select !=
NULL || tests_exclude !=
NULL ||
451 fprintf(stderr,
"Error: conflicting options: only one of the" 452 " -l -L -o -t -x option can be used at the same" 456 if (start_suite !=
NULL &&
seed != -1) {
457 fprintf(stderr,
"Error: -O and -H options are conflicting.\n");
482 warn(
"Error: invalid value for -p option");
493 if (fault_point !=
NULL) {
499 if (fp_file_name !=
NULL) {
505 if (finject_stats_before) {
515 seed = time(
NULL) ^ (getpid() << 17);
516 printf(
"Seed: %i.\n",
seed);
520 if (start_suite !=
NULL)
524 else if (list_owners)
536 if (finject_stats_after) {
543 if (
rc == 0 && !parse_trace && !list_ut && !list_owners) {
546 printf(
"%s", performance_counters);
struct m0_ut_suite fdmi_fol_fini_ut
struct m0_ut_suite failure_domains_ut
#define M0_GETOPTS(progname, argc, argv,...)
struct m0_ut_suite item_ut
struct m0_ut_suite ut_suite_layout
struct m0_ut_suite ut_suite_idx_dix
struct m0_ut_suite m0_net_tm_prov_ut
struct m0_ut_suite conf_walk_ut
struct m0_ut_suite reqh_service_ctx_ut
struct m0_ut_suite dtm_nucleus_ut
struct m0_ut_suite dtm0_log_ut
struct m0_ut_suite dtm_transmit_ut
struct m0_ut_suite addb2_hist_ut
#define M0_FLAGARG(ch, desc, ptr)
struct m0_ut_suite bulkio_client_ut
M0_INTERNAL void m0_fi_print_info(void)
struct m0_ut_suite udb_ut
struct m0_ut_suite fdmi_pd_ut
struct m0_ut_suite bulkio_server_ut
static struct m0_addb2_mach * m
struct m0_ut_suite db_cursor_ut
struct m0_ut_suite dix_client_ut
struct m0_ut_suite dtm0_ut
M0_INTERNAL void m0_trace_print_subsystems(void)
struct m0_ut_suite conf_glob_ut
struct m0_ut_suite xcode_bufvec_fop_ut
void m0_console_printf(const char *fmt,...)
struct m0_ut_suite rpclib_ut
struct m0_ut_suite conf_pvers_ut
struct m0_ut_suite parity_math_ut
struct m0_ut_suite ut_suite_ufid
struct m0_ut_suite ut_suite_idx
struct m0_ut_suite conf_load_ut
struct m0_ut_suite sns_cm_repair_ut
struct m0_ut_suite conf_ut
M0_INTERNAL void m0_instance_setup(struct m0 *instance)
struct m0_ut_suite item_source_ut
struct m0_ut_suite fdmi_filter_eval_ut
struct m0_ut_suite link_lib_ut
struct m0_ut_suite dix_cm_iter_ut
struct m0_ut_suite module_ut
struct m0_ut_suite conn_ut
struct m0_ut_suite ut_suite_sync
struct m0_module *(* mt_create)(struct m0 *instance)
struct m0_ut_suite capa_ut
struct m0_ut_suite fdmi_fol_ut
#define M0_VOIDARG(ch, desc, func)
struct m0_ut_suite fom_timedwait_ut
struct m0_ut_suite frm_ut
struct m0_ut_suite reqh_fop_allow_ut
struct m0_ut_suite cm_generic_ut
struct m0_ut_suite rm_rwlock_ut
M0_INTERNAL void m0_performance_counters(char *buf, size_t buf_len)
struct m0_ut_suite ut_suite_io_nw_xfer
struct m0_ut_suite xcode_ff2c_ut
M0_INTERNAL void m0_ut_fini(void)
#define M0_STRINGARG(ch, desc, func)
struct m0_ut_suite fdmi_sd_ut
static void tests_add(struct m0_ut_module *m)
struct m0_ut_suite ms_fom_ut
struct m0_ut_suite ut_suite_io_req_fop
struct m0_ut_suite ut_suite_io_req
struct m0_ut_suite layout_ut
struct m0_ut_suite libm0_ut
struct m0_ut_suite balloc_ut
struct m0_ut_suite buffer_pool_ut
struct m0_ut_suite m0_net_bulk_mem_ut
#define M0_FORMATARG(ch, desc, fmt, ptr)
struct m0_ut_suite addb2_base_ut
struct m0_ut_suite rpc_rcv_session_ut
M0_INTERNAL int m0_ut_init(struct m0 *instance)
M0_INTERNAL void m0_ut_start_from(const char *suite)
struct m0_ut_suite session_ut
M0_INTERNAL int m0_trace_set_print_context(const char *ctx_name)
struct m0_ut_suite isc_service_ut
struct m0_ut_suite snscm_xform_ut
struct m0_ut_suite confstr_ut
struct m0_ut_suite conf_diter_ut
struct m0_ut_suite storage_dev_ut
void m0_node_uuid_string_set(const char *uuid)
struct m0_ut_suite addb2_net_ut
struct m0_ut_suite ha_state_ut
struct m0_ut_suite addb2_consumer_ut
struct m0_ut_suite conf_validation_ut
struct m0_ut_suite rpc_conn_pool_ut
struct m0_ut_suite cob_ut
struct m0_ut_suite dtm_dtx_ut
struct m0_ut_suite spiel_ut
struct m0_ut_suite fol_ut
struct m0_ut_suite confc_ut
struct m0_ut_suite xcode_ut
struct m0_ut_suite m0_net_module_ut
struct m0_ut_suite spiel_conf_ut
struct m0_ut_suite ut_suite_obj
struct m0_ut_suite ut_suite_io
struct m0_ut_suite parity_math_ssse3_ut
struct m0_ut_suite bytecount_ut
struct m0_ut_suite m0_fom_stats_ut
const struct m0_module_type m0_ut_module_type
struct m0_ut_suite sss_ut
struct m0_ut_suite m0_net_misc_ut
struct m0_ut_suite failure_domains_tree_ut
struct m0_ut_suite console_ut
int main(int argc, char *argv[])
struct m0_ut_suite ut_suite_io_pargrp
struct m0_ut_suite rm_rcredits_ut
struct m0_ut_suite fit_ut
struct m0_ut_suite layout_access_plan_ut
struct m0_ut_suite stob_ut
struct m0_ut_suite spiel_ci_ut
M0_INTERNAL void m0_ut_list_owners(void)
struct m0_ut_suite stats_ut
M0_INTERNAL int m0_fi_enable_fault_point(const char *str)
struct m0_ut_suite snscm_storage_ut
struct m0_ut_suite m0_fop_lock_ut
struct m0_ut_suite reqh_ut
struct m0_ut_suite rpc_at_ut
void m0_console_flush(void)
struct m0_ut_suite m0d_ut
void * i_moddata[M0_MODULE_NR]
struct m0_ut_suite reqh_service_ut
struct m0_ut_suite addb2_sys_ut
M0_INTERNAL int m0_trace_set_immediate_mask(const char *mask_str)
M0_INTERNAL void m0_ut_add(struct m0_ut_module *m, struct m0_ut_suite *ts, bool enable)
struct m0_ut_suite cas_service_ut
struct m0_ut_suite fis_ut
struct m0_ut_suite m0_net_bulk_if_ut
static char * trace_print_context
static struct m0 instance
struct m0_ut_suite ut_suite_pi
struct m0_ut_suite ut_suite
struct m0_ut_suite emap_ut
struct m0_ut_suite sns_flock_ut
struct m0_ut_suite poolmach_ut
struct m0_ut_suite cas_client_ut
struct m0_ut_suite ios_bufferpool_ut
M0_INTERNAL int m0_trace_parse(FILE *trace_file, FILE *output_file, const char *m0tr_ko_path, enum m0_trace_parse_flags flags, const void *magic_symbols[], unsigned int magic_symbols_nr)
M0_INTERNAL int m0_ut_run(void)
struct m0_ut_suite rconfc_ut
struct m0_ut_suite rpc_mc_ut
M0_INTERNAL void m0_ut_list(bool with_tests, bool yaml_output)
struct m0_ut_suite cm_cp_ut
struct m0_ut_suite packet_encdec_ut
struct m0_ut_suite m0_net_test_ut
M0_INTERNAL void m0_ut_shuffle(unsigned seed)
struct m0_ut_suite mdservice_ut
M0_INTERNAL int m0_fi_enable_fault_points_from_file(const char *file_name)
struct m0_ut_suite fdmi_filterc_ut
struct m0_ut_suite ut_suite_mt_idx_dix
struct m0_ut_suite snscm_net_ut
struct m0_ut_suite isc_api_ut
struct m0_ut_suite m0_net_lnet_ut
struct m0_ut_suite dtm0_clk_src_ut
M0_INTERNAL int m0_module_init(struct m0_module *module, int level)
M0_INTERNAL int m0_trace_set_level(const char *level_str)
struct m0_ut_suite addb2_storage_ut