From 9e2fcd0e40fce27cd6e66ab2aaeb41f656cfa208 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Thu, 29 Jun 2023 07:58:23 -0500 Subject: [PATCH] Fix fan write unit test failure Even if fan speed can be read, sometimes the set is not supported. Change-Id: I8584e6fe170c34144800af78d76f04234def11c8 --- tests/amd_smi_test/functional/fan_read_write.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/amd_smi_test/functional/fan_read_write.cc b/tests/amd_smi_test/functional/fan_read_write.cc index 1ca1313f8d..e3d7c962ad 100755 --- a/tests/amd_smi_test/functional/fan_read_write.cc +++ b/tests/amd_smi_test/functional/fan_read_write.cc @@ -137,6 +137,12 @@ void TestFanReadWrite::Run(void) { } ret = amdsmi_set_gpu_fan_speed(processor_handles_[dv_ind], 0, new_speed); + + // When you can read fan speed, it is not always can set fan speed. + if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { + std::cout << "***System fan set is not supported." << std::endl; + continue; + } CHK_ERR_ASRT(ret) sleep(4);