Testing the initial cell selection procedure by UE at IDLE state in the beginning of simulation. More...
#include "lte-test-cell-selection.h"
Classes | |
struct | UeSetup_t |
A set of input parameters for setting up a UE in the simulation. More... | |
Public Member Functions | |
LteCellSelectionTestCase (std::string name, bool isEpcMode, bool isIdealRrc, double interSiteDistance, std::vector< UeSetup_t > ueSetupList) | |
Creates an instance of the initial cell selection test case. More... | |
~LteCellSelectionTestCase () override | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckPoint (Ptr< LteUeNetDevice > ueDev, uint16_t expectedCellId1, uint16_t expectedCellId2) |
Verifies if the given UE is attached to either of the given two cells and in a CONNECTED_NORMALLY state. More... | |
void | ConnectionEstablishedCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
Connection established callback function. More... | |
void | DoRun () override |
Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. More... | |
void | InitialCellSelectionEndErrorCallback (std::string context, uint64_t imsi, uint16_t cellId) |
Initial cell selection end error callback function. More... | |
void | InitialCellSelectionEndOkCallback (std::string context, uint64_t imsi, uint16_t cellId) |
Initial cell selection end ok callback function. More... | |
void | StateTransitionCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteUeRrc::State oldState, LteUeRrc::State newState) |
State transition callback function. More... | |
Private Attributes | |
double | m_interSiteDistance |
inter site distance More... | |
bool | m_isEpcMode |
whether the LTE configuration in test is using EPC More... | |
bool | m_isIdealRrc |
whether the LTE is configured to use ideal RRC More... | |
std::vector< LteUeRrc::State > | m_lastState |
The current UE RRC state. More... | |
std::vector< UeSetup_t > | m_ueSetupList |
UE setup list. 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 TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () 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 () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () 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... | |
Testing the initial cell selection procedure by UE at IDLE state in the beginning of simulation.
Definition at line 59 of file lte-test-cell-selection.h.
LteCellSelectionTestCase::LteCellSelectionTestCase | ( | std::string | name, |
bool | isEpcMode, | ||
bool | isIdealRrc, | ||
double | interSiteDistance, | ||
std::vector< UeSetup_t > | ueSetupList | ||
) |
Creates an instance of the initial cell selection test case.
name | name of this test |
isEpcMode | set to true for setting up simulation with EPC enabled |
isIdealRrc | if true, simulation uses Ideal RRC protocol, otherwise simulation uses Real RRC protocol |
interSiteDistance | the distance between eNodeB in meters |
ueSetupList | a list of UE configuration to be installed in the simulation |
Definition at line 123 of file lte-test-cell-selection.cc.
References ns3::TestCase::GetName(), m_lastState, m_ueSetupList, and NS_LOG_FUNCTION.
|
override |
Definition at line 138 of file lte-test-cell-selection.cc.
References ns3::TestCase::GetName(), and NS_LOG_FUNCTION.
|
private |
Verifies if the given UE is attached to either of the given two cells and in a CONNECTED_NORMALLY state.
ueDev | the UE device |
expectedCellId1 | the first cell ID |
expectedCellId2 | the second cell ID |
Definition at line 366 of file lte-test-cell-selection.cc.
References m_lastState, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
private |
Connection established callback function.
context | the context string |
imsi | the IMSI |
cellId | the cell ID |
rnti | the RNTI |
Definition at line 426 of file lte-test-cell-selection.cc.
References NS_LOG_FUNCTION.
Referenced by DoRun().
|
overrideprivatevirtual |
Setup the simulation according to the configuration set by the class constructor, run it, and verify the result.
Implements ns3::TestCase.
Definition at line 144 of file lte-test-cell-selection.cc.
References ns3::NetDeviceContainer::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::LteHelper::AssignStreams(), ns3::NoBackhaulEpcHelper::AssignUeIpv4Address(), ns3::LteHelper::Attach(), ns3::NetDeviceContainer::Begin(), ns3::NodeContainer::Begin(), CheckPoint(), ns3::Config::Connect(), ConnectionEstablishedCallback(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::End(), ns3::NodeContainer::End(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::NoBackhaulEpcHelper::GetPgwNode(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress(), InitialCellSelectionEndErrorCallback(), InitialCellSelectionEndOkCallback(), ns3::PointToPointHelper::Install(), ns3::LteHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), nsclick-simple-lan::internet, m_interSiteDistance, m_isEpcMode, m_isIdealRrc, m_ueSetupList, ns3::MakeCallback(), ns3::MilliSeconds(), third::mobility, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Seconds(), ns3::ObjectBase::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::LteHelper::SetEnbDeviceAttribute(), ns3::LteHelper::SetEpcHelper(), ns3::Config::SetGlobal(), ns3::LteHelper::SetUeDeviceAttribute(), and StateTransitionCallback().
|
private |
Initial cell selection end error callback function.
context | the context string |
imsi | the IMSI |
cellId | the cell ID |
Definition at line 418 of file lte-test-cell-selection.cc.
References NS_LOG_FUNCTION.
Referenced by DoRun().
|
private |
Initial cell selection end ok callback function.
context | the context string |
imsi | the IMSI |
cellId | the cell ID |
Definition at line 410 of file lte-test-cell-selection.cc.
References NS_LOG_FUNCTION.
Referenced by DoRun().
|
private |
State transition callback function.
context | the context string |
imsi | the IMSI |
cellId | the cell ID |
rnti | the RNTI |
oldState | the old state |
newState | the new state |
Definition at line 398 of file lte-test-cell-selection.cc.
References m_lastState, and NS_LOG_FUNCTION.
Referenced by DoRun().
|
private |
inter site distance
Definition at line 171 of file lte-test-cell-selection.h.
Referenced by DoRun().
|
private |
whether the LTE configuration in test is using EPC
Definition at line 169 of file lte-test-cell-selection.h.
Referenced by DoRun().
|
private |
whether the LTE is configured to use ideal RRC
Definition at line 170 of file lte-test-cell-selection.h.
Referenced by DoRun().
|
private |
The current UE RRC state.
Definition at line 175 of file lte-test-cell-selection.h.
Referenced by LteCellSelectionTestCase(), CheckPoint(), and StateTransitionCallback().
|
private |
UE setup list.
Definition at line 172 of file lte-test-cell-selection.h.
Referenced by LteCellSelectionTestCase(), and DoRun().