From 48be64ff34f4142265178f597297b96e65bfa2bb Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 23 Jan 2024 18:09:42 +0100 Subject: [PATCH] wifi: Stop beacon generation in EMLSR test when no longer needed Avoids that beacon frames interfere with data frames making the test fail. --- src/wifi/test/wifi-emlsr-test.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/wifi/test/wifi-emlsr-test.cc b/src/wifi/test/wifi-emlsr-test.cc index b72d5770d..300099a41 100644 --- a/src/wifi/test/wifi-emlsr-test.cc +++ b/src/wifi/test/wifi-emlsr-test.cc @@ -197,6 +197,8 @@ EmlsrOperationsTestBase::DoSetup() mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(Ssid("wrong-ssid")), + "MaxMissedBeacons", + UintegerValue(1e6), // do not deassociate "ActiveProbing", BooleanValue(false)); mac.SetEmlsrManager("ns3::DefaultEmlsrManager", @@ -379,6 +381,8 @@ EmlsrOperationsTestBase::SetSsid(uint16_t aid, Mac48Address /* addr */) } // all stations associated; start traffic if needed StartTraffic(); + // stop generation of beacon frames in order to avoid interference + m_apMac->SetAttribute("BeaconGeneration", BooleanValue(false)); }); } @@ -3579,18 +3583,12 @@ EmlsrLinkSwitchTest::CheckResults() const std::size_t nRxOk = 4; // successfully received ICFs NS_TEST_ASSERT_MSG_GT_OR_EQ(m_txPsdus.size(), - m_txPsdusPos + 3 + nRxOk * 4, + m_txPsdusPos + 2 + nRxOk * 4, "Insufficient number of TX PSDUs"); // m_txPsdusPos points to ADDBA_RESPONSE, then ACK and then ICF auto psduIt = std::next(m_txPsdus.cbegin(), m_txPsdusPos + 2); - // skip first PSDU if it contains a Beacon frame - if (psduIt->psduMap.at(SU_STA_ID)->GetHeader(0).IsBeacon()) - { - psduIt++; - } - for (std::size_t i = 0; i < nRxOk; i++) { NS_TEST_EXPECT_MSG_EQ((psduIt->psduMap.size() == 1 &&