A Discrete-Event Network Simulator
API
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LteUeMeasurementsPiecewiseTestCase2 Class Reference

Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 240 ms report interval. More...

#include "lte-test-ue-measurements.h"

+ Inheritance diagram for LteUeMeasurementsPiecewiseTestCase2:

Public Member Functions

 LteUeMeasurementsPiecewiseTestCase2 (std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
 Constructor. More...
 
virtual ~LteUeMeasurementsPiecewiseTestCase2 ()
 
void RecvMeasurementReportCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
 Triggers when eNodeB receives measurement report from UE, then perform verification on it. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

virtual void DoRun ()
 Setup the simulation with the intended UE measurement reporting configuration, run it, and connect the RecvMeasurementReportCallback function to the LteUeRrc::RecvMeasurementReport trace source. More...
 
virtual void DoTeardown ()
 Runs at the end of the simulation, verifying that all expected measurement reports have been examined. More...
 
void TeleportFar ()
 Teleport far function. More...
 
void TeleportNear ()
 Teleport near function. More...
 
void TeleportVeryFar ()
 Teleport very far function. More...
 
void TeleportVeryNear ()
 Teleport very near function. More...
 

Private Attributes

LteRrcSap::ReportConfigEutra m_config
 The active report triggering configuration. More...
 
uint8_t m_expectedMeasId
 The measurement identity being tested. More...
 
std::vector< uint8_t > m_expectedRsrp
 The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received. More...
 
std::vector< Timem_expectedTime
 The list of expected time when measurement reports are received by eNodeB. More...
 
std::vector< uint8_t >::iterator m_itExpectedRsrp
 Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation. More...
 
std::vector< Time >::iterator m_itExpectedTime
 Pointer to the element of m_expectedTime which is expected to occur next in the simulation. More...
 
Ptr< MobilityModelm_ueMobility
 the mobility model 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...
 
TestCaseGetParent () 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...
 

Detailed Description

Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 240 ms report interval.

Here is intenisvely test events A1 and A2. A1 event should be triggered when the serving cell becomes better than a given threshold. A2 shall be triggered when the serving cell becomes worse than threshold. A3 event is triggered when the neighbour becomes offset better than the PCell. In this test UE is being transported several times during the simulation duration. Then the test checks if measurement report contains correct RSRP and RSRQ result, than if CQI info is correctly generated, if the reporting occurs at the correct time stamp in the simulation and according to the measurements configuration. It also checks if the reported values of RSRP and RSRQ are equal to expected reference values.

Definition at line 293 of file lte-test-ue-measurements.h.

Constructor & Destructor Documentation

◆ LteUeMeasurementsPiecewiseTestCase2()

LteUeMeasurementsPiecewiseTestCase2::LteUeMeasurementsPiecewiseTestCase2 ( std::string  name,
LteRrcSap::ReportConfigEutra  config,
std::vector< Time expectedTime,
std::vector< uint8_t >  expectedRsrp 
)

Constructor.

Parameters
namethe reference name
configLteRrcSap::ReportConfigEutra
expectedTimethe expected time
expectedRsrpthe expected RSRP

Definition at line 1105 of file lte-test-ue-measurements.cc.

References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_FATAL_ERROR, and NS_LOG_INFO.

◆ ~LteUeMeasurementsPiecewiseTestCase2()

LteUeMeasurementsPiecewiseTestCase2::~LteUeMeasurementsPiecewiseTestCase2 ( )
virtual

Definition at line 1127 of file lte-test-ue-measurements.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoRun()

void LteUeMeasurementsPiecewiseTestCase2::DoRun ( void  )
privatevirtual

◆ DoTeardown()

void LteUeMeasurementsPiecewiseTestCase2::DoTeardown ( void  )
privatevirtual

Runs at the end of the simulation, verifying that all expected measurement reports have been examined.

Reimplemented from ns3::TestCase.

Definition at line 1245 of file lte-test-ue-measurements.cc.

References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_ASSERT, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

◆ RecvMeasurementReportCallback()

void LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti,
LteRrcSap::MeasurementReport  report 
)

Triggers when eNodeB receives measurement report from UE, then perform verification on it.

The trigger is set up beforehand by connecting to the LteUeRrc::RecvMeasurementReport trace source.

Verification consists of checking whether the report carries the right value of RSRP or not, and whether it occurs at the expected time or not.

Parameters
contextthe context
imsithe IMSI
cellIdthe cell ID
rntithe RNTI
reportLteRrcSap::MeasurementReport

Definition at line 1256 of file lte-test-ue-measurements.cc.

References ns3::Time::GetMilliSeconds(), ns3::LteRrcSap::MeasResults::haveMeasResultNeighCells, m_expectedMeasId, m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, ns3::LteRrcSap::MeasResults::measId, ns3::LteRrcSap::MeasResults::measResultListEutra, ns3::LteRrcSap::MeasurementReport::measResults, ns3::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, ns3::LteRrcSap::MeasResults::rsrpResult, and ns3::LteRrcSap::MeasResults::rsrqResult.

Referenced by DoRun().

◆ TeleportFar()

void LteUeMeasurementsPiecewiseTestCase2::TeleportFar ( )
private

Teleport far function.

Definition at line 1346 of file lte-test-ue-measurements.cc.

References m_ueMobility, NS_LOG_FUNCTION, and ns3::MobilityModel::SetPosition().

Referenced by DoRun().

◆ TeleportNear()

void LteUeMeasurementsPiecewiseTestCase2::TeleportNear ( )
private

Teleport near function.

Definition at line 1339 of file lte-test-ue-measurements.cc.

References m_ueMobility, NS_LOG_FUNCTION, and ns3::MobilityModel::SetPosition().

Referenced by DoRun().

◆ TeleportVeryFar()

void LteUeMeasurementsPiecewiseTestCase2::TeleportVeryFar ( )
private

Teleport very far function.

Definition at line 1353 of file lte-test-ue-measurements.cc.

References m_ueMobility, NS_LOG_FUNCTION, and ns3::MobilityModel::SetPosition().

Referenced by DoRun().

◆ TeleportVeryNear()

void LteUeMeasurementsPiecewiseTestCase2::TeleportVeryNear ( )
private

Teleport very near function.

Definition at line 1332 of file lte-test-ue-measurements.cc.

References m_ueMobility, NS_LOG_FUNCTION, and ns3::MobilityModel::SetPosition().

Referenced by DoRun().

Member Data Documentation

◆ m_config

LteRrcSap::ReportConfigEutra LteUeMeasurementsPiecewiseTestCase2::m_config
private

The active report triggering configuration.

Definition at line 358 of file lte-test-ue-measurements.h.

Referenced by DoRun().

◆ m_expectedMeasId

uint8_t LteUeMeasurementsPiecewiseTestCase2::m_expectedMeasId
private

The measurement identity being tested.

Measurement reports with different measurement identity (e.g. from handover algorithm) will be ignored.

Definition at line 389 of file lte-test-ue-measurements.h.

Referenced by DoRun(), and RecvMeasurementReportCallback().

◆ m_expectedRsrp

std::vector<uint8_t> LteUeMeasurementsPiecewiseTestCase2::m_expectedRsrp
private

The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.

Definition at line 370 of file lte-test-ue-measurements.h.

Referenced by DoTeardown(), LteUeMeasurementsPiecewiseTestCase2(), and RecvMeasurementReportCallback().

◆ m_expectedTime

std::vector<Time> LteUeMeasurementsPiecewiseTestCase2::m_expectedTime
private

The list of expected time when measurement reports are received by eNodeB.

Definition at line 364 of file lte-test-ue-measurements.h.

Referenced by DoTeardown(), LteUeMeasurementsPiecewiseTestCase2(), and RecvMeasurementReportCallback().

◆ m_itExpectedRsrp

std::vector<uint8_t>::iterator LteUeMeasurementsPiecewiseTestCase2::m_itExpectedRsrp
private

Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.

Definition at line 382 of file lte-test-ue-measurements.h.

Referenced by DoTeardown(), LteUeMeasurementsPiecewiseTestCase2(), and RecvMeasurementReportCallback().

◆ m_itExpectedTime

std::vector<Time>::iterator LteUeMeasurementsPiecewiseTestCase2::m_itExpectedTime
private

Pointer to the element of m_expectedTime which is expected to occur next in the simulation.

Definition at line 376 of file lte-test-ue-measurements.h.

Referenced by DoTeardown(), LteUeMeasurementsPiecewiseTestCase2(), and RecvMeasurementReportCallback().

◆ m_ueMobility

Ptr<MobilityModel> LteUeMeasurementsPiecewiseTestCase2::m_ueMobility
private

the mobility model

Definition at line 391 of file lte-test-ue-measurements.h.

Referenced by DoRun(), TeleportFar(), TeleportNear(), TeleportVeryFar(), and TeleportVeryNear().


The documentation for this class was generated from the following files: