Merge "Exit the Keep Alive and DTIM multiplier tests early if not supported." into main
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index 4f25171..29c47f5 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -535,7 +535,12 @@
*/
TEST_P(WifiStaIfaceAidlTest, SetDtimMultiplier) {
// Multiplied value
- EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(2).isOk());
+ auto status = wifi_sta_iface_->setDtimMultiplier(2);
+ if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
+ GTEST_SKIP() << "SetDtimMultiplier is not supported";
+ }
+ EXPECT_TRUE(status.isOk());
+
// Driver default value
EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(0).isOk());
}
@@ -560,12 +565,17 @@
uint16_t etherType = 0x0800; // IPv4
uint32_t periodInMs = 1000; // 1 sec
- // Expected to fail with test values
- EXPECT_FALSE(wifi_sta_iface_
- ->startSendingKeepAlivePackets(kTestCmdId, ipPacketData, etherType,
- kTestMacAddr1, kTestMacAddr2, periodInMs)
- .isOk());
- EXPECT_FALSE(wifi_sta_iface_->stopSendingKeepAlivePackets(kTestCmdId).isOk());
+ auto status = wifi_sta_iface_->startSendingKeepAlivePackets(
+ kTestCmdId, ipPacketData, etherType, kTestMacAddr1, kTestMacAddr2, periodInMs);
+ if (!status.isOk()) {
+ // The device may not support this operation or the specific test values
+ GTEST_SKIP() << "StartAndStopSendingKeepAlivePackets is not supported"
+ << ", status=" << status.getServiceSpecificError();
+ }
+ EXPECT_TRUE(status.isOk());
+
+ // If start was successful, then stop should also work
+ EXPECT_TRUE(wifi_sta_iface_->stopSendingKeepAlivePackets(kTestCmdId).isOk());
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiStaIfaceAidlTest);