test: Added changes in the VF APIs ULTs

- Added some checks in the ULTs
- Rectified the names of some ULTs

Related-To: NEO-11337

Signed-off-by: Pratik Bari <pratik.bari@intel.com>
This commit is contained in:
Pratik Bari
2024-11-18 15:30:20 +00:00
committed by Compute-Runtime-Automation
parent ced84fbb2e
commit 3898bc1f3f
3 changed files with 21 additions and 15 deletions

View File

@@ -1628,7 +1628,7 @@ void testSysmanVfTelemetry(ze_device_handle_t &device) {
for (uint32_t it = 0; it < count; it++) {
if (verbose) {
std::cout << "Location of the Memory = " << getMemoryModuleLocation(memUtils[it].vfMemLocation) << std::endl;
std::cout << "Memory Utilized in Bytes = " << memUtils[it].vfMemUtilized << std::endl;
std::cout << "Memory Utilized in KiloBytes = " << memUtils[it].vfMemUtilized << std::endl;
}
}
}

View File

@@ -37,12 +37,12 @@ TEST_F(ZesVfFixture, GivenValidDeviceHandleWhenRetrievingVfHandlesThenZeroCountI
WddmVfImp::numEnabledVfs = 1;
uint32_t count = 0;
ze_result_t result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(count, mockHandleCount);
uint32_t testCount = count + 1;
std::vector<zes_vf_handle_t> handles(testCount);
result = zesDeviceEnumEnabledVFExp(device->toHandle(), &testCount, handles.data());
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(testCount, count);
WddmVfImp::numEnabledVfs = 0;
}
@@ -54,19 +54,20 @@ TEST_F(ZesVfFixture, GivenValidDeviceHandleAndOneVfIsEnabledAndLocalMemoryIsUsed
uint32_t count = 0;
uint32_t mockHandleCount = 1u;
ze_result_t result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(count, mockHandleCount);
result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(count, mockHandleCount);
std::vector<zes_vf_handle_t> handles(count);
result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, handles.data());
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(handles.size(), mockHandleCount);
WddmVfImp::localMemoryUsedStatus = false;
WddmVfImp::numEnabledVfs = 0;
}
TEST_F(ZesVfFixture, GivenValidVfHandleWhenQueryingVfCapabilitiesThenThenZeroPciAddressIsReturned) {
TEST_F(ZesVfFixture, GivenValidVfHandleWhenQueryingVfCapabilitiesThenZeroPciAddressIsReturned) {
uint32_t vfId = 1;
std::unique_ptr<VfManagement> pVfManagement = std::make_unique<VfImp>(pOsSysman, vfId);
@@ -88,7 +89,7 @@ TEST_F(ZesVfFixture, GivenValidVfHandleWhenQueryingOsVfCapabilitiesThenErrorIsRe
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
TEST_F(ZesVfFixture, GivenValidVfHandleWhenWhenQueryingMemoryUtilizationThenErrorIsReturned) {
TEST_F(ZesVfFixture, GivenValidVfHandleWhenQueryingMemoryUtilizationThenErrorIsReturned) {
uint32_t vfId = 1;
uint32_t count = 0;
@@ -97,10 +98,12 @@ TEST_F(ZesVfFixture, GivenValidVfHandleWhenWhenQueryingMemoryUtilizationThenErro
pSysmanDeviceImp->pVfManagementHandleContext->handleList.push_back(std::move(pVfManagement));
ze_result_t result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, nullptr);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(count, mockHandleCount);
std::vector<zes_vf_handle_t> vfHandleList(count);
result = zesDeviceEnumEnabledVFExp(device->toHandle(), &count, vfHandleList.data());
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
for (auto vfHandle : vfHandleList) {
EXPECT_NE(vfHandle, nullptr);
@@ -109,7 +112,7 @@ TEST_F(ZesVfFixture, GivenValidVfHandleWhenWhenQueryingMemoryUtilizationThenErro
}
}
TEST_F(ZesVfFixture, GivenValidVfHandleWhenWhenQueryingEngineUtilizationThenErrorIsReturned) {
TEST_F(ZesVfFixture, GivenValidVfHandleWhenQueryingEngineUtilizationThenErrorIsReturned) {
uint32_t vfId = 1;
uint32_t count = 0;