Skip to content

Commit

Permalink
Update teeio-validator to use debuglib libarary
Browse files Browse the repository at this point in the history
Signed-off-by: Min Xu <min.m.xu@intel.com>
  • Loading branch information
mxu9 committed May 16, 2024
1 parent 0de3d68 commit 42705f0
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
7 changes: 2 additions & 5 deletions teeio-validator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ if(ENABLE_CODEQL STREQUAL "ON")
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/library/spdm_transport_mctp_lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/library/spdm_transport_pcidoe_lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/memlib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/debuglib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/debuglib_null)
ADD_SUBDIRECTORY(${TEEIO_VALIDATOR_DIR}/library/debuglib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/rnglib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/platform_lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/platform_lib_null)
Expand Down Expand Up @@ -236,8 +235,7 @@ ADD_COMPILE_OPTIONS(-DLIBSPDM_CONFIG="${PROJECT_SOURCE_DIR}/include/spdm_lib_con
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/library/spdm_secured_message_lib out/spdm_secured_message_lib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/library/spdm_transport_pcidoe_lib out/spdm_transport_pcidoe_lib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/memlib out/spdm_memlib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/debuglib out/spdm_debuglib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/debuglib_null out/spdm_debuglib_null.lib)
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/library/debuglib out/debuglib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/rnglib out/spdm_rnglib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/platform_lib out/spdm_platform_lib.lib)
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/platform_lib_null out/spdm_platform_lib_null.lib)
Expand All @@ -246,7 +244,6 @@ ADD_COMPILE_OPTIONS(-DLIBSPDM_CONFIG="${PROJECT_SOURCE_DIR}/include/spdm_lib_con
ADD_SUBDIRECTORY(${LIBSPDM_DIR}/os_stub/spdm_device_secret_lib_null out/spdm_device_secret_lib_null.lib)

ADD_SUBDIRECTORY(${LIBSPDM_DIR}/unit_test/test_size/intrinsiclib out/intrinsiclib.lib)
#ADD_SUBDIRECTORY(${LIBSPDM_DIR}/unit_test/test_size/malloclib_null out/malloclib_null.lib)

ADD_SUBDIRECTORY(${SPDM_EMU_DIR}/library/pci_doe_requester_lib out/pci_doe_requester_lib.lib)
ADD_SUBDIRECTORY(${SPDM_EMU_DIR}/library/pci_ide_km_requester_lib out/pci_ide_km_requester_lib.lib)
Expand Down
1 change: 1 addition & 0 deletions teeio-validator/include/ide_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ typedef struct
{
bool pci_log;
uint32_t debug_level;
bool libspdm_log;
bool wo_tdisp;
} IDE_TEST_MAIN_CONFIG;

Expand Down
3 changes: 0 additions & 3 deletions teeio-validator/teeio_validator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ SET(src_teeio_validator
cmdline.c
ide_test_ini.c
ide_test.c
teeio_debug.c
## test cases
test_case/test_case_query.c
test_case/test_case_ksetgo_1.c
Expand Down Expand Up @@ -83,7 +82,6 @@ SET(teeio_validator_LIBRARY
SET(src_lside
tools/lside.c
tools/ide_common.c
teeio_debug.c
utils.c
pci_ide.c
scan_pci.c
Expand All @@ -96,7 +94,6 @@ SET(lside_LIBRARY
SET(src_setide
tools/setide.c
tools/ide_common.c
teeio_debug.c
utils.c
pci_ide.c
scan_pci.c
Expand Down
1 change: 1 addition & 0 deletions teeio-validator/teeio_validator/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern int g_top_id;
extern int g_config_id;
extern char g_test_case[MAX_CASE_NAME_LENGTH];
extern TEEIO_DEBUG_LEVEL g_debug_level;
extern bool g_libspdm_log;
extern uint8_t g_scan_bus;
extern bool g_run_test_suite;

Expand Down
6 changes: 6 additions & 0 deletions teeio-validator/teeio_validator/ide_test_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -2321,6 +2321,12 @@ void ParseMainSection(void *context, IDE_TEST_CONFIG *test_config)
test_config->main_config.pci_log = data32 == 1;
}

sprintf(entry_name, "libspdm_log");
if (GetDecimalUint32FromDataFile(context, (uint8_t *)section_name, (uint8_t *)entry_name, &data32))
{
test_config->main_config.libspdm_log = data32 == 1;
}

sprintf(entry_name, "debug_level");
if (!GetStringFromDataFile(context, (uint8_t *)section_name, (uint8_t *)entry_name, &entry_value))
{
Expand Down
2 changes: 2 additions & 0 deletions teeio-validator/teeio_validator/teeio_validator.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ char g_test_case[MAX_CASE_NAME_LENGTH] = {0};
bool g_run_test_suite = true;

TEEIO_DEBUG_LEVEL g_debug_level = TEEIO_DEBUG_WARN;
bool g_libspdm_log = false;
uint8_t g_scan_bus = INVALID_SCAN_BUS;

FILE* m_logfile = NULL;
Expand Down Expand Up @@ -80,6 +81,7 @@ int main(int argc, char *argv[])
goto MainDone;
}
g_pci_log = ide_test_config.main_config.pci_log;
g_libspdm_log = ide_test_config.main_config.libspdm_log;

if(debug_level == TEEIO_DEBUG_NUM) {
g_debug_level = ide_test_config.main_config.debug_level;
Expand Down
1 change: 1 addition & 0 deletions teeio-validator/teeio_validator/tools/lside.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ DEVCIES_CONTEXT devices_context = {0};
bool g_run_test_suite = false;

TEEIO_DEBUG_LEVEL g_debug_level = TEEIO_DEBUG_WARN;
bool g_libspdm_log = false;
uint8_t g_scan_bus = INVALID_SCAN_BUS;
FILE* m_logfile = NULL;

Expand Down
1 change: 1 addition & 0 deletions teeio-validator/teeio_validator/tools/setide.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ IDE_OPERATION g_ide_operation = IDE_OPERATION_CLEAR;
bool g_run_test_suite = false;

TEEIO_DEBUG_LEVEL g_debug_level = TEEIO_DEBUG_WARN;
bool g_libspdm_log = false;
uint8_t g_scan_bus = INVALID_SCAN_BUS;
FILE* m_logfile = NULL;

Expand Down

0 comments on commit 42705f0

Please sign in to comment.