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

Commit 370ef59f authored by Sunil Ravi's avatar Sunil Ravi
Browse files

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
parent eefb6da4
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1054,6 +1054,24 @@ TEST_P(SupplicantP2pIfaceAidlTest, RemoveClient) {
    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(
+15 −0
Original line number Diff line number Diff line
@@ -946,6 +946,21 @@ TEST_P(SupplicantStaIfaceAidlTest, CancelUsdSession) {
    }
}

/*
 * 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(
+16 −0
Original line number Diff line number Diff line
@@ -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;
@@ -836,6 +837,21 @@ TEST_P(SupplicantStaNetworkAidlTest, DisableEht) {
    EXPECT_TRUE(sta_network_->disableEht().isOk());
}

/*
 * 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
 */