Motr  M0
ST framework
Collaboration diagram for ST framework:

Data Structures

struct  st_test
 
struct  st_suite
 
struct  st_cfg
 
struct  m0_instance
 
struct  st_worker_stat
 
struct  m0_st_ctx
 

Enumerations

enum  { ST_MAX_WORKER_NUM = 32 }
 
enum  { DEFAULT_PARGRP_UNIT_SIZE = 4096, DEFAULT_PARGRP_DATA_UNIT_NUM = 3, DEFAULT_PARGRP_DATA_SIZE }
 
enum  st_mode { ST_SEQ_MODE = 0, ST_RAND_MODE, ST_MIXED_MODE }
 
enum  { ST_MAX_SUITE_NUM = 4096 }
 

Functions

struct m0st_get_motr (void)
 
void st_set_instance (struct m0_client *instance)
 
struct m0_clientst_get_instance (void)
 
int st_run (const char *test_list_str)
 
void st_add_suites (void)
 
void st_list (bool)
 
int st_init (void)
 
void st_fini (void)
 
bool st_assertimpl (bool c, const char *str_c, const char *file, int lno, const char *func)
 
struct st_cfg st_get_cfg (void)
 
struct st_worker_statst_get_worker_stat (int idx)
 
int st_get_nr_workers (void)
 
void st_set_nr_workers (int nr)
 
void st_set_tests (const char *)
 
const char * st_get_tests (void)
 
void st_set_test_mode (enum st_mode)
 
enum st_mode st_get_test_mode (void)
 
int st_set_worker_tid (int idx, pid_t tid)
 
int st_get_worker_idx (pid_t tid)
 
int st_start_workers (void)
 
int st_stop_workers (void)
 
int oid_get (struct m0_uint128 *oid)
 
void oid_put (struct m0_uint128 oid)
 
uint64_t oid_get_many (struct m0_uint128 *oids, uint64_t nr_oids)
 
void oid_put_many (struct m0_uint128 *oids, uint64_t nr_oids)
 
int oid_allocator_init (void)
 
int oid_allocator_fini (void)
 
void st_container_init (struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
 
void st_obj_init (struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
 
void st_obj_fini (struct m0_obj *obj)
 
int st_entity_create (struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
 
int st_entity_delete (struct m0_entity *entity, struct m0_op **op)
 
void st_entity_fini (struct m0_entity *entity)
 
void st_op_launch (struct m0_op **op, uint32_t nr)
 
int32_t st_op_wait (struct m0_op *op, uint64_t bits, m0_time_t to)
 
void st_op_fini (struct m0_op *op)
 
void st_op_free (struct m0_op *op)
 
void st_entity_open (struct m0_entity *entity)
 
void st_idx_open (struct m0_entity *entity)
 
void st_obj_op (struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
 
void st_idx_init (struct m0_idx *idx, struct m0_realm *parent, const struct m0_uint128 *id)
 
void st_idx_fini (struct m0_idx *idx)
 
int st_idx_op (struct m0_idx *idx, enum m0_idx_opcode opcode, struct m0_bufvec *keys, struct m0_bufvec *vals, int *rcs, int flag, struct m0_op **op)
 
int st_layout_op (struct m0_obj *obj, enum m0_entity_opcode opcode, struct m0_client_layout *layout, struct m0_op **op)
 
void st_alloc_aligned (void **ptr, size_t size, size_t alignment)
 
void st_free_aligned (void *ptr, size_t size, size_t alignment)
 

Detailed Description

A simple system test framework for Client which supports: (1) Test suites can be run as a whole or partially (2) multiple test threads:

Why not use existing motr ut?(1) to simulate a "real" Client app environment in which only m0tr is available (2) to support those features above.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ST_MAX_WORKER_NUM 

Definition at line 59 of file st.h.

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_PARGRP_UNIT_SIZE 
DEFAULT_PARGRP_DATA_UNIT_NUM 
DEFAULT_PARGRP_DATA_SIZE 

Definition at line 63 of file st.h.

◆ anonymous enum

anonymous enum
Enumerator
ST_MAX_SUITE_NUM 

Definition at line 173 of file st.h.

◆ st_mode

enum st_mode

Configuration parameters for Client ST

Enumerator
ST_SEQ_MODE 
ST_RAND_MODE 
ST_MIXED_MODE 

Definition at line 98 of file st.h.

Function Documentation

◆ oid_allocator_fini()

int oid_allocator_fini ( void  )

Definition at line 454 of file oid.c.

Here is the caller graph for this function:

◆ oid_allocator_init()

int oid_allocator_init ( void  )

Definition at line 426 of file oid.c.

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

◆ oid_get()

int oid_get ( struct m0_uint128 oid)

Object ID allocation and release

Allocate a single object id

Parameters
oidreturned object ID
Returns
: == 0 ok, < 0 can't allocate free oid

Definition at line 373 of file oid.c.

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

◆ oid_get_many()

uint64_t oid_get_many ( struct m0_uint128 oids,
uint64_t  nr_oids 
)

Get a number of object IDs in one call

Parameters
oidsreturned object IDs
nr_oidsthe number of object IDs wanted : == 0, there is no free object IDs available. > 0, the allocated number of object IDs

Definition at line 397 of file oid.c.

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

◆ oid_put()

void oid_put ( struct m0_uint128  oid)

Definition at line 384 of file oid.c.

Here is the call graph for this function:

◆ oid_put_many()

void oid_put_many ( struct m0_uint128 oids,
uint64_t  nr_oids 
)

Definition at line 408 of file oid.c.

Here is the call graph for this function:

◆ st_add_suites()

void st_add_suites ( void  )

Register all test suite

Definition at line 541 of file st.c.

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

◆ st_alloc_aligned()

void st_alloc_aligned ( void **  ptr,
size_t  size,
size_t  alignment 
)

◆ st_assertimpl()

bool st_assertimpl ( bool  c,
const char *  str_c,
const char *  file,
int  lno,
const char *  func 
)

Client ST assert to allow to collect test failure statistics

Definition at line 93 of file st_assert.c.

Here is the call graph for this function:

◆ st_container_init()

void st_container_init ( struct m0_container con,
struct m0_realm parent,
const struct m0_uint128 id,
struct m0_client instance 
)

Definition at line 34 of file api.c.

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

◆ st_entity_create()

int st_entity_create ( struct m0_fid pool,
struct m0_entity entity,
struct m0_op **  op 
)

Definition at line 71 of file api.c.

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

◆ st_entity_delete()

int st_entity_delete ( struct m0_entity entity,
struct m0_op **  op 
)

Definition at line 83 of file api.c.

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

◆ st_entity_fini()

void st_entity_fini ( struct m0_entity entity)

Definition at line 94 of file api.c.

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

◆ st_entity_open()

void st_entity_open ( struct m0_entity entity)

Definition at line 153 of file api.c.

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

◆ st_fini()

void st_fini ( void  )

Definition at line 490 of file st.c.

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

◆ st_free_aligned()

void st_free_aligned ( void *  ptr,
size_t  size,
size_t  alignment 
)

◆ st_get_cfg()

struct st_cfg st_get_cfg ( void  )

Retrieve Client ST configuration information.

Definition at line 62 of file st.c.

Here is the caller graph for this function:

◆ st_get_instance()

struct m0_client* st_get_instance ( void  )

Definition at line 57 of file st.c.

Here is the caller graph for this function:

◆ st_get_motr()

struct m0* st_get_motr ( void  )

Return Motr instance.

Definition at line 47 of file st.c.

Here is the caller graph for this function:

◆ st_get_nr_workers()

int st_get_nr_workers ( void  )

Getter and setter for number of workers

Definition at line 103 of file st.c.

Here is the caller graph for this function:

◆ st_get_test_mode()

enum st_mode st_get_test_mode ( void  )

Definition at line 90 of file st.c.

Here is the caller graph for this function:

◆ st_get_tests()

const char* st_get_tests ( void  )

Definition at line 80 of file st.c.

Here is the caller graph for this function:

◆ st_get_worker_idx()

int st_get_worker_idx ( pid_t  tid)

Definition at line 119 of file st.c.

Here is the caller graph for this function:

◆ st_get_worker_stat()

struct st_worker_stat* st_get_worker_stat ( int  idx)

Definition at line 67 of file st.c.

Here is the caller graph for this function:

◆ st_idx_fini()

void st_idx_fini ( struct m0_idx idx)

Definition at line 64 of file api.c.

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

◆ st_idx_init()

void st_idx_init ( struct m0_idx idx,
struct m0_realm parent,
const struct m0_uint128 id 
)

Definition at line 56 of file api.c.

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

◆ st_idx_op()

int st_idx_op ( struct m0_idx idx,
enum m0_idx_opcode  opcode,
struct m0_bufvec keys,
struct m0_bufvec vals,
int *  rcs,
int  flag,
struct m0_op **  op 
)

Definition at line 113 of file api.c.

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

◆ st_idx_open()

void st_idx_open ( struct m0_entity entity)

Definition at line 176 of file api.c.

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

◆ st_init()

int st_init ( void  )

Initialise and finalise client ST

Definition at line 448 of file st.c.

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

◆ st_layout_op()

int st_layout_op ( struct m0_obj obj,
enum m0_entity_opcode  opcode,
struct m0_client_layout layout,
struct m0_op **  op 
)

Definition at line 183 of file api.c.

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

◆ st_list()

void st_list ( bool  )

List avaiable test suites and tests inside each suite.

Definition at line 435 of file st.c.

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

◆ st_obj_fini()

void st_obj_fini ( struct m0_obj obj)

Definition at line 50 of file api.c.

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

◆ st_obj_init()

void st_obj_init ( struct m0_obj obj,
struct m0_realm parent,
const struct m0_uint128 id,
uint64_t  layout_id 
)

Definition at line 42 of file api.c.

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

◆ st_obj_op()

void st_obj_op ( struct m0_obj obj,
enum m0_obj_opcode  opcode,
struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr,
uint64_t  mask,
uint32_t  flags,
struct m0_op **  op 
)

Definition at line 100 of file api.c.

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

◆ st_op_fini()

void st_op_fini ( struct m0_op op)

Definition at line 142 of file api.c.

Here is the call graph for this function:

◆ st_op_free()

void st_op_free ( struct m0_op op)

Definition at line 147 of file api.c.

Here is the call graph for this function:

◆ st_op_launch()

void st_op_launch ( struct m0_op **  op,
uint32_t  nr 
)

Definition at line 129 of file api.c.

Here is the call graph for this function:

◆ st_op_wait()

int32_t st_op_wait ( struct m0_op op,
uint64_t  bits,
m0_time_t  to 
)

Definition at line 136 of file api.c.

Here is the call graph for this function:

◆ st_run()

int st_run ( const char *  test_list_str)

Start runing all Client test suites.

Parameters
test_list_strBy default, all tests are included unless a string is provided to specify those selected testss.
Returns
0 for success

Definition at line 389 of file st.c.

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

◆ st_set_instance()

void st_set_instance ( struct m0_client instance)

Setter and getter for Client instance

Definition at line 52 of file st.c.

Here is the caller graph for this function:

◆ st_set_nr_workers()

void st_set_nr_workers ( int  nr)

Definition at line 95 of file st.c.

Here is the caller graph for this function:

◆ st_set_test_mode()

void st_set_test_mode ( enum  st_mode)

Getter and setter of test mode

Definition at line 85 of file st.c.

Here is the caller graph for this function:

◆ st_set_tests()

void st_set_tests ( const char *  )

Getter and setter of selected tests

Definition at line 75 of file st.c.

Here is the caller graph for this function:

◆ st_set_worker_tid()

int st_set_worker_tid ( int  idx,
pid_t  tid 
)

Set the tid of a worker thread

Definition at line 108 of file st.c.

Here is the caller graph for this function:

◆ st_start_workers()

int st_start_workers ( void  )

Start and stop worker threads for tests

Definition at line 226 of file st_worker.c.

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

◆ st_stop_workers()

int st_stop_workers ( void  )

Definition at line 258 of file st_worker.c.

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