29 #include "../model/satellite-control-message.h"
30 #include "../model/satellite-queue.h"
31 #include "../model/satellite-request-manager.h"
32 #include "../utils/satellite-env-variables.h"
34 #include "ns3/boolean.h"
35 #include "ns3/config.h"
37 #include "ns3/simulator.h"
38 #include "ns3/singleton.h"
61 bool SendControlMsg(Ptr<SatControlMessage> msg,
const Address& dest);
75 bool ControlMsgTxPossible()
const;
78 virtual void DoRun(
void);
87 : TestCase(
"Test satellite request manager.")
99 Singleton<SatEnvVariables>::Get()->DoInitialize();
100 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-rm",
"",
true);
104 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
105 BooleanValue(
false));
106 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
107 BooleanValue(
false));
108 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
109 BooleanValue(
false));
110 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
111 BooleanValue(
false));
112 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
113 BooleanValue(
false));
114 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
115 BooleanValue(
false));
116 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
117 BooleanValue(
false));
118 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
119 BooleanValue(
false));
120 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
121 BooleanValue(
false));
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
123 BooleanValue(
false));
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
125 BooleanValue(
false));
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
127 BooleanValue(
false));
129 Ptr<SatLowerLayerServiceConf> llsConf = CreateObject<SatLowerLayerServiceConf>();
131 Time superFrameDuration(MilliSeconds(100));
134 Ptr<SatNodeInfo> nodeInfo = Create<SatNodeInfo>(SatEnums::NT_UT, 0, Mac48Address::Allocate());
135 Ptr<SatRequestManager> rm = CreateObject<SatRequestManager>();
136 rm->SetNodeInfo(nodeInfo);
137 rm->Initialize(llsConf, superFrameDuration);
145 Callback<SatQueue::QueueStats_t, bool> cb =
147 for (uint8_t rc = 0; rc < llsConf->GetDaServiceCount(); ++rc)
149 rm->AddQueueCallback(rc, cb);
152 Simulator::Stop(Seconds(10));
157 Simulator::Destroy();
159 Singleton<SatEnvVariables>::Get()->DoDispose();
165 if (msg->GetMsgType() == SatControlMsgTag::SAT_CR_CTRL_MSG)
167 Ptr<SatCrMessage> cr = DynamicCast<SatCrMessage>(msg);
170 NS_FATAL_ERROR(
"Dynamic cast to CR message failed!");
211 : TestSuite(
"sat-rm-test", Type::UNIT)
Test case to unit test the UT request manager.
std::vector< Ptr< SatCrMessage > > m_rcvdCapacityRequests
Received CRs.
bool SendControlMsg(Ptr< SatControlMessage > msg, const Address &dest)
Send control message called with a callback from request manager.
virtual ~SatBaseTestCase()
SatQueue::QueueStats_t GetQueueStatistics(bool reset)
Get queue statistics for request manager.
bool ControlMsgTxPossible() const
Check whether a control message transmission is possible.
Test suite for Satellite Request Manager unit test cases.
SatRequestManagerTestSuite()
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatRequestManagerTestSuite satRmTestSuite
QueueStats_t definition for passing queue related statistics to any interested modules.
uint32_t m_volumeOutBytes
double m_outgoingRateKbps
double m_incomingRateKbps
uint32_t m_queueSizeBytes