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

Commit 9392b58d authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

Wifi: Fix VtsHalWifiHostapdV1_1TargetTest

This commit fixes VTS tests in VtsHalWifiHostapdV1_1TargetTest
resulting from upgrading APIs and stopping support for old APIs.

Bug: 147006566
Test: atest VtsHalWifiHostapdV1_1TargetTest
Change-Id: Ia6be7f08c160ef3b0478630193fb6a39e774e109
parent 436ab20e
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -233,8 +233,12 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) {
TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) {
    auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_1,
                              getIfaceParamsWithoutAcs(), getPskNwParams());
    // FAILURE_UNKNOWN is used by higher versions to indicate this API is no
    // longer supported (replaced by an upgraded API)
    if (status.code != HostapdStatusCode::FAILURE_UNKNOWN) {
        EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
    }
}

/**
 * Adds an access point with Open network config & ACS disabled.
@@ -243,8 +247,12 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) {
TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) {
    auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_1,
                              getIfaceParamsWithoutAcs(), getOpenNwParams());
    // FAILURE_UNKNOWN is used by higher versions to indicate this API is no
    // longer supported (replaced by an upgraded API)
    if (status.code != HostapdStatusCode::FAILURE_UNKNOWN) {
        EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
    }
}

/**
 * Adds & then removes an access point with PSK network config & ACS enabled.
@@ -269,11 +277,15 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) {
TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) {
    auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_1,
                              getIfaceParamsWithoutAcs(), getPskNwParams());
    // FAILURE_UNKNOWN is used by higher versions to indicate this API is no
    // longer supported (replaced by an upgraded API)
    if (status.code != HostapdStatusCode::FAILURE_UNKNOWN) {
        EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
        status =
            HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName());
        EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
    }
}

/**
 * Adds an access point with invalid channel.