From 558eb0b696ba31f64ea341560cff9c9ac7700a86 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Tue, 16 Jan 2024 14:40:53 +0800 Subject: [PATCH] Update VTS test for the function `hardwareReset()` The function `hardwareReset()` throws `EX_UNSUPPORTED_OPERATION` if the Thread radio chip doesn't support the hardware reset. Current VTS test assumes that the Thread radio chip must support the hardware reset. This CL updates the VTS test to verify the return value `EX_UNSUPPORTED_OPERATION`. bug: b/320393041 Test: run vts -m VtsHalThreadNetworkTargetTest Change-Id: I7b0b2a4e850a1eda085a6d6c24cdd8aae6498aac --- threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp index 5925b54b6a..2f71b2f1e2 100644 --- a/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp +++ b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp @@ -87,11 +87,16 @@ TEST_P(ThreadNetworkAidl, Close) { } TEST_P(ThreadNetworkAidl, Reset) { + ndk::ScopedAStatus status; std::shared_ptr callback = ndk::SharedRefBase::make([](auto /* data */) {}); EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->hardwareReset().isOk()); + status = thread_chip->hardwareReset(); + EXPECT_TRUE(status.isOk() || (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION)); + if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) { + GTEST_SKIP() << "Hardware reset is not supported"; + } } TEST_P(ThreadNetworkAidl, SendSpinelFrame) {