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

Commit 8f50b20b authored by Gabriel Biren's avatar Gabriel Biren
Browse files

Add additional VTS tests for IWifiRttController.

Bug: 386810503
Test: atest VtsHalWifiRttControllerTargetTest
Change-Id: Ied2e9daedce430e6183267983c566e89585951f9
parent cdbd77a8
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ using aidl::android::hardware::wifi::IWifiRttController;
using aidl::android::hardware::wifi::RttBw;
using aidl::android::hardware::wifi::RttCapabilities;
using aidl::android::hardware::wifi::RttConfig;
using aidl::android::hardware::wifi::RttLciInformation;
using aidl::android::hardware::wifi::RttLcrInformation;
using aidl::android::hardware::wifi::RttPeerType;
using aidl::android::hardware::wifi::RttPreamble;
using aidl::android::hardware::wifi::RttResponder;
@@ -171,6 +173,7 @@ TEST_P(WifiRttControllerAidlTest, EnableResponder) {
    RttResponder responder = {};
    EXPECT_TRUE(wifi_rtt_controller_->getResponderInfo(&responder).isOk());
    EXPECT_TRUE(wifi_rtt_controller_->enableResponder(cmdId, channelInfo, 10, responder).isOk());
    EXPECT_TRUE(wifi_rtt_controller_->disableResponder(cmdId).isOk());
}

/*
@@ -361,6 +364,31 @@ TEST_P(WifiRttControllerAidlTest, RangeRequest) {
    sleep(2);
}

/*
 * GetBoundIface
 */
TEST_P(WifiRttControllerAidlTest, GetBoundIface) {
    std::shared_ptr<IWifiStaIface> boundIface;
    EXPECT_TRUE(wifi_rtt_controller_->getBoundIface(&boundIface).isOk());
    EXPECT_NE(boundIface, nullptr);
}

/*
 * Set LCI and LCR
 */
TEST_P(WifiRttControllerAidlTest, SetLciAndLcr) {
    RttCapabilities caps = getCapabilities();
    if (!caps.responderSupported) {
        GTEST_SKIP() << "Skipping because responder is not supported";
    }

    int cmdId = 55;
    RttLciInformation lci = {};
    RttLcrInformation lcr = {};
    EXPECT_TRUE(wifi_rtt_controller_->setLci(cmdId, lci).isOk());
    EXPECT_TRUE(wifi_rtt_controller_->setLcr(cmdId, lcr).isOk());
}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiRttControllerAidlTest);
INSTANTIATE_TEST_SUITE_P(WifiTest, WifiRttControllerAidlTest,
                         testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)),