Merge "wifi: Fix for VtsHalWifiSupplicantV1_2TargetTest failures"

This commit is contained in:
Sunil Ravi 2020-02-04 03:58:11 +00:00 committed by Android (Google) Code Review
commit f9295112be
2 changed files with 55 additions and 15 deletions

View file

@ -111,9 +111,14 @@ class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
// If DPP is not supported, we just pass the test. // If DPP is not supported, we just pass the test.
sta_iface_->getKeyMgmtCapabilities( sta_iface_->getKeyMgmtCapabilities(
[&](const SupplicantStatus& status, uint32_t keyMgmtMaskInternal) { [&](const SupplicantStatus& status, uint32_t keyMgmtMaskInternal) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // 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; keyMgmtMask = keyMgmtMaskInternal;
}
}); });
if (!(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::DPP)) { if (!(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::DPP)) {
@ -268,8 +273,12 @@ TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_2) {
* GetKeyMgmtCapabilities * GetKeyMgmtCapabilities
*/ */
TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) { TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
sta_iface_->getKeyMgmtCapabilities( sta_iface_->getKeyMgmtCapabilities([&](const SupplicantStatus& status,
[&](const SupplicantStatus& status, uint32_t keyMgmtMask) { 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); EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
// Even though capabilities vary, these two are always set in HAL // Even though capabilities vary, these two are always set in HAL
@ -277,7 +286,8 @@ TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
EXPECT_TRUE(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::NONE); EXPECT_TRUE(keyMgmtMask & ISupplicantStaNetwork::KeyMgmtMask::NONE);
EXPECT_TRUE(keyMgmtMask & EXPECT_TRUE(keyMgmtMask &
ISupplicantStaNetwork::KeyMgmtMask::IEEE8021X); ISupplicantStaNetwork::KeyMgmtMask::IEEE8021X);
}); }
});
} }
/* /*
@ -455,4 +465,4 @@ INSTANTIATE_TEST_CASE_P(
testing::ValuesIn(android::hardware::getAllHalInstanceNames( testing::ValuesIn(android::hardware::getAllHalInstanceNames(
android::hardware::wifi::supplicant::V1_2::ISupplicant:: android::hardware::wifi::supplicant::V1_2::ISupplicant::
descriptor))), descriptor))),
android::hardware::PrintInstanceTupleNameToString<>); android::hardware::PrintInstanceTupleNameToString<>);

View file

@ -112,13 +112,23 @@ TEST_P(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_2) {
uint32_t keyMgmt = (uint32_t)ISupplicantStaNetwork::KeyMgmtMask::SAE; uint32_t keyMgmt = (uint32_t)ISupplicantStaNetwork::KeyMgmtMask::SAE;
sta_network_->setKeyMgmt_1_2(keyMgmt, [](const SupplicantStatus &status) { sta_network_->setKeyMgmt_1_2(keyMgmt, [](const SupplicantStatus &status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // 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( sta_network_->getKeyMgmt_1_2(
[&keyMgmt](const SupplicantStatus &status, uint32_t keyMgmtOut) { [&keyMgmt](const SupplicantStatus &status, uint32_t keyMgmtOut) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // Since this API is overridden by an upgraded API in newer HAL
EXPECT_EQ(keyMgmtOut, keyMgmt); // 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( sta_network_->setGroupCipher_1_2(
groupCipher, [](const SupplicantStatus &status) { groupCipher, [](const SupplicantStatus &status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // 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( sta_network_->getGroupCipher_1_2(
[&groupCipher](const SupplicantStatus &status, [&groupCipher](const SupplicantStatus &status,
uint32_t groupCipherOut) { uint32_t groupCipherOut) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // Since this API is overridden by an upgraded API in newer HAL
EXPECT_EQ(groupCipherOut, groupCipher); // 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( sta_network_->setPairwiseCipher_1_2(
pairwiseCipher, [](const SupplicantStatus &status) { pairwiseCipher, [](const SupplicantStatus &status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // 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( sta_network_->getPairwiseCipher_1_2(
[&pairwiseCipher](const SupplicantStatus &status, [&pairwiseCipher](const SupplicantStatus &status,
uint32_t pairwiseCipherOut) { uint32_t pairwiseCipherOut) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); // Since this API is overridden by an upgraded API in newer HAL
EXPECT_EQ(pairwiseCipherOut, pairwiseCipher); // 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);
}
}); });
} }