Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce8a46fa authored by Gabriel Biren's avatar Gabriel Biren Committed by Android (Google) Code Review
Browse files

Merge "Exit the Keep Alive and DTIM multiplier tests early if not supported." into main

parents 872a373a be28ce40
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -535,7 +535,12 @@ TEST_P(WifiStaIfaceAidlTest, TwtSessionResume) {
 */
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 @@ TEST_P(WifiStaIfaceAidlTest, StartAndStopSendingKeepAlivePackets) {
    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);