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

Commit c890abd8 authored by Ahmed ElArabawy's avatar Ahmed ElArabawy Committed by Presubmit Automerger Backend
Browse files

[automerge] Wifi: Add VTS tests for Vendor HAL 1.6 2p: b2c8852c

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/16941796

Bug: 220014236
Change-Id: I8ce59f7aab7da7ea64c533f61ccead5725b534cd
parents bce4d0d2 b2c8852c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -66,7 +66,9 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam<std::string> {
        stopWifi(GetInstanceName());

        wifi_rtt_controller_ = getWifiRttController();
        ASSERT_NE(nullptr, wifi_rtt_controller_.get());
        if (wifi_rtt_controller_.get() == nullptr) {
            GTEST_SKIP() << "Skipping this test since API is deprecated.";
        }

        // Check RTT support before we run the test.
        std::pair<WifiStatus, RttCapabilities> status_and_caps;
@@ -79,7 +81,7 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam<std::string> {

    virtual void TearDown() override { stopWifi(GetInstanceName()); }

    // A simple test implementation of WifiChipEventCallback.
    // A simple test implementation of WifiRttControllerEventCallback.
    class WifiRttControllerEventCallback
        : public ::testing::VtsHalHidlTargetCallbackBase<
              WifiRttControllerHidlTest>,
@@ -122,6 +124,11 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam<std::string> {

        const auto& status_and_controller =
            HIDL_INVOKE(wifi_chip, createRttController_1_4, wifi_sta_iface);

        if (status_and_controller.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) {
            return nullptr;
        }

        EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_controller.first.code);
        EXPECT_NE(nullptr, status_and_controller.second.get());

+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ TEST_P(WifiStaIfaceHidlTest, GetLinkLayerStats_1_5) {
    // Retrieve link layer stats.
    const auto& status_and_stats =
        HIDL_INVOKE(wifi_sta_iface_, getLinkLayerStats_1_5);

    if (status_and_stats.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) {
        GTEST_SKIP() << "Skipping this test since API is deprecated.";
    }

    EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_stats.first.code);
    EXPECT_GT(status_and_stats.second.timeStampInMs, 0u);
    // Try to create 2nd iface. If yes, it should fill in the duty cycle field.
+51 −2
Original line number Diff line number Diff line
@@ -791,8 +791,57 @@ std::pair<WifiStatus, uint32_t> WifiChip::getCapabilitiesInternal() {

std::pair<WifiStatus, std::vector<V1_0::IWifiChip::ChipMode>>
WifiChip::getAvailableModesInternal() {
    // Deprecated support -- use getAvailableModes_1_6.
    return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
    // Deprecated support -- use getAvailableModes_1_6 for more granular concurrency combinations.
    std::vector<V1_0::IWifiChip::ChipMode> modes_1_0 = {};
    for (const auto& mode_1_6 : modes_) {
        std::vector<V1_0::IWifiChip::ChipIfaceCombination> combos_1_0;
        for (const auto& combo_1_6 : mode_1_6.availableCombinations) {
            std::vector<V1_0::IWifiChip::ChipIfaceCombinationLimit> limits_1_0;
            for (const auto& limit_1_6 : combo_1_6.limits) {
                std::vector<IfaceType> types_1_0;
                for (IfaceConcurrencyType type_1_6 : limit_1_6.types) {
                    switch (type_1_6) {
                        case IfaceConcurrencyType::STA:
                            types_1_0.push_back(IfaceType::STA);
                            break;
                        case IfaceConcurrencyType::AP:
                            types_1_0.push_back(IfaceType::AP);
                            break;
                        case IfaceConcurrencyType::AP_BRIDGED:
                            // Ignore AP_BRIDGED
                            break;
                        case IfaceConcurrencyType::P2P:
                            types_1_0.push_back(IfaceType::P2P);
                            break;
                        case IfaceConcurrencyType::NAN:
                            types_1_0.push_back(IfaceType::NAN);
                            break;
                    }
                }
                if (types_1_0.empty()) {
                    continue;
                }
                V1_0::IWifiChip::ChipIfaceCombinationLimit limit_1_0;
                limit_1_0.types = hidl_vec(types_1_0);
                limit_1_0.maxIfaces = limit_1_6.maxIfaces;
                limits_1_0.push_back(limit_1_0);
            }
            if (limits_1_0.empty()) {
                continue;
            }
            V1_0::IWifiChip::ChipIfaceCombination combo_1_0;
            combo_1_0.limits = hidl_vec(limits_1_0);
            combos_1_0.push_back(combo_1_0);
        }
        if (combos_1_0.empty()) {
            continue;
        }
        V1_0::IWifiChip::ChipMode mode_1_0;
        mode_1_0.id = mode_1_6.id;
        mode_1_0.availableCombinations = hidl_vec(combos_1_0);
        modes_1_0.push_back(mode_1_0);
    }
    return {createWifiStatus(WifiStatusCode::SUCCESS), modes_1_0};
}

WifiStatus WifiChip::configureChipInternal(

wifi/1.6/vts/OWNERS

0 → 100644
+2 −0
Original line number Diff line number Diff line
# Bug component: 33618
include ../../1.0/vts/OWNERS
+98 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2022 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_test {
    name: "VtsHalWifiV1_6TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    srcs: [
        "wifi_chip_hidl_test.cpp",
        "wifi_sta_iface_hidl_test.cpp",
    ],
    static_libs: [
        "VtsHalWifiV1_0TargetTestUtil",
        "android.hardware.wifi@1.0",
        "android.hardware.wifi@1.1",
        "android.hardware.wifi@1.2",
        "android.hardware.wifi@1.3",
        "android.hardware.wifi@1.4",
        "android.hardware.wifi@1.5",
        "android.hardware.wifi@1.6",
        "libwifi-system-iface",
    ],
    test_suites: [
        "general-tests",
        "vts",
    ],
}

// These tests are split out so that they can be conditioned on presence of the
// "android.hardware.wifi.rtt" feature.
cc_test {
    name: "VtsHalWifiRttV1_6TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    srcs: [
        "wifi_rtt_controller_hidl_test.cpp",
    ],
    static_libs: [
        "VtsHalWifiV1_0TargetTestUtil",
        "android.hardware.wifi@1.0",
        "android.hardware.wifi@1.1",
        "android.hardware.wifi@1.2",
        "android.hardware.wifi@1.3",
        "android.hardware.wifi@1.4",
        "android.hardware.wifi@1.5",
        "android.hardware.wifi@1.6",
        "libwifi-system-iface",
    ],
    test_suites: [
        "general-tests",
        "vts",
    ],
}

// These tests are split out so that they can be conditioned on presence of the
// "android.hardware.wifi.aware" feature.
cc_test {
    name: "VtsHalWifiNanV1_6TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    srcs: [
        "wifi_nan_iface_hidl_test.cpp",
    ],
    static_libs: [
        "VtsHalWifiV1_0TargetTestUtil",
        "android.hardware.wifi@1.0",
        "android.hardware.wifi@1.1",
        "android.hardware.wifi@1.2",
        "android.hardware.wifi@1.3",
        "android.hardware.wifi@1.4",
        "android.hardware.wifi@1.5",
        "android.hardware.wifi@1.6",
        "libwifi-system-iface",
    ],
    test_suites: [
        "general-tests",
        "vts",
    ],
}
Loading