Channel Access Manager Test. More...
Public Member Functions | |
ChannelAccessManagerTest () | |
void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
void | DoRun (void) override |
Implementation to actually run this TestCase. More... | |
void | GenerateBackoff (uint32_t i) |
Generate backoff function. More... | |
void | NotifyAccessGranted (uint32_t i) |
Notify access granted function. More... | |
void | NotifyChannelSwitching (void) |
Notify channel switching function. More... | |
void | NotifyInternalCollision (Ptr< TxopTest< TxopType >> state) |
Notify internal collision function. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Types | |
typedef std::vector< Ptr< TxopTest< TxopType > > > | TxopTests |
the TXOP tests typedef More... | |
Private Member Functions | |
void | AddAccessRequest (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from) |
Add access function. More... | |
void | AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from) |
Add access request with Ack timeout. More... | |
void | AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from) |
Add access request with successful ack. More... | |
void | AddAckTimeoutReset (uint64_t at) |
Add Ack timeout reset function. More... | |
void | AddCcaBusyEvt (uint64_t at, uint64_t duration) |
Add CCA busy event function. More... | |
void | AddNavReset (uint64_t at, uint64_t duration) |
Add NAV reset function. More... | |
void | AddNavStart (uint64_t at, uint64_t duration) |
Add NAV start function. More... | |
void | AddRxErrorEvt (uint64_t at, uint64_t duration) |
Add receive error event function for error at end of frame. More... | |
void | AddRxErrorEvt (uint64_t at, uint64_t duration, uint64_t timeUntilError) |
Add receive error event function for error during frame. More... | |
void | AddRxInsideSifsEvt (uint64_t at, uint64_t duration) |
Add receive inside SIFS event function. More... | |
void | AddRxOkEvt (uint64_t at, uint64_t duration) |
Add receive OK event function. More... | |
void | AddRxStartEvt (uint64_t at, uint64_t duration) |
Add receive start event function. More... | |
void | AddSwitchingEvt (uint64_t at, uint64_t duration) |
Add switching event function. More... | |
void | AddTxEvt (uint64_t at, uint64_t duration) |
Add transmit event function. More... | |
void | AddTxop (uint32_t aifsn) |
Add Txop function. More... | |
void | DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, Ptr< TxopTest< TxopType >> state) |
Add access request with successful Ack. More... | |
void | DoCheckBusy (bool busy) |
Perform check that channel access manager is busy or idle. More... | |
void | EndTest (void) |
End test function. More... | |
void | ExpectBackoff (uint64_t time, uint32_t nSlots, uint32_t from) |
Expect generate backoff function. More... | |
void | ExpectBusy (uint64_t time, bool busy) |
Schedule a check that the channel access manager is busy or idle. More... | |
void | ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from) |
Expect internal collision function. More... | |
void | StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue=20) |
Start test function. More... | |
Private Attributes | |
uint32_t | m_ackTimeoutValue |
the Ack timeout value More... | |
Ptr< ChannelAccessManagerStub > | m_ChannelAccessManager |
the channel access manager More... | |
Ptr< FrameExchangeManagerStub< TxopType > > | m_feManager |
the Frame Exchange Manager stubbed More... | |
TxopTests | m_txop |
the vector of Txop test instances More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { 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. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Channel Access Manager Test.
Definition at line 211 of file channel-access-manager-test.cc.
|
private |
the TXOP tests typedef
Definition at line 381 of file channel-access-manager-test.cc.
ChannelAccessManagerTest< TxopType >::ChannelAccessManagerTest |
Definition at line 446 of file channel-access-manager-test.cc.
|
private |
Add access function.
at | the event time |
txTime | the transmit time |
expectedGrantTime | the expected grant time |
from | the index of the requesting Txop |
Definition at line 675 of file channel-access-manager-test.cc.
|
private |
Add access request with Ack timeout.
at | time to schedule DoAccessRequest event |
txTime | the transmit time |
expectedGrantTime | the expected grant time |
from | the index of the requesting Txop |
Definition at line 683 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest< TxopType >::DoAccessRequest(), ns3::MicroSeconds(), and ns3::Now().
|
private |
Add access request with successful ack.
at | time to schedule DoAccessRequest event |
txTime | the transmit time |
expectedGrantTime | the expected grant time |
ackDelay | the delay of the Ack after txEnd |
from | the index of the requesting Txop |
Definition at line 693 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest< TxopType >::DoAccessRequest(), ns3::MicroSeconds(), ns3::Now(), and NS_ASSERT.
|
private |
Add Ack timeout reset function.
at | the event time |
Definition at line 667 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add CCA busy event function.
at | the event time |
duration | the duration |
Definition at line 718 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add NAV reset function.
at | the event time |
duration | the duration |
Definition at line 649 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add NAV start function.
at | the event time |
duration | the duration |
Definition at line 658 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add receive error event function for error at end of frame.
at | the event time |
duration | the duration |
Definition at line 626 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add receive error event function for error during frame.
at | the event time |
duration | the duration |
timeUntilError | the time after event time to force the error |
Definition at line 637 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add receive inside SIFS event function.
at | the event time |
duration | the duration |
Definition at line 617 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add receive OK event function.
at | the event time |
duration | the duration |
Definition at line 606 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add receive start event function.
at | the event time |
duration | the duration |
Definition at line 736 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add switching event function.
at | the event time |
duration | the duration |
Definition at line 727 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add transmit event function.
at | the event time |
duration | the duration |
Definition at line 469 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), and ns3::Now().
|
private |
Add Txop function.
aifsn | the AIFSN |
Definition at line 573 of file channel-access-manager-test.cc.
|
private |
Add access request with successful Ack.
txTime | the transmit time |
expectedGrantTime | the expected grant time |
state | TxopTest |
Definition at line 705 of file channel-access-manager-test.cc.
Referenced by ChannelAccessManagerTest< TxopType >::AddAccessRequestWithAckTimeout(), and ChannelAccessManagerTest< TxopType >::AddAccessRequestWithSuccessfullAck().
|
private |
Perform check that channel access manager is busy or idle.
busy | whether expected state is busy |
Definition at line 553 of file channel-access-manager-test.cc.
References NS_TEST_EXPECT_MSG_EQ.
Referenced by ChannelAccessManagerTest< TxopType >::ExpectBusy().
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 748 of file channel-access-manager-test.cc.
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1090 of file channel-access-manager-test.cc.
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
|
private |
End test function.
Definition at line 583 of file channel-access-manager-test.cc.
References NS_TEST_EXPECT_MSG_EQ.
|
private |
Expect generate backoff function.
time | the expected time |
nSlots | the number of slots |
from | the expected from |
Definition at line 534 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedBackoff.
|
private |
Schedule a check that the channel access manager is busy or idle.
time | the expected time |
busy | whether the manager is expected to be busy |
Definition at line 545 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest< TxopType >::DoCheckBusy(), ns3::MicroSeconds(), and ns3::Now().
|
private |
Expect internal collision function.
time | the expected time |
nSlots | the number of slots |
from | the expected from |
Definition at line 523 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedInternalCollision.
void ChannelAccessManagerTest< TxopType >::GenerateBackoff | ( | uint32_t | i | ) |
Generate backoff function.
i | the index of the Txop |
Definition at line 492 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedBackoff, and NS_TEST_EXPECT_MSG_EQ.
void ChannelAccessManagerTest< TxopType >::NotifyAccessGranted | ( | uint32_t | i | ) |
Notify access granted function.
i | the index of the Txop |
Definition at line 453 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), ns3::Now(), and NS_TEST_EXPECT_MSG_EQ.
void ChannelAccessManagerTest< TxopType >::NotifyChannelSwitching | ( | void | ) |
Notify channel switching function.
Definition at line 507 of file channel-access-manager-test.cc.
References ns3::MicroSeconds(), ns3::Now(), and NS_TEST_EXPECT_MSG_EQ.
void ChannelAccessManagerTest< TxopType >::NotifyInternalCollision | ( | Ptr< TxopTest< TxopType >> | state | ) |
Notify internal collision function.
state | the Txop |
Definition at line 478 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedInternalCollision, and NS_TEST_EXPECT_MSG_EQ.
|
private |
Start test function.
slotTime | the slot time |
sifs | the SIFS |
eifsNoDifsNoSifs | the EIFS no DIFS no SIFS |
ackTimeoutValue | the Ack timeout value |
Definition at line 560 of file channel-access-manager-test.cc.
References ns3::MicroSeconds().
|
private |
the Ack timeout value
Definition at line 386 of file channel-access-manager-test.cc.
|
private |
the channel access manager
Definition at line 384 of file channel-access-manager-test.cc.
|
private |
the Frame Exchange Manager stubbed
Definition at line 383 of file channel-access-manager-test.cc.
|
private |
the vector of Txop test instances
Definition at line 385 of file channel-access-manager-test.cc.