From d2497bb2d3b46ceadb17a5374aca11ec9b1515c9 Mon Sep 17 00:00:00 2001 From: Charis Poag Date: Thu, 2 Mar 2023 13:24:38 -0600 Subject: [PATCH] [SWDEV-335697 + SWDEV-342812] Fix NPS & Compute tests Updates: * Fixed rsmi_dev_compute_partition_get & rsmi_dev_nps_mode_get to properly check for invalid arguments * Updated compute partition & NPS mode tests - Now properly confirms the invalid argument is seen - Spacing for multiple devices is added to better see distinction between separate device's tests (for verbose output) - Changed expect to assert calls, so errors are observed faster for test failures - Fixed multiple device testing where a variable should have been unset, but having multiple devices caused it to set - Updated multiple device testing to iterate accross all devices (previously returned, instead of continuing checking support after RSMI_STATUS_NOT_SUPPORTED detected) - Fixed a few spelling errors & verbose output Change-Id: Ieba9e5b46763c6cd880fbf27fcdf58be8ecbc683 Signed-off-by: Charis Poag [ROCm/amdsmi commit: c252ecccd1a0bc76a23675e9330c86ce24ff90f6] --- .../amdsmi/rocm_smi/docs/ROCm_SMI_Manual.pdf | Bin 527272 -> 527272 bytes projects/amdsmi/src/rocm_smi.cc | 8 +-- .../functional/computepartition_read_write.cc | 51 +++++++----------- .../functional/npsmode_read_write.cc | 46 ++++++++-------- 4 files changed, 49 insertions(+), 56 deletions(-) diff --git a/projects/amdsmi/rocm_smi/docs/ROCm_SMI_Manual.pdf b/projects/amdsmi/rocm_smi/docs/ROCm_SMI_Manual.pdf index 3a3ec7aa6f9428734840c6ed2459fafa04032f93..e3d19724581c408237ba25668d396c2279d7db5d 100644 GIT binary patch delta 128 zcmZ26U17y^g@zW!7N!>F7M2#)7Pc+ymrrsU8yFcH8XKD$Prq}LT?)b7{{JNV5;kW? v10xq_Qxgkw3rA;XHzOBgClgawXE$?G3u9MT0~a$p1sg(2wm-YTe#i;{v>YWN delta 128 zcmZ26U17y^g@zW!7N!>F7M2#)7Pc+ymrrsU85tOw8W(partition); + new_nps_mode = static_cast(partition); IF_VERB(STANDARD) { std::cout << std::endl; std::cout << "\t**" @@ -265,8 +270,8 @@ void TestNPSModeReadWrite::Run(void) { std::cout << "\t**" << "Current nps mode: " << current_nps_mode << std::endl; } - EXPECT_EQ(RSMI_STATUS_SUCCESS, ret); - EXPECT_STREQ(npsModeString(new_nps_mode).c_str(), current_nps_mode); + ASSERT_EQ(RSMI_STATUS_SUCCESS, ret); + ASSERT_STREQ(npsModeString(new_nps_mode).c_str(), current_nps_mode); } /* TEST RETURN TO BOOT NPS MODE SETTING */ @@ -331,8 +336,7 @@ void TestNPSModeReadWrite::Run(void) { << "\t**" << "Current nps mode: " << current_nps_mode << std::endl; } - EXPECT_EQ(RSMI_STATUS_SUCCESS, ret); - EXPECT_STREQ(npsModeString(new_nps_mode).c_str(), current_nps_mode); - + ASSERT_EQ(RSMI_STATUS_SUCCESS, ret); + ASSERT_STREQ(npsModeString(new_nps_mode).c_str(), current_nps_mode); } }