Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion teeio-validator/include/ide_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#define MAX_KSETGO_CASE_ID 4
#define MAX_KSETSTOP_CASE_ID 4
#define MAX_SPDMSESSION_CASE_ID 2
#define MAX_FULL_CASE_ID 2
#define MAX_FULL_CASE_ID 3

#define INVALID_PORT_ID 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ void pcie_ide_test_full_1_run(void *test_context);
void pcie_ide_test_full_1_teardown(void *test_context);

// Full case - KeyRefresh
bool pcie_ide_test_full_keyrefresh_setup(void *test_context);
void pcie_ide_test_full_keyrefresh_run(void *test_context);
void pcie_ide_test_full_keyrefresh_teardown(void *test_context);
bool pcie_ide_test_full_keyrefresh_ks0_setup(void *test_context);
void pcie_ide_test_full_keyrefresh_ks0_run(void *test_context);
void pcie_ide_test_full_keyrefresh_ks0_teardown(void *test_context);

// Full case - KeyRefreshKs1
bool pcie_ide_test_full_keyrefresh_ks1_setup(void *test_context);
void pcie_ide_test_full_keyrefresh_ks1_run(void *test_context);
void pcie_ide_test_full_keyrefresh_ks1_teardown(void *test_context);

//
// PCIE_IDE Test Config
Expand Down
5 changes: 3 additions & 2 deletions teeio-validator/library/pcie_ide_test_lib/pcie_ide_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ ide_test_group_funcs_t m_group_funcs[IDE_TEST_TOPOLOGY_TYPE_NUM] = {
}
};

#define TEST_CLASS_CASE_NAMES "IdeStream,KeyRefresh"
#define TEST_CLASS_CASE_NAMES "IdeStream,KeyRefresh,KeyRefreshKs1"

ide_test_case_name_t m_test_case_names[] = {
{"Query", "1,2", IDE_COMMON_TEST_CASE_QUERY},
Expand Down Expand Up @@ -182,7 +182,8 @@ ide_test_case_funcs_t m_pcie_ide_spdm_session_cases[MAX_SPDMSESSION_CASE_ID] = {

ide_test_case_funcs_t m_pcie_ide_test_full_cases[MAX_FULL_CASE_ID] = {
{ pcie_ide_test_full_1_setup, pcie_ide_test_full_1_run, pcie_ide_test_full_1_teardown, false }, // IdeStream
{ pcie_ide_test_full_keyrefresh_setup, pcie_ide_test_full_keyrefresh_run, pcie_ide_test_full_keyrefresh_teardown, false } // KeyRefresh
{ pcie_ide_test_full_keyrefresh_ks0_setup, pcie_ide_test_full_keyrefresh_ks0_run, pcie_ide_test_full_keyrefresh_ks0_teardown, false }, // KeyRefresh
{ pcie_ide_test_full_keyrefresh_ks1_setup, pcie_ide_test_full_keyrefresh_ks1_run, pcie_ide_test_full_keyrefresh_ks1_teardown, false } // KeyRefreshKs1
};

TEEIO_TEST_CASES m_pcie_ide_test_case_funcs[IDE_COMMON_TEST_CASE_NUM] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern int g_test_rounds;

static uint8_t mKeySet = 0;

bool pcie_ide_test_full_keyrefresh_setup(void *test_context)
bool pcie_ide_keyrefresh_setup_common(void *test_context)
{
ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context;
TEEIO_ASSERT(case_context);
Expand All @@ -40,8 +40,6 @@ bool pcie_ide_test_full_keyrefresh_setup(void *test_context)
ide_common_test_port_context_t* upper_port = &group_context->common.upper_port;
ide_common_test_port_context_t* lower_port = &group_context->common.lower_port;

mKeySet = PCI_IDE_KM_KEY_SET_K0;

// An ide_stream is first setup so that key_refresh can be tested in run.
return setup_ide_stream(group_context->spdm_doe.doe_context, group_context->spdm_doe.spdm_context, &group_context->spdm_doe.session_id,
upper_port->mapped_kcbar_addr, group_context->stream_id, mKeySet,
Expand All @@ -50,7 +48,7 @@ bool pcie_ide_test_full_keyrefresh_setup(void *test_context)
group_context->common.top->type, upper_port, lower_port, false);
}

void pcie_ide_test_full_keyrefresh_run(void *test_context)
void pcie_ide_keyrefresh_run_common(void *test_context)
{
ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context;
TEEIO_ASSERT(case_context);
Expand Down Expand Up @@ -143,7 +141,34 @@ void pcie_ide_test_full_keyrefresh_run(void *test_context)
res ? "PCIE-IDE KeyRefresh succeeded." : "PCIE-IDE KeyRefresh failed.");
}

void pcie_ide_test_full_keyrefresh_teardown(void *test_context)
bool pcie_ide_test_full_keyrefresh_ks0_setup(void *test_context)
{
mKeySet = PCI_IDE_KM_KEY_SET_K0;
return pcie_ide_keyrefresh_setup_common(test_context);
}

void pcie_ide_test_full_keyrefresh_ks0_run(void *test_context)
{
pcie_ide_keyrefresh_run_common(test_context);
}

void pcie_ide_test_full_keyrefresh_ks0_teardown(void *test_context)
{
pcie_ide_teardown_common(test_context, mKeySet);
}

bool pcie_ide_test_full_keyrefresh_ks1_setup(void *test_context)
{
mKeySet = PCI_IDE_KM_KEY_SET_K1;
return pcie_ide_keyrefresh_setup_common(test_context);
}

void pcie_ide_test_full_keyrefresh_ks1_run(void *test_context)
{
pcie_ide_keyrefresh_run_common(test_context);
}

void pcie_ide_test_full_keyrefresh_ks1_teardown(void *test_context)
{
pcie_ide_teardown_common(test_context, mKeySet);
}
Loading