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

Commit 9a9e5aa1 authored by Yi Shiou (Les) Lee's avatar Yi Shiou (Les) Lee Committed by Android (Google) Code Review
Browse files

Merge "wifi vts: Add hostapd vts test case for mlo SAP" into main

parents 84b14e04 5c1fe49c
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ class HostapdAidl : public testing::TestWithParam<std::string> {
        isBridgedSupport = testing::checkSubstringInCommandOutput(
                "/system/bin/cmd wifi get-softap-supported-features",
                "wifi_softap_bridged_ap_supported");
        isMloSupport = testing::checkSubstringInCommandOutput(
                "/system/bin/cmd wifi get-softap-supported-features", "wifi_softap_mlo_supported");
    }

    virtual void TearDown() override {
@@ -100,6 +102,7 @@ class HostapdAidl : public testing::TestWithParam<std::string> {
    bool isAcsSupport;
    bool isWpa3SaeSupport;
    bool isBridgedSupport;
    bool isMloSupport;
    int interface_version_;

    IfaceParams getIfaceParamsWithoutAcs(std::string iface_name) {
@@ -476,6 +479,34 @@ TEST_P(HostapdAidl, AddAccessPointWithDualBandConfig) {
    EXPECT_TRUE(status.isOk());
}

/**
 * AddAccessPointWithMloConfig and remove link should pass
 */
TEST_P(HostapdAidl, AddAccessPointWithMloConfigAndRemoveInstance) {
    if (interface_version_ < 3) {
        GTEST_SKIP() << "MLO SAP is available in IfaceParams as of Hostapd V3";
    }
    if (!isMloSupport) GTEST_SKIP() << "Missing MLO AP support";
    std::shared_ptr<IWifiApIface> wifi_ap_iface = HostapdAidlTestUtils::setupMloApIface();
    EXPECT_TRUE(wifi_ap_iface.get() != nullptr);
    std::string br_name;
    std::vector<std::string> instances;
    bool uses_mlo;
    EXPECT_TRUE(wifi_ap_iface->getName(&br_name).isOk());
    EXPECT_TRUE(wifi_ap_iface->getBridgedInstances(&instances).isOk());
    EXPECT_TRUE(wifi_ap_iface->usesMlo(&uses_mlo).isOk());
    EXPECT_TRUE(uses_mlo);

    IfaceParams iface_params = getIfaceParamsWithBridgedModeACS(br_name);
    iface_params.instanceIdentities = {instances[0], instances[1]};
    iface_params.usesMlo = uses_mlo;
    iface_params.hwModeParams.enable80211AX = true;
    iface_params.hwModeParams.enable80211BE = true;

    EXPECT_TRUE(hostapd->addAccessPoint(iface_params, getSaeNwParams()).isOk());
    EXPECT_TRUE(hostapd->removeLinkFromMultipleLinkBridgedApIface(br_name, instances[0]).isOk());
}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HostapdAidl);
INSTANTIATE_TEST_SUITE_P(
    Hostapd, HostapdAidl,
+7 −0
Original line number Diff line number Diff line
@@ -77,4 +77,11 @@ std::string setupApIfaceAndGetName(bool isBridged) {
    return ap_iface_name;
}

std::shared_ptr<IWifiApIface> setupMloApIface() {
    std::shared_ptr<IWifiChip> wifi_chip = getWifiChip(kWifiInstanceName);
    EXPECT_TRUE(wifi_chip.get() != nullptr);
    return getWifiApOrBridgedApIface(
            wifi_chip, generateApIfaceParams(IfaceConcurrencyType::AP_BRIDGED, true, 0));
}

}  // namespace HostapdAidlTestUtils