Skip to content

Commit

Permalink
test: Add Sysman VF Management CTS (#87)
Browse files Browse the repository at this point in the history
* 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
vishnu-khanth authored Dec 19, 2024
1 parent cf41a5a commit 87f846d
Show file tree
Hide file tree
Showing 10 changed files with 628 additions and 3 deletions.
3 changes: 2 additions & 1 deletion conformance_tests/sysman/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2022 Intel Corporation
# Copyright (C) 2020-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
Expand All @@ -25,3 +25,4 @@ add_subdirectory(test_sysman_overclocking)
add_subdirectory(test_sysman_scheduler)
add_subdirectory(test_sysman_performance)
add_subdirectory(test_sysman_ecc)
add_subdirectory(test_sysman_vf_management)
25 changes: 25 additions & 0 deletions conformance_tests/sysman/test_sysman_vf_management/CMakeLists.txt
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
)
3 changes: 3 additions & 0 deletions conformance_tests/sysman/test_sysman_vf_management/README.md
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 conformance_tests/sysman/test_sysman_vf_management/src/main.cpp
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
}
Loading

0 comments on commit 87f846d

Please sign in to comment.