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

Commit be28ce40 authored by Gabriel Biren's avatar Gabriel Biren
Browse files

Exit the Keep Alive and DTIM multiplier

tests early if not supported.

Bug: 388915979
Test: Rerun the failing targets in Treehugger
Change-Id: I2e032d05df6af365157b090879d786049e62df5c
parent e4da126f
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -543,7 +543,12 @@ TEST_P(WifiStaIfaceAidlTest, GetName) {
 */
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());
}
@@ -568,12 +573,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);