Zigbee RREQ transmission retries test case. More...
Public Member Functions | |
ZigbeeRreqRetryTestCase () | |
~ZigbeeRreqRetryTestCase () override | |
![]() | |
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. | |
Static Private Member Functions | |
static void | NwkJoinConfirm (ZigbeeRreqRetryTestCase *testcase, Ptr< ZigbeeStack > stack, NlmeJoinConfirmParams params) |
Called in response to a NLME-JOIN.request. | |
static void | NwkNetworkDiscoveryConfirm (ZigbeeRreqRetryTestCase *testcase, Ptr< ZigbeeStack > stack, NlmeNetworkDiscoveryConfirmParams params) |
Called in response to a NLME-NETWORK-DISCOVERY.request. | |
static void | RreqRetriesExhausted (ZigbeeRreqRetryTestCase *testcase, Ptr< ZigbeeStack > stack, uint8_t rreqid, Mac16Address dst, uint8_t rreqRetriesNum) |
Called when a maximum RREQ retries are reached. | |
Private Attributes | |
std::vector< std::pair< uint32_t, uint32_t > > | m_rreqRetriesExhaustedList |
A list containing the RREQ ID and the allowed max retries every time the maximum RREQ retries are reached. | |
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. | |
Zigbee RREQ transmission retries test case.
Definition at line 37 of file zigbee-rreq-test.cc.
ZigbeeRreqRetryTestCase::ZigbeeRreqRetryTestCase | ( | ) |
Definition at line 88 of file zigbee-rreq-test.cc.
|
override |
Definition at line 93 of file zigbee-rreq-test.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 184 of file zigbee-rreq-test.cc.
References ns3::zigbee::ALL_CHANNELS, ns3::zigbee::ChannelList::channelPageCount, ns3::zigbee::ChannelList::channelsField, ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::zigbee::ZigbeeStackContainer::Get(), ns3::LrWpanHelper::Install(), ns3::ZigbeeHelper::Install(), ns3::LOG_LEVEL_DEBUG, ns3::LOG_PREFIX_FUNC, ns3::LOG_PREFIX_NODE, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), ns3::LogComponentEnableAll(), ns3::zigbee::NlmeNetworkFormationRequestParams::m_beaconOrder, ns3::zigbee::NlmeRouteDiscoveryRequestParams::m_dstAddr, m_rreqRetriesExhaustedList, ns3::zigbee::NlmeNetworkDiscoveryRequestParams::m_scanChannelList, ns3::zigbee::NlmeNetworkFormationRequestParams::m_scanChannelList, ns3::zigbee::NlmeNetworkDiscoveryRequestParams::m_scanDuration, ns3::zigbee::NlmeNetworkFormationRequestParams::m_scanDuration, ns3::zigbee::NlmeNetworkFormationRequestParams::m_superFrameOrder, ns3::MakeBoundCallback(), ns3::zigbee::ZigbeeNwk::NlmeNetworkDiscoveryRequest(), ns3::zigbee::ZigbeeNwk::NlmeNetworkFormationRequest(), ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest(), nodes, NS_TEST_EXPECT_MSG_EQ, NwkJoinConfirm(), NwkNetworkDiscoveryConfirm(), RreqRetriesExhausted(), ns3::Simulator::Run(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), ns3::RngSeedManager::SetRun(), and ns3::RngSeedManager::SetSeed().
|
staticprivate |
Called in response to a NLME-JOIN.request.
testcase | The pointer to the testcase |
stack | The zigbee stack of the device originating the callback |
params | The NLME-JOIN.confirm parameters |
Definition at line 142 of file zigbee-rreq-test.cc.
References ns3::Time::As(), ns3::zigbee::ZigbeeNwk::NlmeStartRouterRequest(), ns3::Simulator::Now(), ns3::Time::S, and ns3::Simulator::ScheduleNow().
Referenced by DoRun().
|
staticprivate |
Called in response to a NLME-NETWORK-DISCOVERY.request.
testcase | The pointer to the testcase |
stack | The zigbee stack of the device originating the callback |
params | The NLME-NETWORK-DISCOVERY.confirm parameters |
Definition at line 98 of file zigbee-rreq-test.cc.
References ns3::zigbee::CapabilityInformation::GetCapability(), ns3::zigbee::NlmeJoinRequestParams::m_capabilityInfo, ns3::zigbee::NlmeJoinRequestParams::m_extendedPanId, ns3::zigbee::NlmeJoinRequestParams::m_rejoinNetwork, ns3::zigbee::ZigbeeNwk::NlmeJoinRequest(), NS_ABORT_MSG, ns3::zigbee::ROUTER, ns3::Simulator::ScheduleNow(), ns3::zigbee::CapabilityInformation::SetAllocateAddrOn(), and ns3::zigbee::CapabilityInformation::SetDeviceType().
Referenced by DoRun().
|
staticprivate |
Called when a maximum RREQ retries are reached.
testcase | The pointer to the testcase |
stack | The zigbee stack of the device originating the callback |
rreqid | The RREQ ID |
dst | The destination Mac16Address of the RREQ |
rreqRetriesNum | Maximum number of retries reached |
Definition at line 169 of file zigbee-rreq-test.cc.
References m_rreqRetriesExhaustedList, and NS_LOG_DEBUG.
Referenced by DoRun().
|
private |
A list containing the RREQ ID and the allowed max retries every time the maximum RREQ retries are reached.
Definition at line 83 of file zigbee-rreq-test.cc.
Referenced by DoRun(), and RreqRetriesExhausted().