A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
WifiStaticInfraBssTest Class Reference

Test static setup of an infrastructure BSS. More...

+ Inheritance diagram for WifiStaticInfraBssTest:
+ Collaboration diagram for WifiStaticInfraBssTest:

Public Member Functions

 WifiStaticInfraBssTest (const WifiStaticInfraBssTestVector &testVec)
 Constructor.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
WifiMacHelper GetApMacHelper () const
 
WifiMacHelper GetClientMacHelper () const
 
SpectrumWifiPhyHelper GetPhyHelper (const StringVector &settings, const ChannelMap &channelMap) const
 Construct PHY helper based on input operating channels.
 
WifiHelper GetWifiHelper () const
 
Ptr< WifiNetDeviceGetWifiNetDevice (bool isAp, const ChannelMap &channelMap)
 Construct WifiNetDevice.
 
void ValidateAssoc ()
 Validate Association.
 
void ValidateAssocForLink (linkId_t clientLinkId, Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
 Validate association state machine at AP and client for input link.
 
void ValidateBaAgr (Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
 Validate Block ACK Agreement at AP and client.
 
void ValidateMuScheduler (Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
 Validate Multi-user scheduler setup.
 

Private Attributes

Ptr< WifiNetDevicem_apDev {nullptr}
 AP WiFi device.
 
std::optional< Mac48Addressm_apGcrGroupAddr
 GCR group address.
 
Ptr< WifiNetDevicem_clientDev {nullptr}
 client WiFi device
 
WifiStaticInfraBssTestVector m_testVec
 Test vector.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

Test static setup of an infrastructure BSS.

Definition at line 88 of file wifi-static-infra-bss-test.cc.

Constructor & Destructor Documentation

◆ WifiStaticInfraBssTest()

WifiStaticInfraBssTest::WifiStaticInfraBssTest ( const WifiStaticInfraBssTestVector & testVec)

Constructor.

Parameters
testVecthe test vector

Definition at line 148 of file wifi-static-infra-bss-test.cc.

References ns3::TestCase::TestCase(), and m_testVec.

+ Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void WifiStaticInfraBssTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 403 of file wifi-static-infra-bss-test.cc.

References WifiStaticInfraBssTestConstants::DEFAULT_SIM_STOP_TIME, ns3::Simulator::Destroy(), ns3::Simulator::Run(), ns3::Simulator::Stop(), and ValidateAssoc().

+ Here is the call graph for this function:

◆ DoSetup()

void WifiStaticInfraBssTest::DoSetup ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from ns3::TestCase.

Definition at line 236 of file wifi-static-infra-bss-test.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::CreateObject(), WifiStaticInfraBssTestConstants::DEFAULT_RNG_RUN, WifiStaticInfraBssTestConstants::DEFAULT_RNG_SEED, WifiStaticInfraBssTestConstants::DEFAULT_TEST_TID, GetWifiNetDevice(), m_apDev, m_apGcrGroupAddr, m_clientDev, m_testVec, NS_ASSERT, NS_ASSERT_MSG, ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::WifiStaticSetupHelper::SetStaticAssociation(), ns3::WifiStaticSetupHelper::SetStaticBlockAck(), ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_BAND_6GHZ.

+ Here is the call graph for this function:

◆ GetApMacHelper()

WifiMacHelper WifiStaticInfraBssTest::GetApMacHelper ( ) const
private
Returns
the AP MAC helper

Definition at line 191 of file wifi-static-infra-bss-test.cc.

References WifiStaticInfraBssTestConstants::DEFAULT_BEACON_GEN, WifiStaticInfraBssTestConstants::DEFAULT_SSID, WifiStaticInfraBssTestConstants::DEFAULT_WIFI_UL_MU_NUM_RU, m_testVec, ns3::WifiMacHelper::SetMultiUserScheduler(), and ns3::WifiMacHelper::SetType().

Referenced by GetWifiNetDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetClientMacHelper()

WifiMacHelper WifiStaticInfraBssTest::GetClientMacHelper ( ) const
private
Returns
the Client MAC helper

Definition at line 210 of file wifi-static-infra-bss-test.cc.

References WifiStaticInfraBssTestConstants::DEFAULT_SSID, m_testVec, and ns3::WifiMacHelper::SetType().

Referenced by GetWifiNetDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPhyHelper()

SpectrumWifiPhyHelper WifiStaticInfraBssTest::GetPhyHelper ( const StringVector & settings,
const ChannelMap & channelMap ) const
private

Construct PHY helper based on input operating channels.

Parameters
settingsvector of strings specifying the operating channels to configure
channelMapcreated spectrum channels
Returns
PHY helper

Definition at line 168 of file wifi-static-infra-bss-test.cc.

References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::SpectrumWifiPhyHelper::AddPhyToFreqRangeMapping(), ns3::WifiChannelConfig::FromString(), ns3::GetFrequencyRange(), NS_ASSERT, and ns3::WifiPhyHelper::Set().

Referenced by GetWifiNetDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWifiHelper()

WifiHelper WifiStaticInfraBssTest::GetWifiHelper ( ) const
private
Returns
the WifiHelper

Definition at line 155 of file wifi-static-infra-bss-test.cc.

References WifiStaticInfraBssTestConstants::DEFAULT_CONTROL_MODE, WifiStaticInfraBssTestConstants::DEFAULT_DATA_MODE, WifiStaticInfraBssTestConstants::DEFAULT_WIFI_STANDARD, ns3::WifiHelper::SetRemoteStationManager(), and ns3::WifiHelper::SetStandard().

Referenced by GetWifiNetDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWifiNetDevice()

Ptr< WifiNetDevice > WifiStaticInfraBssTest::GetWifiNetDevice ( bool isAp,
const ChannelMap & channelMap )
private

Construct WifiNetDevice.

Parameters
isAptrue if AP, false otherwise
channelMapcreated spectrum channels
Returns
constructed WifiNetDevice

Definition at line 223 of file wifi-static-infra-bss-test.cc.

References ns3::WifiHelper::AssignStreams(), WifiStaticInfraBssTestConstants::DEFAULT_STREAM_INDEX, ns3::DynamicCast(), GetApMacHelper(), GetClientMacHelper(), GetPhyHelper(), GetWifiHelper(), and m_testVec.

Referenced by DoSetup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateAssoc()

void WifiStaticInfraBssTest::ValidateAssoc ( )
private

Validate Association.

Definition at line 382 of file wifi-static-infra-bss-test.cc.

References ns3::DynamicCast(), m_apDev, m_clientDev, m_testVec, NS_ASSERT, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ValidateAssocForLink(), ValidateBaAgr(), and ValidateMuScheduler().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateAssocForLink()

void WifiStaticInfraBssTest::ValidateAssocForLink ( linkId_t clientLinkId,
Ptr< ApWifiMac > apMac,
Ptr< StaWifiMac > clientMac )
private

Validate association state machine at AP and client for input link.

Parameters
clientLinkIdclient local Link ID
apMacAP MAC
clientMacClient MAC

Definition at line 265 of file wifi-static-infra-bss-test.cc.

References NS_TEST_ASSERT_MSG_EQ.

Referenced by ValidateAssoc().

+ Here is the caller graph for this function:

◆ ValidateBaAgr()

void WifiStaticInfraBssTest::ValidateBaAgr ( Ptr< ApWifiMac > apMac,
Ptr< StaWifiMac > clientMac )
private

Validate Block ACK Agreement at AP and client.

Parameters
apMacAP MAC
clientMacClient MAC

Definition at line 330 of file wifi-static-infra-bss-test.cc.

References WifiStaticInfraBssTestConstants::DEFAULT_TEST_TID, m_apGcrGroupAddr, m_testVec, and NS_TEST_ASSERT_MSG_EQ.

Referenced by ValidateAssoc().

+ Here is the caller graph for this function:

◆ ValidateMuScheduler()

void WifiStaticInfraBssTest::ValidateMuScheduler ( Ptr< ApWifiMac > apMac,
Ptr< StaWifiMac > clientMac )
private

Validate Multi-user scheduler setup.

Parameters
apMacAP MAC
clientMacNon-AP MAC

Definition at line 314 of file wifi-static-infra-bss-test.cc.

References m_testVec, NS_ASSERT, and NS_TEST_ASSERT_MSG_EQ.

Referenced by ValidateAssoc().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_apDev

Ptr<WifiNetDevice> WifiStaticInfraBssTest::m_apDev {nullptr}
private

AP WiFi device.

Definition at line 143 of file wifi-static-infra-bss-test.cc.

Referenced by DoSetup(), and ValidateAssoc().

◆ m_apGcrGroupAddr

std::optional<Mac48Address> WifiStaticInfraBssTest::m_apGcrGroupAddr
private

GCR group address.

Definition at line 145 of file wifi-static-infra-bss-test.cc.

Referenced by DoSetup(), and ValidateBaAgr().

◆ m_clientDev

Ptr<WifiNetDevice> WifiStaticInfraBssTest::m_clientDev {nullptr}
private

client WiFi device

Definition at line 144 of file wifi-static-infra-bss-test.cc.

Referenced by DoSetup(), and ValidateAssoc().

◆ m_testVec


The documentation for this class was generated from the following file: