Test initial channel settings for AP and non-AP STAs when those are not necessarily identical. More...
Classes | |
struct | Params |
Parameters for the test. More... | |
Public Member Functions | |
WifiChannelSettingsTest (const Params ¶ms) | |
Constructor. | |
~WifiChannelSettingsTest () override=default | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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< ApWifiMac > | m_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< StaWifiMac > | m_staWifiMac |
STA wifi MAC. | |
const uint32_t | m_ulPacketSize {600} |
UL packet size (bytes) | |
Additional Inherited Members | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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. | |
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.
WifiChannelSettingsTest::WifiChannelSettingsTest | ( | const Params & | params | ) |
Constructor.
params | parameters for the test |
Definition at line 114 of file wifi-channel-settings-test.cc.
|
overridedefault |
Callback invoked when a packet is received by the server application.
p | the packet |
adr | the 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().
|
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().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 135 of file wifi-channel-settings-test.cc.
References ns3::Node::AddApplication(), WifiChannelSettingsTest::Params::apChannelSettings, AppRx(), WifiChannelSettingsTest::Params::apStandard, ns3::WifiHelper::AssignStreams(), CheckResults(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::PacketSocketHelper::Install(), m_apWifiMac, m_dlPacketSize, m_params, m_staWifiMac, m_ulPacketSize, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_EQ, ns3::Simulator::Run(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), WifiChannelSettingsTest::Params::skipAssocIncompatibleChannelWidth, WifiChannelSettingsTest::Params::staChannelSettings, WifiChannelSettingsTest::Params::staLargestSupportedChWidth, WifiChannelSettingsTest::Params::staStandard, and ns3::Simulator::Stop().
AP wifi MAC.
Definition at line 104 of file wifi-channel-settings-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
DL packet size (bytes)
Definition at line 107 of file wifi-channel-settings-test.cc.
|
private |
test parameters
Definition at line 102 of file wifi-channel-settings-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
received DL packets
Definition at line 110 of file wifi-channel-settings-test.cc.
Referenced by AppRx(), and CheckResults().
|
private |
received UL packets
Definition at line 111 of file wifi-channel-settings-test.cc.
Referenced by AppRx(), and CheckResults().
|
private |
STA wifi MAC.
Definition at line 105 of file wifi-channel-settings-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
UL packet size (bytes)
Definition at line 108 of file wifi-channel-settings-test.cc.