-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add Sysman VF Management CTS (#87)
* test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> * test: Add Sysman VF Management CTS Related-To: VLCLJ-2312 Signed-off-by: Vishnu Khanth <[email protected]> --------- Signed-off-by: Vishnu Khanth <[email protected]>
- Loading branch information
1 parent
cf41a5a
commit 87f846d
Showing
10 changed files
with
628 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
conformance_tests/sysman/test_sysman_vf_management/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: MIT | ||
|
||
add_lzt_test( | ||
NAME test_sysman_vf_management | ||
GROUP "/conformance_tests/tools/sysman" | ||
SOURCES | ||
src/test_sysman_vf_management.cpp | ||
src/main.cpp | ||
LINK_LIBRARIES | ||
level_zero_tests::logging | ||
level_zero_tests::utils | ||
) | ||
|
||
add_lzt_test( | ||
NAME test_sysman_vf_management_zesinit | ||
GROUP "/conformance_tests/tools/sysman" | ||
SOURCES | ||
src/test_sysman_vf_management.cpp | ||
src/main.cpp | ||
LINK_LIBRARIES | ||
level_zero_tests::logging | ||
level_zero_tests::utils | ||
DEFINES USE_ZESINIT | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# testSysmanVfManagement | ||
|
||
This test suite is for validating Sysman VF management APIs provided in L0 sysman Spec. |
53 changes: 53 additions & 0 deletions
53
conformance_tests/sysman/test_sysman_vf_management/src/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* | ||
* Copyright (C) 2024 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "gmock/gmock.h" | ||
#include "logging/logging.hpp" | ||
#include "utils/utils.hpp" | ||
#include <stdlib.h> | ||
|
||
int main(int argc, char **argv) { | ||
::testing::InitGoogleMock(&argc, argv); | ||
std::vector<std::string> command_line(argv + 1, argv + argc); | ||
level_zero_tests::init_logging(command_line); | ||
#ifdef USE_ZESINIT | ||
ze_result_t result = zesInit(0); | ||
if (result) { | ||
throw std::runtime_error("zesInit failed: " + | ||
level_zero_tests::to_string(result)); | ||
} | ||
LOG_TRACE << "Sysman initialized"; | ||
return RUN_ALL_TESTS(); | ||
#else // USE_ZESINIT | ||
static char sys_env[] = "ZES_ENABLE_SYSMAN=1"; | ||
putenv(sys_env); | ||
static char device_hierachy_env[] = "ZE_FLAT_DEVICE_HIERARCHY=COMPOSITE"; | ||
putenv(device_hierachy_env); | ||
|
||
auto is_sysman_enabled = getenv("ZES_ENABLE_SYSMAN"); | ||
if (is_sysman_enabled == nullptr) { | ||
LOG_INFO << "Sysman is not Enabled"; | ||
exit(0); | ||
} else { | ||
auto is_sysman_enabled_int = atoi(is_sysman_enabled); | ||
if (is_sysman_enabled_int == 1) { | ||
ze_result_t result = zeInit(0); | ||
if (result) { | ||
throw std::runtime_error("zeInit failed: " + | ||
level_zero_tests::to_string(result)); | ||
} | ||
LOG_TRACE << "Driver initialized"; | ||
|
||
return RUN_ALL_TESTS(); | ||
} else { | ||
LOG_INFO << "Sysman is not Enabled"; | ||
exit(0); | ||
} | ||
} | ||
#endif // USE_ZESINIT | ||
} |
Oops, something went wrong.