wifi: Added missing VTS tests
Added VTS tests for,
1. ISupplicantP2pIface#configureEapolIpAddressAllocationParams
2. ISupplicantStaIface#generateSelfDppConfiguration
3. ISupplicantStaNetwork#setDppKeys
Bug: 385776321
Test: atest VtsHalWifiSupplicantStaNetworkTargetTest
Test: atest VtsHalWifiSupplicantStaIfaceTargetTest
Test: atest VtsHalWifiSupplicantP2pIfaceTargetTest
Change-Id: I56c9df9f797e987001fdc1635cfcbbbc879434e2
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 acfce17..778e20a 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
@@ -1054,6 +1054,24 @@
EXPECT_FALSE(p2p_iface_->removeClient(invalidMacAddr, false).isOk());
}
+/*
+ * ConfigureEapolIpAddressAllocationParams
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ConfigureEapolIpAddressAllocationParams) {
+ if (interface_version_ < 2) {
+ GTEST_SKIP() << "ConfigureEapolIpAddressAllocationParams is available as of Supplicant V2";
+ }
+ // The IP addresses are IPV4 addresses and higher-order address bytes are in the
+ // lower-order int bytes (e.g. 192.168.1.1 is represented as 0x0101A8C0)
+ EXPECT_TRUE(p2p_iface_
+ ->configureEapolIpAddressAllocationParams(0x0101A8C0, 0x00FFFFFF,
+ 0x0501A8C0, 0x0801A8C0)
+ .isOk());
+
+ // Clear the configuration.
+ EXPECT_TRUE(p2p_iface_->configureEapolIpAddressAllocationParams(0, 0, 0, 0).isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantP2pIfaceAidlTest);
INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantP2pIfaceAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index 9d851ba..3a01c5b 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -946,6 +946,21 @@
}
}
+/*
+ * GenerateSelfDppConfiguration
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GenerateSelfDppConfiguration) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+ const std::string ssid = "my_test_ssid";
+ const std::vector<uint8_t> eckey_in = {0x2, 0x3, 0x4};
+
+ // Expect to fail as this test requires a DPP AKM supported AP and a valid private EC
+ // key generated by wpa_supplicant.
+ EXPECT_FALSE(sta_iface_->generateSelfDppConfiguration(ssid, eckey_in).isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaIfaceAidlTest);
INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaIfaceAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
index 9bdd2f5..5e6069f 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
@@ -32,6 +32,7 @@
using aidl::android::hardware::wifi::supplicant::AuthAlgMask;
using aidl::android::hardware::wifi::supplicant::BnSupplicantStaNetworkCallback;
using aidl::android::hardware::wifi::supplicant::DebugLevel;
+using aidl::android::hardware::wifi::supplicant::DppConnectionKeys;
using aidl::android::hardware::wifi::supplicant::EapMethod;
using aidl::android::hardware::wifi::supplicant::EapPhase2Method;
using aidl::android::hardware::wifi::supplicant::GroupCipherMask;
@@ -837,6 +838,21 @@
}
/*
+ * SetDppKeys
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetDppKeys) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+
+ DppConnectionKeys in_keys;
+ in_keys.connector = std::vector<uint8_t>({0x11, 0x22, 0x33, 0x44});
+ in_keys.cSign = std::vector<uint8_t>({0x55, 0x66, 0x77, 0x88});
+ in_keys.netAccessKey = std::vector<uint8_t>({0xaa, 0xbb, 0xcc, 0xdd});
+ EXPECT_TRUE(sta_network_->setDppKeys(in_keys).isOk());
+}
+
+/*
* SetVendorData
*/
TEST_P(SupplicantStaNetworkAidlTest, SetVendorData) {