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

Commit 9294fc27 authored by Gabriel Biren's avatar Gabriel Biren
Browse files

Create P2P VTS test networks using

addGroup() instead of addNetwork().

Verified by running the affected VTS tests
on an AOSP and an internal main build.
Previously, the test was passing on AOSP,
but failing on the internal builds.

Bug: 387556129
Bug: 387925327
Test: atest VtsHalWifiSupplicantP2pIfaceTargetTest
Test: atest VtsHalWifiSupplicantP2pNetworkTargetTest
Change-Id: Id135270f3c353c2cdcfb47905fb6748b0b22b70f
parent cdbd77a8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -986,15 +986,16 @@ TEST_P(SupplicantP2pIfaceAidlTest, ReinvokePersistentGroup) {
 * Test the P2P network management functions.
 */
TEST_P(SupplicantP2pIfaceAidlTest, ManageNetworks) {
    std::shared_ptr<ISupplicantP2pNetwork> network;
    EXPECT_TRUE(p2p_iface_->addNetwork(&network).isOk());
    ASSERT_NE(network, nullptr);
    // Create a persistent group to bring up a network
    EXPECT_TRUE(p2p_iface_->addGroup(true /* persistent */, -1).isOk());
    sleep(2);

    std::vector<int32_t> networkList;
    EXPECT_TRUE(p2p_iface_->listNetworks(&networkList).isOk());
    ASSERT_FALSE(networkList.empty());

    int networkId = networkList[0];
    std::shared_ptr<ISupplicantP2pNetwork> network;
    EXPECT_TRUE(p2p_iface_->getNetwork(networkId, &network).isOk());
    ASSERT_NE(network, nullptr);
    EXPECT_TRUE(p2p_iface_->removeNetwork(networkId).isOk());
+17 −3
Original line number Diff line number Diff line
@@ -48,11 +48,22 @@ class SupplicantP2pNetworkAidlTest : public testing::TestWithParam<std::string>

        EXPECT_TRUE(supplicant_->getP2pInterface(getP2pIfaceName(), &p2p_iface_).isOk());
        ASSERT_NE(p2p_iface_, nullptr);
        EXPECT_TRUE(p2p_iface_->addNetwork(&p2p_network_).isOk());

        // Create a persistent group to bring up a network
        EXPECT_TRUE(p2p_iface_->addGroup(true /* persistent */, -1).isOk());
        sleep(2);

        std::vector<int32_t> networkList;
        EXPECT_TRUE(p2p_iface_->listNetworks(&networkList).isOk());
        ASSERT_FALSE(networkList.empty());

        network_id_ = networkList[0];
        EXPECT_TRUE(p2p_iface_->getNetwork(network_id_, &p2p_network_).isOk());
        ASSERT_NE(p2p_network_, nullptr);
    }

    void TearDown() override {
        EXPECT_TRUE(p2p_iface_->removeNetwork(network_id_).isOk());
        stopSupplicantService();
        startWifiFramework();
    }
@@ -61,6 +72,7 @@ class SupplicantP2pNetworkAidlTest : public testing::TestWithParam<std::string>
    std::shared_ptr<ISupplicant> supplicant_;
    std::shared_ptr<ISupplicantP2pIface> p2p_iface_;
    std::shared_ptr<ISupplicantP2pNetwork> p2p_network_;
    int network_id_;
};

/*
@@ -130,7 +142,8 @@ TEST_P(SupplicantP2pNetworkAidlTest, IsCurrent) {
TEST_P(SupplicantP2pNetworkAidlTest, IsGroupOwner) {
    bool isGroupOwner;
    EXPECT_TRUE(p2p_network_->isGroupOwner(&isGroupOwner).isOk());
    EXPECT_FALSE(isGroupOwner);
    // Configured network is a group owner
    EXPECT_TRUE(isGroupOwner);
}

/*
@@ -139,7 +152,8 @@ TEST_P(SupplicantP2pNetworkAidlTest, IsGroupOwner) {
TEST_P(SupplicantP2pNetworkAidlTest, IsPersistent) {
    bool isPersistent;
    EXPECT_TRUE(p2p_network_->isPersistent(&isPersistent).isOk());
    EXPECT_FALSE(isPersistent);
    // Configured network is persistent
    EXPECT_TRUE(isPersistent);
}

/*