Test FILS frames. More...
Classes | |
struct | PsduCapture |
Transmitted PSDUs. More... | |
struct | TimeStats |
Timing statistic for test validation. More... | |
Public Member Functions | |
WifiFilsFrameTest (const WifiFilsFrameTestParams ¶ms) | |
constructor | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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. | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. | |
std::optional< FilsDiscHeader > | GetFilsDiscFrame (const PsduCapture &psduCapt) |
Get the FILS Discovery header, if present in the given frame. | |
void | PsduTxCallback (WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
callback connected to PSDU TX begin trace source | |
Ptr< WifiNetDevice > | SetupDevice (Ptr< YansWifiChannel > &channel, bool isAp) |
setup a WifiNetDevice | |
void | ValidateCnt (const PsduCapture &psduCapt) |
Check the number of FILS Discovery frames or unsolicited Probe Response frames transmitted since the last Beacon frame. | |
void | ValidateFilsDiscFrame (const FilsDiscHeader &filsDisc) |
validate the given FILS Discovery frame | |
void | ValidateTest () |
check the correctness of the test | |
void | ValidateTiming (const PsduCapture &psduCapt) |
check the timing of the transmitted FILS Discovery or unsolicited Probe Response | |
Private Attributes | |
Ptr< WifiNetDevice > | m_ap {nullptr} |
AP device. | |
Ptr< WifiNetDevice > | m_client {nullptr} |
Client device. | |
WifiFilsFrameTestParams | m_params |
Test parameters. | |
TimeStats | m_timeStats |
collected timing statistic | |
std::vector< PsduCapture > | m_txPsdus {} |
TX PSDUS frame infos. | |
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. | |
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 FILS frames.
Definition at line 91 of file wifi-fils-frame-test.cc.
WifiFilsFrameTest::WifiFilsFrameTest | ( | const WifiFilsFrameTestParams & | params | ) |
constructor
params | the parameters for this test |
Definition at line 162 of file wifi-fils-frame-test.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 349 of file wifi-fils-frame-test.cc.
References DEFAULT_SIM_STOP_TIME, ns3::Simulator::Destroy(), ns3::Simulator::Run(), ns3::Simulator::Stop(), and ValidateTest().
|
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 239 of file wifi-fils-frame-test.cc.
References ns3::YansWifiChannelHelper::Create(), ns3::YansWifiChannelHelper::Default(), DEFAULT_RNG_RUN, DEFAULT_RNG_SEED, m_ap, m_client, ns3::MakeCallback(), PsduTxCallback(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and SetupDevice().
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test teardown
Reimplemented from ns3::TestCase.
Definition at line 358 of file wifi-fils-frame-test.cc.
|
private |
Get the FILS Discovery header, if present in the given frame.
psduCapt | information about the given frame |
Definition at line 286 of file wifi-fils-frame-test.cc.
References ns3::Packet::Copy(), ns3::WifiActionHeader::FILS_DISCOVERY, ns3::WifiActionHeader::GetAction(), ns3::WifiActionHeader::GetCategory(), ns3::WifiPsdu::GetPayload(), WifiFilsFrameTest::PsduCapture::psdu, ns3::WifiActionHeader::PUBLIC, and ns3::WifiActionHeader::ActionValue::publicAction.
Referenced by ValidateTest().
|
private |
callback connected to PSDU TX begin trace source
psduMap | the transmitted PSDU map |
txVector | the TXVECTOR |
txPowerW | the TX power in Watts |
Definition at line 231 of file wifi-fils-frame-test.cc.
References m_txPsdus, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::SU_STA_ID.
Referenced by DoSetup().
|
private |
setup a WifiNetDevice
channel | the channel to attach to |
isAp | whether the device is an AP |
Definition at line 169 of file wifi-fils-frame-test.cc.
References ns3::WifiHelper::AssignStreams(), WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTestParams::bw, ns3::NodeContainer::Create(), DEFAULT_AP_LOC, DEFAULT_BAND, DEFAULT_CLIENT_LOC, DEFAULT_ENABLE_PCAP, DEFAULT_OUTDIR, DEFAULT_PCAP_PREFIX, DEFAULT_PRIMARY_INDEX, DEFAULT_STANDARD, DEFAULT_STREAM_INDEX, ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DynamicCast(), WifiFilsFrameTestParams::filsIntrvl, ns3::NodeContainer::Get(), ns3::Object::GetObject(), INVALID_CHAN_NUM, m_params, WifiFilsFrameTestParams::nss, ns3::AttributeContainerValue< A, Sep, C >::Set(), WifiFilsFrameTestParams::ssid, and WifiFilsFrameTestParams::unsolProbeRespEn.
Referenced by DoSetup().
|
private |
Check the number of FILS Discovery frames or unsolicited Probe Response frames transmitted since the last Beacon frame.
psduCapt | information about the transmitted Beacon frame |
Definition at line 254 of file wifi-fils-frame-test.cc.
References WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTest::TimeStats::bcnTimeSt, WifiFilsFrameTest::TimeStats::cntBcns, WifiFilsFrameTest::TimeStats::cntFilsOrUnsolProbeResps, WifiFilsFrameTestParams::filsIntrvl, m_params, m_timeStats, NS_TEST_ASSERT_MSG_EQ, and WifiFilsFrameTest::PsduCapture::timeSt.
Referenced by ValidateTest().
|
private |
validate the given FILS Discovery frame
filsDisc | the FILS Discovery frame |
Definition at line 334 of file wifi-fils-frame-test.cc.
References WifiFilsFrameTestParams::expChWidFld, WifiFilsFrameTestParams::expNssFld, ns3::FilsDiscHeader::GetSsid(), ns3::FilsDiscHeader::m_fdCap, m_params, NS_TEST_ASSERT_MSG_EQ, WifiFilsFrameTestParams::ssid, and WIFI_6GHZ_FD_PHY_IDX.
Referenced by ValidateTest().
|
private |
check the correctness of the test
Definition at line 302 of file wifi-fils-frame-test.cc.
References WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTest::TimeStats::cntBcns, DEFAULT_SIM_STOP_TIME, GetFilsDiscFrame(), m_params, m_timeStats, m_txPsdus, WifiFilsFrameTestParams::unsolProbeRespEn, ValidateCnt(), ValidateFilsDiscFrame(), and ValidateTiming().
Referenced by DoRun().
|
private |
check the timing of the transmitted FILS Discovery or unsolicited Probe Response
psduCapt | information about the FILS Discovery or unsolicited Probe Response |
Definition at line 269 of file wifi-fils-frame-test.cc.
References WifiFilsFrameTest::TimeStats::bcnTimeSt, WifiFilsFrameTest::TimeStats::cntFilsOrUnsolProbeResps, DEFAULT_TIMING_TOLERANCE, WifiFilsFrameTestParams::filsIntrvl, WifiFilsFrameTest::TimeStats::filsOrUnsolProbeRespTimeDelta, WifiFilsFrameTest::TimeStats::filsOrUnsolProbeRespTimeSt, ns3::Time::GetTimeStep(), m_params, m_timeStats, NS_TEST_ASSERT_MSG_EQ_TOL, and WifiFilsFrameTest::PsduCapture::timeSt.
Referenced by ValidateTest().
|
private |
AP device.
Definition at line 156 of file wifi-fils-frame-test.cc.
Referenced by DoSetup(), and DoTeardown().
|
private |
Client device.
Definition at line 157 of file wifi-fils-frame-test.cc.
Referenced by DoSetup(), and DoTeardown().
|
private |
Test parameters.
Definition at line 158 of file wifi-fils-frame-test.cc.
Referenced by SetupDevice(), ValidateCnt(), ValidateFilsDiscFrame(), ValidateTest(), and ValidateTiming().
|
private |
collected timing statistic
Definition at line 155 of file wifi-fils-frame-test.cc.
Referenced by ValidateCnt(), ValidateTest(), and ValidateTiming().
|
private |
TX PSDUS frame infos.
Definition at line 159 of file wifi-fils-frame-test.cc.
Referenced by DoTeardown(), PsduTxCallback(), and ValidateTest().