24 #include "ns3/candidate-queue.h"
25 #include "ns3/global-route-manager-impl.h"
26 #include "ns3/simulator.h"
48 void DoRun()
override;
52 :
TestCase(
"GlobalRouteManagerImplTestCase")
61 for (
int i = 0; i < 100; ++i)
68 for (
int i = 0; i < 100; ++i)
102 lsa0->SetLSType(GlobalRoutingLSA::RouterLSA);
103 lsa0->SetLinkStateId(
"0.0.0.0");
104 lsa0->SetAdvertisingRouter(
"0.0.0.0");
105 lsa0->AddLinkRecord(lr0);
106 lsa0->AddLinkRecord(lr1);
120 lsa1->SetLSType(GlobalRoutingLSA::RouterLSA);
121 lsa1->SetLinkStateId(
"0.0.0.1");
122 lsa1->SetAdvertisingRouter(
"0.0.0.1");
123 lsa1->AddLinkRecord(lr2);
124 lsa1->AddLinkRecord(lr3);
158 lsa2->SetLSType(GlobalRoutingLSA::RouterLSA);
159 lsa2->SetLinkStateId(
"0.0.0.2");
160 lsa2->SetAdvertisingRouter(
"0.0.0.2");
161 lsa2->AddLinkRecord(lr4);
162 lsa2->AddLinkRecord(lr5);
163 lsa2->AddLinkRecord(lr6);
164 lsa2->AddLinkRecord(lr7);
165 lsa2->AddLinkRecord(lr8);
166 lsa2->AddLinkRecord(lr9);
180 lsa3->SetLSType(GlobalRoutingLSA::RouterLSA);
181 lsa3->SetLinkStateId(
"0.0.0.3");
182 lsa3->SetAdvertisingRouter(
"0.0.0.3");
183 lsa3->AddLinkRecord(lr10);
184 lsa3->AddLinkRecord(lr11);
188 srmlsdb->Insert(lsa0->GetLinkStateId(), lsa0);
189 srmlsdb->Insert(lsa1->GetLinkStateId(), lsa1);
190 srmlsdb->Insert(lsa2->GetLinkStateId(), lsa2);
191 srmlsdb->Insert(lsa3->GetLinkStateId(), lsa3);
193 srmlsdb->GetLSA(lsa2->GetLinkStateId()),
194 "The Ipv4Address is not stored as the link state ID");
198 srm->DebugUseLsdb(srmlsdb);
201 srm->DebugSPFCalculate(lsa0->GetLinkStateId());
207 Simulator::Destroy();
232 :
TestSuite(
"global-route-manager-impl", UNIT)
Global Route Manager Test.
GlobalRouteManagerImplTestCase()
void DoRun() override
Implementation to actually run this TestCase.
Global Route Manager TestSuite.
GlobalRouteManagerImplTestSuite()
A Candidate Queue used in routing calculations.
SPFVertex * Pop()
Pop the Shortest Path First Vertex pointer at the top of the queue.
void Push(SPFVertex *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme.
A global router implementation.
The Link State DataBase (LSDB) of the Global Route Manager.
a Link State Advertisement (LSA) for a router, used in global routing.
A single link record for a link state advertisement.
Vertex used in shortest path first (SPF) computations.
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static GlobalRouteManagerImplTestSuite g_globalRoutingManagerImplTestSuite
Static variable for test initialization.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.