Merge "p2p: skip MAC randomization vts test if not supported" into qt-dev

am: 33723f56b5

Change-Id: Ib6779515fb13d25b1f712f5bb32981a7980d79f4
This commit is contained in:
Jimmy Chen
2019-06-26 23:11:18 -07:00
committed by android-build-merger

View File

@@ -127,25 +127,33 @@ TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidFrequency) {
});
}
bool isMacRandomizationSupported(const SupplicantStatus& status) {
return status.code != SupplicantStatusCode::FAILURE_ARGS_INVALID;
}
/*
* Verify that setMacRandomization successes.
*/
TEST_F(SupplicantP2pIfaceHidlTest, EnableMacRandomization) {
p2p_iface_->setMacRandomization(true, [](const SupplicantStatus& status) {
if (!isMacRandomizationSupported(status)) return;
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
// enable twice
p2p_iface_->setMacRandomization(true, [](const SupplicantStatus& status) {
if (!isMacRandomizationSupported(status)) return;
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
p2p_iface_->setMacRandomization(false, [](const SupplicantStatus& status) {
if (!isMacRandomizationSupported(status)) return;
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
// disable twice
p2p_iface_->setMacRandomization(false, [](const SupplicantStatus& status) {
if (!isMacRandomizationSupported(status)) return;
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}