From 59276b0d9612ce56ab2ca095ce5f1e334f7c1806 Mon Sep 17 00:00:00 2001 From: ZorazeAli Date: Mon, 4 May 2020 22:32:20 +0200 Subject: [PATCH] lte: Fix tests after config update see merge request !270 --- .../helper/radio-bearer-stats-connector.cc | 20 +++++++++---------- src/lte/helper/radio-bearer-stats-connector.h | 12 +++++++---- src/lte/model/lte-enb-rrc.cc | 2 +- src/lte/model/lte-enb-rrc.h | 5 +++-- src/lte/model/lte-ue-rrc.cc | 2 +- src/lte/model/lte-ue-rrc.h | 5 +++-- src/lte/test/lte-test-link-adaptation.cc | 5 +++-- src/lte/test/lte-test-pathloss-model.cc | 5 +++-- .../test/lte-test-secondary-cell-selection.h | 10 ++++++++++ src/lte/test/lte-test-ue-measurements.cc | 4 ++-- src/lte/wscript | 2 +- 11 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/lte/helper/radio-bearer-stats-connector.cc b/src/lte/helper/radio-bearer-stats-connector.cc index 34ae067c5..6201749f3 100644 --- a/src/lte/helper/radio-bearer-stats-connector.cc +++ b/src/lte/helper/radio-bearer-stats-connector.cc @@ -189,10 +189,10 @@ RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe (RadioBearerStatsConne } void -RadioBearerStatsConnector::CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) +RadioBearerStatsConnector::CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType) { - NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid); - c->ConnectTracesDrbEnb (context, imsi, cellId, rnti, lcid); + NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid << rlcType); + c->ConnectTracesDrbEnb (context, imsi, cellId, rnti, lcid, rlcType); } void @@ -203,10 +203,10 @@ RadioBearerStatsConnector::CreatedSrb1Ue (RadioBearerStatsConnector* c, std::str } void -RadioBearerStatsConnector::CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) +RadioBearerStatsConnector::CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType) { - NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid); - c->ConnectTracesDrbUe (context, imsi, cellId, rnti, lcid); + NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid << rlcType); + c->ConnectTracesDrbUe (context, imsi, cellId, rnti, lcid, rlcType); } void @@ -285,7 +285,7 @@ RadioBearerStatsConnector::ConnectTracesSrb1 (std::string context, uint64_t imsi } void -RadioBearerStatsConnector::ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) +RadioBearerStatsConnector::ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType) { NS_LOG_FUNCTION (this << context << imsi << cellId << rnti << (uint16_t)lcid); NS_LOG_LOGIC ("expected context should match /NodeList/*/DeviceList/*/LteEnbRrc/"); @@ -303,7 +303,7 @@ RadioBearerStatsConnector::ConnectTracesDrbEnb (std::string context, uint64_t im Config::Connect (basePath + "/LteRlc/RxPDU", MakeBoundCallback (&UlRxPduCallback, arg)); } - if (m_pdcpStats) + if (m_pdcpStats && rlcType != "ns3::LteRlcSm") { Ptr arg = Create (); arg->imsi = imsi; @@ -317,7 +317,7 @@ RadioBearerStatsConnector::ConnectTracesDrbEnb (std::string context, uint64_t im } void -RadioBearerStatsConnector::ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) +RadioBearerStatsConnector::ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType) { NS_LOG_FUNCTION (this << context << imsi << cellId << rnti << (uint16_t)lcid); NS_LOG_LOGIC ("expected context should match /NodeList/*/DeviceList/*/LteUeRrc/"); @@ -335,7 +335,7 @@ RadioBearerStatsConnector::ConnectTracesDrbUe (std::string context, uint64_t ims Config::Connect (basePath + "/LteRlc/RxPDU", MakeBoundCallback (&DlRxPduCallback, arg)); } - if (m_pdcpStats) + if (m_pdcpStats && rlcType != "ns3::LteRlcSm") { Ptr arg = Create (); arg->imsi = imsi; diff --git a/src/lte/helper/radio-bearer-stats-connector.h b/src/lte/helper/radio-bearer-stats-connector.h index 2a639f755..70b11f8c2 100644 --- a/src/lte/helper/radio-bearer-stats-connector.h +++ b/src/lte/helper/radio-bearer-stats-connector.h @@ -117,8 +117,9 @@ public: * \param cellid * \param rnti * \param lcid + * \param rlcType */ - static void CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid); + static void CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid, std::string rlcType); /** * Function hooked to DrbCreated trace source at UE RRC, @@ -130,8 +131,9 @@ public: * \param cellid * \param rnti * \param lcid + * \param rlcType */ - static void CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid); + static void CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid, std::string rlcType); /** * Disconnects all trace sources at eNB to RLC and PDCP calculators. @@ -188,8 +190,9 @@ private: * \param cellId * \param rnti * \param lcid + * \param rlcType */ - void ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid); + void ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType); /** * Connects DRB trace sources at UE to RLC and PDCP calculators @@ -198,8 +201,9 @@ private: * \param cellId * \param rnti * \param lcid + * \param rlcType */ - void ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid); + void ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid, std::string rlcType); Ptr m_rlcStats; //!< Calculator for RLC Statistics Ptr m_pdcpStats; //!< Calculator for PDCP Statistics diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index 23ed0de3f..739ef4bdd 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -444,7 +444,7 @@ UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gt drbInfo->m_pdcp = pdcp; } - m_drbCreatedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, lcid); + m_drbCreatedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, lcid, rlcTypeId.GetName ()); std::vector lcOnCcMapping = m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer (bearer, bearerId, m_rnti, lcid, m_rrc->GetLogicalChannelGroup (bearer), rlc->GetLteMacSapUser ()); // LteEnbCmacSapProvider::LcInfo lcinfo; diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index c379484c3..d96577022 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -559,9 +559,10 @@ private: /** * The `DrbCreated` trace source. Fired when DRB is created, i.e. * the RLC and PDCP entities are created for one logical channel. - * Exporting IMSI, cell ID, RNTI, and LCID + * Exporting IMSI, cell ID, RNTI, LCID, and the TypeId of the RLC + * entity. */ - TracedCallback m_drbCreatedTrace; + TracedCallback m_drbCreatedTrace; uint16_t m_sourceX2apId; ///< source X2 ap ID uint16_t m_targetX2apId; ///< target X2 ap ID diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index 450de8495..40885648d 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -1526,7 +1526,7 @@ LteUeRrc::ApplyRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedic m_drbMap.insert (std::pair > (dtamIt->drbIdentity, drbInfo)); - m_drbCreatedTrace (m_imsi, m_cellId, m_rnti, dtamIt->drbIdentity); + m_drbCreatedTrace (m_imsi, m_cellId, m_rnti, dtamIt->drbIdentity, rlcTypeId.GetName ()); struct LteUeCmacSapProvider::LogicalChannelConfig lcConfig; diff --git a/src/lte/model/lte-ue-rrc.h b/src/lte/model/lte-ue-rrc.h index b58b65239..bb510d6e8 100644 --- a/src/lte/model/lte-ue-rrc.h +++ b/src/lte/model/lte-ue-rrc.h @@ -917,9 +917,10 @@ private: /** * The `DrbCreated` trace source. Fired when DRB is created, i.e. * the RLC and PDCP entities are created for one logical channel. - * Exporting IMSI, cell ID, RNTI, and LCID + * Exporting IMSI, cell ID, RNTI, LCID, and the TypeId of the RLC + * entity. */ - TracedCallback m_drbCreatedTrace; + TracedCallback m_drbCreatedTrace; /** * The 'PhySyncDetection' trace source. Fired when UE RRC * receives in-sync or out-of-sync indications from UE PHY diff --git a/src/lte/test/lte-test-link-adaptation.cc b/src/lte/test/lte-test-link-adaptation.cc index f5d2546fa..196a302ca 100644 --- a/src/lte/test/lte-test-link-adaptation.cc +++ b/src/lte/test/lte-test-link-adaptation.cc @@ -170,8 +170,6 @@ LteLinkAdaptationTestCase::DoRun (void) Ptr lteHelper = CreateObject (); // lteHelper->EnableLogComponents (); - lteHelper->EnableMacTraces (); - lteHelper->EnableRlcTraces (); lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::ConstantSpectrumPropagationLossModel")); NS_LOG_INFO ("SNR = " << m_snrDb << " LOSS = " << m_loss); lteHelper->SetPathlossModelAttribute ("Loss", DoubleValue (m_loss)); @@ -214,6 +212,9 @@ LteLinkAdaptationTestCase::DoRun (void) Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling", MakeBoundCallback (&LteTestDlSchedulingCallback, this)); + lteHelper->EnableMacTraces (); + lteHelper->EnableRlcTraces (); + Simulator::Stop (Seconds (0.040)); Simulator::Run (); diff --git a/src/lte/test/lte-test-pathloss-model.cc b/src/lte/test/lte-test-pathloss-model.cc index b3b67bb92..aa47f1d9e 100644 --- a/src/lte/test/lte-test-pathloss-model.cc +++ b/src/lte/test/lte-test-pathloss-model.cc @@ -201,8 +201,6 @@ LtePathlossModelSystemTestCase::DoRun (void) Ptr lteHelper = CreateObject (); // lteHelper->EnableLogComponents (); - lteHelper->EnableMacTraces (); - lteHelper->EnableRlcTraces (); lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel")); // set frequency. This is important because it changes the behavior of the path loss model @@ -270,6 +268,9 @@ LtePathlossModelSystemTestCase::DoRun (void) // Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling", // MakeBoundCallback (&LteTestPathlossDlSchedCallback, this)); + + lteHelper->EnableMacTraces (); + lteHelper->EnableRlcTraces (); Simulator::Stop (Seconds (0.035)); Simulator::Run (); diff --git a/src/lte/test/lte-test-secondary-cell-selection.h b/src/lte/test/lte-test-secondary-cell-selection.h index 63898ff91..74f55c05c 100644 --- a/src/lte/test/lte-test-secondary-cell-selection.h +++ b/src/lte/test/lte-test-secondary-cell-selection.h @@ -32,6 +32,12 @@ using namespace ns3; /** + * \ingroup lte + * + * This test is currently excluded from test.py (see LTE module wscript). + * It depends on the code, which is not yet merged fully. + * \sa https://www.nsnam.org/wiki/GSOC2017Lte#Project_summary + * * \brief Test suite for executing the secondary cell selection test cases. * * \sa ns3::LteSecondaryCellSelectionTestCase @@ -48,6 +54,10 @@ public: /** * \ingroup lte * + * This test is currently excluded from test.py (see LTE module wscript). + * It depends on the code, which is not yet merged fully. + * \sa https://www.nsnam.org/wiki/GSOC2017Lte#Project_summary + * * \brief Testing the initial cell selection procedure by UE at IDLE state in * the beginning of simulation with multiple component carriers. */ diff --git a/src/lte/test/lte-test-ue-measurements.cc b/src/lte/test/lte-test-ue-measurements.cc index 02ce2d30a..e5b60ed1d 100644 --- a/src/lte/test/lte-test-ue-measurements.cc +++ b/src/lte/test/lte-test-ue-measurements.cc @@ -198,12 +198,12 @@ LteUeMeasurementsTestCase::DoRun (void) lteHelper->ActivateDataRadioBearer (ueDevs2, bearer); - Config::Connect ("/NodeList/2/DeviceList/0/LteUePhy/ReportUeMeasurements", + Config::Connect ("/NodeList/2/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements", MakeBoundCallback (&ReportUeMeasurementsCallback, this)); Config::Connect ("/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport", MakeBoundCallback (&RecvMeasurementReportCallback, this)); - Config::Connect ("/NodeList/3/DeviceList/0/LteUePhy/ReportUeMeasurements", + Config::Connect ("/NodeList/3/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements", MakeBoundCallback (&ReportUeMeasurementsCallback, this)); Config::Connect ("/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport", MakeBoundCallback (&RecvMeasurementReportCallback, this)); diff --git a/src/lte/wscript b/src/lte/wscript index 19b88811b..882616995 100644 --- a/src/lte/wscript +++ b/src/lte/wscript @@ -180,7 +180,7 @@ def build(bld): 'test/test-asn1-encoding.cc', 'test/lte-test-ue-measurements.cc', 'test/lte-test-cell-selection.cc', - 'test/lte-test-secondary-cell-selection.cc', + #'test/lte-test-secondary-cell-selection.cc', 'test/test-lte-handover-delay.cc', 'test/test-lte-handover-target.cc', 'test/lte-test-deactivate-bearer.cc',