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

Test initial channel settings for AP and non-AP STAs when those are not necessarily identical. More...

+ Inheritance diagram for WifiChannelSettingsTest:
+ Collaboration diagram for WifiChannelSettingsTest:

Classes

struct  Params
 Parameters for the test. More...
 

Public Member Functions

 WifiChannelSettingsTest (const Params &params)
 Constructor.
 
 ~WifiChannelSettingsTest () override=default
 
- 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 AppRx (Ptr< const Packet > p, const Address &adr)
 Callback invoked when a packet is received by the server application.
 
void CheckResults ()
 Check results.
 
void DoRun () override
 Implementation to actually run this TestCase.
 

Private Attributes

Ptr< ApWifiMacm_apWifiMac
 AP wifi MAC.
 
const uint32_t m_dlPacketSize {1400}
 DL packet size (bytes)
 
Params m_params
 test parameters
 
uint32_t m_receivedDl {0}
 received DL packets
 
uint32_t m_receivedUl {0}
 received UL packets
 
Ptr< StaWifiMacm_staWifiMac
 STA wifi MAC.
 
const uint32_t m_ulPacketSize {600}
 UL packet size (bytes)
 

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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- 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 initial channel settings for AP and non-AP STAs when those are not necessarily identical.

This test verifies the channel width used by the non-AP STA is properly advertised to the AP STA, and that invalid combinations get rejected. It generates DL and UL traffic (limited to 1 packet for each direction) and checks that the number of received packets matches with the expectation.

Definition at line 46 of file wifi-channel-settings-test.cc.

Constructor & Destructor Documentation

◆ WifiChannelSettingsTest()

WifiChannelSettingsTest::WifiChannelSettingsTest ( const Params & params)

Constructor.

Parameters
paramsparameters for the test

Definition at line 114 of file wifi-channel-settings-test.cc.

◆ ~WifiChannelSettingsTest()

WifiChannelSettingsTest::~WifiChannelSettingsTest ( )
overridedefault

Member Function Documentation

◆ AppRx()

void WifiChannelSettingsTest::AppRx ( Ptr< const Packet > p,
const Address & adr )
private

Callback invoked when a packet is received by the server application.

Parameters
pthe packet
adrthe address

Definition at line 121 of file wifi-channel-settings-test.cc.

References m_dlPacketSize, m_receivedDl, m_receivedUl, m_ulPacketSize, and NS_LOG_INFO.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckResults()

void WifiChannelSettingsTest::CheckResults ( )
private

Check results.

Definition at line 277 of file wifi-channel-settings-test.cc.

References ns3::GetSupportedChannelWidthSet(), m_apWifiMac, m_params, m_receivedDl, m_receivedUl, m_staWifiMac, NS_TEST_EXPECT_MSG_EQ, and WifiChannelSettingsTest::Params::skipAssocIncompatibleChannelWidth.

Referenced by DoRun().

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

◆ DoRun()

Member Data Documentation

◆ m_apWifiMac

Ptr<ApWifiMac> WifiChannelSettingsTest::m_apWifiMac
private

AP wifi MAC.

Definition at line 104 of file wifi-channel-settings-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_dlPacketSize

const uint32_t WifiChannelSettingsTest::m_dlPacketSize {1400}
private

DL packet size (bytes)

Definition at line 107 of file wifi-channel-settings-test.cc.

Referenced by AppRx(), and DoRun().

◆ m_params

Params WifiChannelSettingsTest::m_params
private

test parameters

Definition at line 102 of file wifi-channel-settings-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_receivedDl

uint32_t WifiChannelSettingsTest::m_receivedDl {0}
private

received DL packets

Definition at line 110 of file wifi-channel-settings-test.cc.

Referenced by AppRx(), and CheckResults().

◆ m_receivedUl

uint32_t WifiChannelSettingsTest::m_receivedUl {0}
private

received UL packets

Definition at line 111 of file wifi-channel-settings-test.cc.

Referenced by AppRx(), and CheckResults().

◆ m_staWifiMac

Ptr<StaWifiMac> WifiChannelSettingsTest::m_staWifiMac
private

STA wifi MAC.

Definition at line 105 of file wifi-channel-settings-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_ulPacketSize

const uint32_t WifiChannelSettingsTest::m_ulPacketSize {600}
private

UL packet size (bytes)

Definition at line 108 of file wifi-channel-settings-test.cc.

Referenced by AppRx(), and DoRun().


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