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

Commit f9295112 authored by Sunil Ravi's avatar Sunil Ravi Committed by Android (Google) Code Review
Browse files

Merge "wifi: Fix for VtsHalWifiSupplicantV1_2TargetTest failures"

parents 6607c571 8d343bdf
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -111,9 +111,14 @@ class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
        // If DPP is not supported, we just pass the test.
        sta_iface_->getKeyMgmtCapabilities(
            [&](const SupplicantStatus& status, uint32_t keyMgmtMaskInternal) {
                // Since getKeyMgmtCapabilities() is overridden by an
                // upgraded API in newer HAL versions, allow for
                // FAILURE_UNKNOWN and return DPP is not supported.
                if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                    EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);

                    keyMgmtMask = keyMgmtMaskInternal;
                }
            });

        if (!(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::DPP)) {
@@ -268,8 +273,12 @@ TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_2) {
 * GetKeyMgmtCapabilities
 */
TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
    sta_iface_->getKeyMgmtCapabilities(
        [&](const SupplicantStatus& status, uint32_t keyMgmtMask) {
    sta_iface_->getKeyMgmtCapabilities([&](const SupplicantStatus& status,
                                           uint32_t keyMgmtMask) {
        // Since this API is overridden by an upgraded API in newer HAL
        // versions, allow FAILURE_UNKNOWN to indicate that the test is no
        // longer supported on newer HAL.
        if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
            EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);

            // Even though capabilities vary, these two are always set in HAL
@@ -277,6 +286,7 @@ TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
            EXPECT_TRUE(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::NONE);
            EXPECT_TRUE(keyMgmtMask &
                        ISupplicantStaNetwork::KeyMgmtMask::IEEE8021X);
        }
    });
}

+39 −9
Original line number Diff line number Diff line
@@ -112,13 +112,23 @@ TEST_P(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_2) {
    uint32_t keyMgmt = (uint32_t)ISupplicantStaNetwork::KeyMgmtMask::SAE;

    sta_network_->setKeyMgmt_1_2(keyMgmt, [](const SupplicantStatus &status) {
        // Since this API is overridden by an upgraded API in newer HAL
        // versions, allow FAILURE_UNKNOWN to indicate that the test is no
        // longer supported on newer HALs.
        if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
            EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
        }
    });

    sta_network_->getKeyMgmt_1_2(
        [&keyMgmt](const SupplicantStatus &status, uint32_t keyMgmtOut) {
            // Since this API is overridden by an upgraded API in newer HAL
            // versions, allow FAILURE_UNKNOWN to indicate that the test is no
            // longer supported on newer HALs.
            if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
                EXPECT_EQ(keyMgmtOut, keyMgmt);
            }
        });
}

@@ -131,14 +141,24 @@ TEST_P(SupplicantStaNetworkHidlTest, SetGetGroupCipher_1_2) {

    sta_network_->setGroupCipher_1_2(
        groupCipher, [](const SupplicantStatus &status) {
            // Since this API is overridden by an upgraded API in newer HAL
            // versions, allow FAILURE_UNKNOWN to indicate that the test is no
            // longer supported on newer HALs.
            if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
            }
        });

    sta_network_->getGroupCipher_1_2(
        [&groupCipher](const SupplicantStatus &status,
                       uint32_t groupCipherOut) {
            // Since this API is overridden by an upgraded API in newer HAL
            // versions, allow FAILURE_UNKNOWN to indicate that the test is no
            // longer supported on newer HALs.
            if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
                EXPECT_EQ(groupCipherOut, groupCipher);
            }
        });
}

@@ -151,14 +171,24 @@ TEST_P(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher_1_2) {

    sta_network_->setPairwiseCipher_1_2(
        pairwiseCipher, [](const SupplicantStatus &status) {
            // Since this API is overridden by an upgraded API in newer HAL
            // versions, allow FAILURE_UNKNOWN to indicate that the test is no
            // longer supported on newer HALs.
            if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
            }
        });

    sta_network_->getPairwiseCipher_1_2(
        [&pairwiseCipher](const SupplicantStatus &status,
                          uint32_t pairwiseCipherOut) {
            // Since this API is overridden by an upgraded API in newer HAL
            // versions, allow FAILURE_UNKNOWN to indicate that the test is no
            // longer supported on newer HALs.
            if (status.code != SupplicantStatusCode::FAILURE_UNKNOWN) {
                EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
                EXPECT_EQ(pairwiseCipherOut, pairwiseCipher);
            }
        });
}