test_state
struct dentry *test_state;
test_state = debugfs_create_file(status, 0644, root,
if (IS_ERR(test_state)) {
return PTR_ERR(test_state);
static struct test_state ts;
int test_state;
test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK;
if (test_state) {
dport->test_state = BFA_DPORT_ST_DISABLED;
dport->test_state = BFA_DPORT_ST_NOTSTART;
dport->test_state = BFA_DPORT_ST_NO_SFP;
dport->test_state = BFA_DPORT_ST_INP;
dport->test_state = BFA_DPORT_ST_DISABLED;
dport->test_state = BFA_DPORT_ST_COMP;
dport->test_state = BFA_DPORT_ST_INP;
dport->test_state = BFA_DPORT_ST_NO_SFP;
dport->test_state = BFA_DPORT_ST_DISABLED;
dport->test_state = BFA_DPORT_ST_NO_SFP;
dport->test_state = BFA_DPORT_ST_INP;
if (dport->test_state == BFA_DPORT_ST_NO_SFP)
if (dport->test_state == BFA_DPORT_ST_INP)
WARN_ON(dport->test_state != BFA_DPORT_ST_COMP);
if (dport->test_state == BFA_DPORT_ST_NO_SFP)
u8 test_state; /* enum dport_test_state */
suspend_state_t test_state;
for (test_state = PM_SUSPEND_MIN; test_state < PM_SUSPEND_MAX; test_state++) {
const char *state_label = pm_states[test_state];
if (test_state == PM_SUSPEND_MAX) {
test_wakealarm(rtc, test_state);
struct driver_test_state *test_state = kunit_kzalloc(test, sizeof(*test_state), GFP_KERNEL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, test_state);
test->priv = test_state;
KUNIT_ASSERT_TRUE(test, test_state->driver_device_probed);
devm_add_action(test_device, test_dev_action, &test_state->action_was_run);
KUNIT_EXPECT_EQ(test, test_state->action_was_run, 0);
KUNIT_ASSERT_TRUE(test, test_state->driver_device_removed);
test_state->driver_device_probed = false;
KUNIT_ASSERT_TRUE(test, test_state->driver_device_probed);
struct test_state *state = env.test_state;
static void clear_test_state(struct test_state *state)
stdout = env.test_state->stdout_saved;
stderr = env.test_state->stdout_saved;
if (env.test_state->stdout_saved)
fclose(env.test_state->stdout_saved);
env.test_state->stdout_saved = NULL;
env.test_state->error_cnt++;
dump_test_log(env.test, env.test_state, true, false, NULL);
struct test_state *state = &test_states[test_num];
env.test_state = state;
static int dispatch_thread_send_subtests(int sock_fd, struct test_state *state)
struct test_state *state;
struct test_state *state = &test_states[i];
struct test_state *state = &test_states[i];
static int worker_main_send_subtests(int sock, struct test_state *state)
struct test_state *state = &test_states[test_to_run];
struct test_state *test_state = &test_states[i];
for (j = 0; j < test_state->subtest_num; j++)
free_subtest_state(&test_state->subtest_states[j]);
free(test_state->subtest_states);
free(test_state->log_buf);
test_state->subtest_states = NULL;
test_state->log_buf = NULL;
static void print_test_result(const struct prog_test_def *test, const struct test_state *test_state)
int skipped_cnt = test_state->skip_cnt;
int subtests_cnt = test_state->subtest_num;
if (test_state->error_cnt)
const struct test_state *test_state,
bool test_failed = test_state->error_cnt > 0;
bool force_log = test_state->force_log;
if (test_state->log_cnt && print_test)
print_test_log(test_state->log_buf, test_state->log_cnt);
jsonw_write_log_message(w, test_state->log_buf, test_state->log_cnt);
for (i = 0; i < test_state->subtest_num; i++) {
subtest_state = &test_state->subtest_states[i];
print_test_result(test, test_state);
struct test_state *test_state = env.test_state;
test_state->error_cnt++;
test_state->sub_succ_cnt++;
test_state->skip_cnt++;
print_subtest_name(test->test_num, test_state->subtest_num,
struct test_state *state = env.test_state;
env.test_state->force_log = true;
env.test_state->skip_cnt++;
env.test_state->error_cnt++;
env.test_state->stdout_saved = stdout;
static struct test_state test_states[ARRAY_SIZE(prog_test_defs)];
struct test_state *test_state; /* current running test state */
enum test_state curr_state;
static void wait_for_state(struct vma_modifier_info *mod_info, enum test_state state)
static void signal_state(struct vma_modifier_info *mod_info, enum test_state state)
if (test_state == 0) {
test_state = 1;
} else if (test_state == 1) {
test_state = 2;
} else if (test_state == 2) {
test_state = 3;
static volatile int test_state = 0;
void test_exit(struct test_state *state)
struct test_state state;
int test_init(struct test_state *state)
void test_exit(struct test_state *state)
struct test_state state;
int test_init(struct test_state *state)