From 337406a5c226bc36f7180dd4d4ece77fdfd590f9 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Wed, 22 Jun 2022 17:30:24 +0000 Subject: [PATCH] Add logic to the EnableMacRandomization VTS test to check whether mac randomization is enabled. Bug: 235182238 Test: atest VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: I1b16da1ee07f98caf6b90ded1bae51b6b7cc8c1a --- .../vts/functional/supplicant_p2p_iface_aidl_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp index d95bd038ce..b7984fac42 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask; using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask; using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode; using aidl::android::hardware::wifi::supplicant::P2pStatusCode; +using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode; using aidl::android::hardware::wifi::supplicant::WpsConfigMethods; using aidl::android::hardware::wifi::supplicant::WpsDevPasswordId; using aidl::android::hardware::wifi::supplicant::WpsProvisionMethod; @@ -413,7 +415,12 @@ TEST_P(SupplicantP2pIfaceAidlTest, SetListenChannel) { */ TEST_P(SupplicantP2pIfaceAidlTest, EnableMacRandomization) { // Enable twice - EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk()); + auto status = p2p_iface_->setMacRandomization(true); + if (!status.isOk() && status.getServiceSpecificError() == + static_cast(SupplicantStatusCode::FAILURE_UNSUPPORTED)) { + GTEST_SKIP() << "Mac randomization is not supported."; + } + EXPECT_TRUE(status.isOk()); EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk()); // Disable twice