#include "lib/trace.h"
#include <fcntl.h>
#include <unistd.h>
#include "spiel/spiel.h"
#include "spiel/ut/spiel_ut_common.h"
#include "conf/cache.h"
#include "conf/obj_ops.h"
#include "conf/preload.h"
#include "conf/load_fop.h"
#include "conf/helpers.h"
#include "conf/ut/common.h"
#include "lib/finject.h"
#include "lib/fs.h"
#include "ut/misc.h"
#include "ut/ut.h"
Go to the source code of this file.
|
enum | {
SPIEL_UT_OBJ_PROFILE,
SPIEL_UT_OBJ_POOL,
SPIEL_UT_OBJ_PVER,
SPIEL_UT_OBJ_PVER_F,
SPIEL_UT_OBJ_NODE,
SPIEL_UT_OBJ_NODE2,
SPIEL_UT_OBJ_PROCESS,
SPIEL_UT_OBJ_PROCESS2,
SPIEL_UT_OBJ_SERVICE,
SPIEL_UT_OBJ_SERVICE2,
SPIEL_UT_OBJ_SERVICE3,
SPIEL_UT_OBJ_SERVICE4,
SPIEL_UT_OBJ_SERVICE5,
SPIEL_UT_OBJ_SERVICE6,
SPIEL_UT_OBJ_SERVICE7,
SPIEL_UT_OBJ_SERVICE8,
SPIEL_UT_OBJ_SERVICE9,
SPIEL_UT_OBJ_SERVICE10,
SPIEL_UT_OBJ_SERVICE11,
SPIEL_UT_OBJ_SERVICE12,
SPIEL_UT_OBJ_SERVICE13,
SPIEL_UT_OBJ_SDEV,
SPIEL_UT_OBJ_SDEV2,
SPIEL_UT_OBJ_SDEV3,
SPIEL_UT_OBJ_SDEV4,
SPIEL_UT_OBJ_SDEV5,
SPIEL_UT_OBJ_SDEV6,
SPIEL_UT_OBJ_SDEV7,
SPIEL_UT_OBJ_SDEV8,
SPIEL_UT_OBJ_SDEV9,
SPIEL_UT_OBJ_SDEV10,
SPIEL_UT_OBJ_SITE,
SPIEL_UT_OBJ_RACK,
SPIEL_UT_OBJ_RACK2,
SPIEL_UT_OBJ_ENCLOSURE,
SPIEL_UT_OBJ_ENCLOSURE2,
SPIEL_UT_OBJ_CONTROLLER,
SPIEL_UT_OBJ_CONTROLLER2,
SPIEL_UT_OBJ_DRIVE,
SPIEL_UT_OBJ_DRIVE2,
SPIEL_UT_OBJ_DRIVE3,
SPIEL_UT_OBJ_DRIVE4,
SPIEL_UT_OBJ_DRIVE5,
SPIEL_UT_OBJ_DRIVE6,
SPIEL_UT_OBJ_DRIVE7,
SPIEL_UT_OBJ_DRIVE8,
SPIEL_UT_OBJ_DRIVE9,
SPIEL_UT_OBJ_DRIVE10,
SPIEL_UT_OBJ_SITE_V,
SPIEL_UT_OBJ_RACK_V,
SPIEL_UT_OBJ_ENCLOSURE_V,
SPIEL_UT_OBJ_CONTROLLER_V,
SPIEL_UT_OBJ_DRIVE_V
} |
|
enum | spiel_conf_opts {
SCO_NO_CHANGE,
SCO_DROP_PROCESS = 1 << 1,
SCO_DROP_SERVICE = 1 << 2,
SCO_DROP_SDEV = 1 << 3,
SCO_ADD_PROCESS = 1 << (1 + 16),
SCO_ADD_SERVICE = 1 << (2 + 16),
SCO_ADD_SDEV = 1 << (3 + 16)
} |
|
◆ FID_MOVE
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SPIEL |
◆ SVC_EP
#define SVC_EP "0@lo:12345:41:201" |
◆ anonymous enum
Enumerator |
---|
SPIEL_UT_OBJ_PROFILE | |
SPIEL_UT_OBJ_POOL | |
SPIEL_UT_OBJ_PVER | |
SPIEL_UT_OBJ_PVER_F | |
SPIEL_UT_OBJ_NODE | |
SPIEL_UT_OBJ_NODE2 | |
SPIEL_UT_OBJ_PROCESS | |
SPIEL_UT_OBJ_PROCESS2 | |
SPIEL_UT_OBJ_SERVICE | |
SPIEL_UT_OBJ_SERVICE2 | |
SPIEL_UT_OBJ_SERVICE3 | |
SPIEL_UT_OBJ_SERVICE4 | |
SPIEL_UT_OBJ_SERVICE5 | |
SPIEL_UT_OBJ_SERVICE6 | |
SPIEL_UT_OBJ_SERVICE7 | |
SPIEL_UT_OBJ_SERVICE8 | |
SPIEL_UT_OBJ_SERVICE9 | |
SPIEL_UT_OBJ_SERVICE10 | |
SPIEL_UT_OBJ_SERVICE11 | |
SPIEL_UT_OBJ_SERVICE12 | |
SPIEL_UT_OBJ_SERVICE13 | |
SPIEL_UT_OBJ_SDEV | |
SPIEL_UT_OBJ_SDEV2 | |
SPIEL_UT_OBJ_SDEV3 | |
SPIEL_UT_OBJ_SDEV4 | |
SPIEL_UT_OBJ_SDEV5 | |
SPIEL_UT_OBJ_SDEV6 | |
SPIEL_UT_OBJ_SDEV7 | |
SPIEL_UT_OBJ_SDEV8 | |
SPIEL_UT_OBJ_SDEV9 | |
SPIEL_UT_OBJ_SDEV10 | |
SPIEL_UT_OBJ_SITE | |
SPIEL_UT_OBJ_RACK | |
SPIEL_UT_OBJ_RACK2 | |
SPIEL_UT_OBJ_ENCLOSURE | |
SPIEL_UT_OBJ_ENCLOSURE2 | |
SPIEL_UT_OBJ_CONTROLLER | |
SPIEL_UT_OBJ_CONTROLLER2 | |
SPIEL_UT_OBJ_DRIVE | |
SPIEL_UT_OBJ_DRIVE2 | |
SPIEL_UT_OBJ_DRIVE3 | |
SPIEL_UT_OBJ_DRIVE4 | |
SPIEL_UT_OBJ_DRIVE5 | |
SPIEL_UT_OBJ_DRIVE6 | |
SPIEL_UT_OBJ_DRIVE7 | |
SPIEL_UT_OBJ_DRIVE8 | |
SPIEL_UT_OBJ_DRIVE9 | |
SPIEL_UT_OBJ_DRIVE10 | |
SPIEL_UT_OBJ_SITE_V | |
SPIEL_UT_OBJ_RACK_V | |
SPIEL_UT_OBJ_ENCLOSURE_V | |
SPIEL_UT_OBJ_CONTROLLER_V | |
SPIEL_UT_OBJ_DRIVE_V | |
Definition at line 45 of file spiel_conf_ut.c.
◆ spiel_conf_opts
Enumerator |
---|
SCO_NO_CHANGE | |
SCO_DROP_PROCESS | |
SCO_DROP_SERVICE | |
SCO_DROP_SDEV | |
SCO_ADD_PROCESS | |
SCO_ADD_SERVICE | |
SCO_ADD_SDEV | |
Definition at line 225 of file spiel_conf_ut.c.
◆ spiel_conf_add_svc()
static void spiel_conf_add_svc |
( |
void |
| ) |
|
|
static |
send Load command to confd having one service added
Definition at line 1747 of file spiel_conf_ut.c.
◆ spiel_conf_big_db()
static void spiel_conf_big_db |
( |
void |
| ) |
|
|
static |
send Load command using rpc bulk mechanism
Add sufficient number of services, so resulting conf db string after encoding doesn't fit into one RPC bulk segment.
Definition at line 1763 of file spiel_conf_ut.c.
◆ spiel_conf_cancel()
static void spiel_conf_cancel |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_check_fail()
static void spiel_conf_check_fail |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_create_conf_with_opt()
static void spiel_conf_create_conf_with_opt |
( |
struct m0_spiel * |
spiel, |
|
|
struct m0_spiel_tx * |
tx, |
|
|
uint64_t |
opts |
|
) |
| |
|
static |
◆ spiel_conf_create_configuration()
static void spiel_conf_create_configuration |
( |
struct m0_spiel * |
spiel, |
|
|
struct m0_spiel_tx * |
tx |
|
) |
| |
|
static |
Creates configuration identical to conf.xc, i.e. having no changes.
Definition at line 612 of file spiel_conf_ut.c.
◆ spiel_conf_create_fail()
static void spiel_conf_create_fail |
( |
void |
| ) |
|
|
static |
alloc fail for rt_params. Note: 'm0_fi_enable_once' is not used here as some other threads were consuming this fault injection point by calling 'm0_alloc' before this thread could call that function leading to the assert condition below getting hit. With 'm0_fi_enable', those threads can still get -ENOMEM in the interim but that is acceptable for now.
Definition at line 1032 of file spiel_conf_ut.c.
◆ spiel_conf_create_invalid_configuration()
static void spiel_conf_create_invalid_configuration |
( |
struct m0_spiel * |
spiel, |
|
|
struct m0_spiel_tx * |
tx |
|
) |
| |
|
static |
◆ spiel_conf_create_ok()
static void spiel_conf_create_ok |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_create_pver_tree()
static void spiel_conf_create_pver_tree |
( |
struct m0_spiel_tx * |
tx | ) |
|
|
static |
◆ spiel_conf_delete()
static void spiel_conf_delete |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_drop_svc()
static void spiel_conf_drop_svc |
( |
void |
| ) |
|
|
static |
send Load command to confd having one service dropped
Definition at line 1731 of file spiel_conf_ut.c.
◆ spiel_conf_dump()
static void spiel_conf_dump |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_expired()
static void spiel_conf_expired |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_file()
static void spiel_conf_file |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_file_create_tree()
static void spiel_conf_file_create_tree |
( |
struct m0_spiel_tx * |
tx | ) |
|
|
static |
spiel-conf-file create tree
Create conf file equvalent to ut/conf.xc
Definition at line 1480 of file spiel_conf_ut.c.
◆ spiel_conf_flip_fail()
static void spiel_conf_flip_fail |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_load_fail()
static void spiel_conf_load_fail |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_load_send()
static void spiel_conf_load_send |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_pver_check()
static void spiel_conf_pver_check |
( |
struct m0_spiel_tx * |
tx | ) |
|
|
static |
◆ spiel_conf_pver_delete_check()
static void spiel_conf_pver_delete_check |
( |
struct m0_spiel_tx * |
tx | ) |
|
|
static |
◆ spiel_conf_tx_invalid()
static void spiel_conf_tx_invalid |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_tx_no_spiel()
static void spiel_conf_tx_no_spiel |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_ut_fini()
static void spiel_conf_ut_fini |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_ut_init()
static void spiel_conf_ut_init |
( |
void |
| ) |
|
|
static |
◆ spiel_conf_wlock_get_fail()
static void spiel_conf_wlock_get_fail |
( |
void |
| ) |
|
|
static |
◆ spiel_copy_file()
static int spiel_copy_file |
( |
const char * |
source, |
|
|
const char * |
dest |
|
) |
| |
|
static |
◆ spiel
◆ spiel_conf_ut
Initial value:= {
.ts_name = "spiel-conf-ut",
.ts_tests = {
},
}
static void spiel_conf_add_svc(void)
static void spiel_conf_load_send(void)
static void spiel_conf_wlock_get_fail(void)
static void spiel_conf_tx_no_spiel(void)
static void spiel_conf_tx_invalid(void)
static void spiel_conf_check_fail(void)
static void spiel_conf_load_fail(void)
static void spiel_conf_drop_svc(void)
static void spiel_conf_create_ok(void)
static void spiel_conf_expired(void)
static void spiel_conf_delete(void)
static void spiel_conf_file(void)
static void spiel_conf_flip_fail(void)
static void spiel_conf_cancel(void)
static void spiel_conf_big_db(void)
static void spiel_conf_dump(void)
static void spiel_conf_create_fail(void)
Definition at line 1975 of file spiel_conf_ut.c.
◆ spiel_obj_fid
◆ ut_reqh