OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2014 ResiliNets, ITTC, University of Kansas | 3 * Copyright (c) 2014 ResiliNets, ITTC, University of Kansas |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 val = (val * invsqrt) >> (32 - 2 + 1); | 46 val = (val * invsqrt) >> (32 - 2 + 1); |
47 return (val >> REC_INV_SQRT_SHIFT_ns3); | 47 return (val >> REC_INV_SQRT_SHIFT_ns3); |
48 } | 48 } |
49 | 49 |
50 static uint32_t _reciprocal_scale (uint32_t val, uint32_t ep_ro) | 50 static uint32_t _reciprocal_scale (uint32_t val, uint32_t ep_ro) |
51 { | 51 { |
52 return (uint32_t)(((uint64_t)val * ep_ro) >> 32); | 52 return (uint32_t)(((uint64_t)val * ep_ro) >> 32); |
53 } | 53 } |
54 // End Linux borrow | 54 // End Linux borrow |
55 | 55 |
56 | 56 /** |
| 57 * \ingroup traffic-control-test |
| 58 * \ingroup tests |
| 59 * |
| 60 * \brief Codel Queue Disc Test Item |
| 61 */ |
57 class CodelQueueDiscTestItem : public QueueDiscItem { | 62 class CodelQueueDiscTestItem : public QueueDiscItem { |
58 public: | 63 public: |
| 64 /** |
| 65 * Constructor |
| 66 * |
| 67 * \param p packet |
| 68 * \param addr address |
| 69 * \param protocol |
| 70 */ |
59 CodelQueueDiscTestItem (Ptr<Packet> p, const Address & addr, uint16_t protocol
); | 71 CodelQueueDiscTestItem (Ptr<Packet> p, const Address & addr, uint16_t protocol
); |
60 virtual ~CodelQueueDiscTestItem (); | 72 virtual ~CodelQueueDiscTestItem (); |
61 virtual void AddHeader (void); | 73 virtual void AddHeader (void); |
62 virtual bool Mark(void); | 74 virtual bool Mark(void); |
63 | 75 |
64 private: | 76 private: |
65 CodelQueueDiscTestItem (); | 77 CodelQueueDiscTestItem (); |
| 78 /// type conversion operator |
66 CodelQueueDiscTestItem (const CodelQueueDiscTestItem &); | 79 CodelQueueDiscTestItem (const CodelQueueDiscTestItem &); |
| 80 /// assignment operator |
67 CodelQueueDiscTestItem &operator = (const CodelQueueDiscTestItem &); | 81 CodelQueueDiscTestItem &operator = (const CodelQueueDiscTestItem &); |
68 }; | 82 }; |
69 | 83 |
70 CodelQueueDiscTestItem::CodelQueueDiscTestItem (Ptr<Packet> p, const Address & a
ddr, uint16_t protocol) | 84 CodelQueueDiscTestItem::CodelQueueDiscTestItem (Ptr<Packet> p, const Address & a
ddr, uint16_t protocol) |
71 : QueueDiscItem (p, addr, protocol) | 85 : QueueDiscItem (p, addr, protocol) |
72 { | 86 { |
73 } | 87 } |
74 | 88 |
75 CodelQueueDiscTestItem::~CodelQueueDiscTestItem () | 89 CodelQueueDiscTestItem::~CodelQueueDiscTestItem () |
76 { | 90 { |
77 } | 91 } |
78 | 92 |
79 void | 93 void |
80 CodelQueueDiscTestItem::AddHeader (void) | 94 CodelQueueDiscTestItem::AddHeader (void) |
81 { | 95 { |
82 } | 96 } |
83 | 97 |
84 bool | 98 bool |
85 CodelQueueDiscTestItem::Mark (void) | 99 CodelQueueDiscTestItem::Mark (void) |
86 { | 100 { |
87 return false; | 101 return false; |
88 } | 102 } |
89 | 103 |
90 // Test 1: simple enqueue/dequeue with no drops | 104 /** |
| 105 * \ingroup traffic-control-test |
| 106 * \ingroup tests |
| 107 * |
| 108 * \brief Test 1: simple enqueue/dequeue with no drops |
| 109 */ |
91 class CoDelQueueDiscBasicEnqueueDequeue : public TestCase | 110 class CoDelQueueDiscBasicEnqueueDequeue : public TestCase |
92 { | 111 { |
93 public: | 112 public: |
| 113 /** |
| 114 * Constructor |
| 115 * |
| 116 * \param mode the mode |
| 117 */ |
94 CoDelQueueDiscBasicEnqueueDequeue (std::string mode); | 118 CoDelQueueDiscBasicEnqueueDequeue (std::string mode); |
95 virtual void DoRun (void); | 119 virtual void DoRun (void); |
96 | 120 |
| 121 /** |
| 122 * Queue test size function |
| 123 * \param queue Ptr<CoDelQueueDisc> |
| 124 * \param size the size |
| 125 * \param error the error string |
| 126 */ |
97 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) | 127 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) |
98 { | 128 { |
99 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) | 129 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) |
100 { | 130 { |
101 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); | 131 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); |
102 } | 132 } |
103 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) | 133 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) |
104 { | 134 { |
105 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); | 135 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); |
106 } | 136 } |
107 | 137 |
108 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); | 138 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); |
109 } | 139 } |
110 | 140 |
111 private: | 141 private: |
112 StringValue m_mode; | 142 StringValue m_mode; ///< mode |
113 }; | 143 }; |
114 | 144 |
115 CoDelQueueDiscBasicEnqueueDequeue::CoDelQueueDiscBasicEnqueueDequeue (std::strin
g mode) | 145 CoDelQueueDiscBasicEnqueueDequeue::CoDelQueueDiscBasicEnqueueDequeue (std::strin
g mode) |
116 : TestCase ("Basic enqueue and dequeue operations, and attribute setting for "
+ mode) | 146 : TestCase ("Basic enqueue and dequeue operations, and attribute setting for "
+ mode) |
117 { | 147 { |
118 m_mode = StringValue (mode); | 148 m_mode = StringValue (mode); |
119 } | 149 } |
120 | 150 |
121 void | 151 void |
122 CoDelQueueDiscBasicEnqueueDequeue::DoRun (void) | 152 CoDelQueueDiscBasicEnqueueDequeue::DoRun (void) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 NS_TEST_EXPECT_MSG_EQ ((item != 0), true, "I want to remove the last packet"); | 236 NS_TEST_EXPECT_MSG_EQ ((item != 0), true, "I want to remove the last packet"); |
207 QueueTestSize (queue, 0 * modeSize, "There should be zero packet in queue"); | 237 QueueTestSize (queue, 0 * modeSize, "There should be zero packet in queue"); |
208 NS_TEST_EXPECT_MSG_EQ (item->GetPacket ()->GetUid (), p6->GetUid (), "Was this
the sixth packet ?"); | 238 NS_TEST_EXPECT_MSG_EQ (item->GetPacket ()->GetUid (), p6->GetUid (), "Was this
the sixth packet ?"); |
209 | 239 |
210 item = queue->Dequeue (); | 240 item = queue->Dequeue (); |
211 NS_TEST_EXPECT_MSG_EQ ((item == 0), true, "There are really no packets in queu
e"); | 241 NS_TEST_EXPECT_MSG_EQ ((item == 0), true, "There are really no packets in queu
e"); |
212 | 242 |
213 NS_TEST_EXPECT_MSG_EQ (queue->GetDropCount (), 0, "There should be no packet d
rops according to CoDel algorithm"); | 243 NS_TEST_EXPECT_MSG_EQ (queue->GetDropCount (), 0, "There should be no packet d
rops according to CoDel algorithm"); |
214 } | 244 } |
215 | 245 |
216 // Test 2: enqueue with drops due to queue overflow | 246 /** |
| 247 * \ingroup traffic-control-test |
| 248 * \ingroup tests |
| 249 * |
| 250 * \brief Test 2: enqueue with drops due to queue overflow |
| 251 */ |
217 class CoDelQueueDiscBasicOverflow : public TestCase | 252 class CoDelQueueDiscBasicOverflow : public TestCase |
218 { | 253 { |
219 public: | 254 public: |
| 255 /** |
| 256 * Constructor |
| 257 * |
| 258 * \param mode the mode |
| 259 */ |
220 CoDelQueueDiscBasicOverflow (std::string mode); | 260 CoDelQueueDiscBasicOverflow (std::string mode); |
221 virtual void DoRun (void); | 261 virtual void DoRun (void); |
222 | 262 |
| 263 /** |
| 264 * Queue test size function |
| 265 * \param queue Ptr<CoDelQueueDisc> |
| 266 * \param size the size |
| 267 * \param error the error string |
| 268 */ |
223 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) | 269 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) |
224 { | 270 { |
225 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) | 271 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) |
226 { | 272 { |
227 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); | 273 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); |
228 } | 274 } |
229 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) | 275 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) |
230 { | 276 { |
231 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); | 277 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); |
232 } | 278 } |
233 | 279 |
234 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); | 280 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); |
235 } | 281 } |
236 | 282 |
237 private: | 283 private: |
| 284 /** |
| 285 * Enqueue function |
| 286 * \param queue Ptr<CoDelQueueDisc> |
| 287 * \param size the size |
| 288 * \param nPkt the number of packets |
| 289 */ |
238 void Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size, uint32_t nPkt); | 290 void Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size, uint32_t nPkt); |
239 StringValue m_mode; | 291 StringValue m_mode; ///< mode |
240 }; | 292 }; |
241 | 293 |
242 CoDelQueueDiscBasicOverflow::CoDelQueueDiscBasicOverflow (std::string mode) | 294 CoDelQueueDiscBasicOverflow::CoDelQueueDiscBasicOverflow (std::string mode) |
243 : TestCase ("Basic overflow behavior for " + mode) | 295 : TestCase ("Basic overflow behavior for " + mode) |
244 { | 296 { |
245 m_mode = StringValue (mode); | 297 m_mode = StringValue (mode); |
246 } | 298 } |
247 | 299 |
248 void | 300 void |
249 CoDelQueueDiscBasicOverflow::DoRun (void) | 301 CoDelQueueDiscBasicOverflow::DoRun (void) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void | 344 void |
293 CoDelQueueDiscBasicOverflow::Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size,
uint32_t nPkt) | 345 CoDelQueueDiscBasicOverflow::Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size,
uint32_t nPkt) |
294 { | 346 { |
295 Address dest; | 347 Address dest; |
296 for (uint32_t i = 0; i < nPkt; i++) | 348 for (uint32_t i = 0; i < nPkt; i++) |
297 { | 349 { |
298 queue->Enqueue (Create<CodelQueueDiscTestItem> (Create<Packet> (size), des
t, 0)); | 350 queue->Enqueue (Create<CodelQueueDiscTestItem> (Create<Packet> (size), des
t, 0)); |
299 } | 351 } |
300 } | 352 } |
301 | 353 |
302 // Test 3: NewtonStep unit test | 354 /** |
303 // test against explicit port of Linux implementation | 355 * \ingroup traffic-control-test |
| 356 * \ingroup tests |
| 357 * |
| 358 * \brief Test 3: NewtonStep unit test - test against explicit port of Linux imp
lementation |
| 359 */ |
304 class CoDelQueueDiscNewtonStepTest : public TestCase | 360 class CoDelQueueDiscNewtonStepTest : public TestCase |
305 { | 361 { |
306 public: | 362 public: |
307 CoDelQueueDiscNewtonStepTest (); | 363 CoDelQueueDiscNewtonStepTest (); |
308 virtual void DoRun (void); | 364 virtual void DoRun (void); |
309 }; | 365 }; |
310 | 366 |
311 CoDelQueueDiscNewtonStepTest::CoDelQueueDiscNewtonStepTest () | 367 CoDelQueueDiscNewtonStepTest::CoDelQueueDiscNewtonStepTest () |
312 : TestCase ("NewtonStep arithmetic unit test") | 368 : TestCase ("NewtonStep arithmetic unit test") |
313 { | 369 { |
(...skipping 18 matching lines...) Expand all Loading... |
332 count = 4; | 388 count = 4; |
333 recInvSqrt = 36864; | 389 recInvSqrt = 36864; |
334 queue->m_count = count; | 390 queue->m_count = count; |
335 queue->m_recInvSqrt = recInvSqrt; | 391 queue->m_recInvSqrt = recInvSqrt; |
336 queue->NewtonStep (); | 392 queue->NewtonStep (); |
337 // Test that ns-3 value is exactly the same as the Linux value | 393 // Test that ns-3 value is exactly the same as the Linux value |
338 NS_TEST_ASSERT_MSG_EQ (_codel_Newton_step (count, recInvSqrt), queue->m_recInv
Sqrt, | 394 NS_TEST_ASSERT_MSG_EQ (_codel_Newton_step (count, recInvSqrt), queue->m_recInv
Sqrt, |
339 "ns-3 NewtonStep() fails to match Linux equivalent"); | 395 "ns-3 NewtonStep() fails to match Linux equivalent"); |
340 } | 396 } |
341 | 397 |
342 // Test 4: ControlLaw unit test | 398 /** |
343 // test against explicit port of Linux implementation | 399 * \ingroup traffic-control-test |
| 400 * \ingroup tests |
| 401 * |
| 402 * \brief Test 4: ControlLaw unit test - test against explicit port of Linux imp
lementation |
| 403 */ |
344 class CoDelQueueDiscControlLawTest : public TestCase | 404 class CoDelQueueDiscControlLawTest : public TestCase |
345 { | 405 { |
346 public: | 406 public: |
347 CoDelQueueDiscControlLawTest (); | 407 CoDelQueueDiscControlLawTest (); |
348 virtual void DoRun (void); | 408 virtual void DoRun (void); |
| 409 /** |
| 410 * Codel control law function |
| 411 * \param queue Ptr<CoDelQueueDisc> |
| 412 * \param t |
| 413 * \returns the codel control law |
| 414 */ |
349 uint32_t _codel_control_law (Ptr<CoDelQueueDisc> queue, uint32_t t); | 415 uint32_t _codel_control_law (Ptr<CoDelQueueDisc> queue, uint32_t t); |
350 }; | 416 }; |
351 | 417 |
352 CoDelQueueDiscControlLawTest::CoDelQueueDiscControlLawTest () | 418 CoDelQueueDiscControlLawTest::CoDelQueueDiscControlLawTest () |
353 : TestCase ("ControlLaw arithmetic unit test") | 419 : TestCase ("ControlLaw arithmetic unit test") |
354 { | 420 { |
355 } | 421 } |
356 | 422 |
357 // The following code borrowed from Linux codel.h, | 423 // The following code borrowed from Linux codel.h, |
358 // except the addition of queue parameter | 424 // except the addition of queue parameter |
(...skipping 19 matching lines...) Expand all Loading... |
378 { | 444 { |
379 uint32_t ns3Result = queue->ControlLaw (dropNextTestVals[i]); | 445 uint32_t ns3Result = queue->ControlLaw (dropNextTestVals[i]); |
380 uint32_t upperBound = ns3Result + 0.02 * ns3Result; | 446 uint32_t upperBound = ns3Result + 0.02 * ns3Result; |
381 uint32_t lowerBound = ns3Result - 0.02 * ns3Result; | 447 uint32_t lowerBound = ns3Result - 0.02 * ns3Result; |
382 uint32_t linuxResult = _codel_control_law (queue, dropNextTestVals[i]); | 448 uint32_t linuxResult = _codel_control_law (queue, dropNextTestVals[i]); |
383 NS_TEST_EXPECT_MSG_EQ ((lowerBound < linuxResult || linuxResult < upperBou
nd), true, | 449 NS_TEST_EXPECT_MSG_EQ ((lowerBound < linuxResult || linuxResult < upperBou
nd), true, |
384 "Linux result should stay within 2% of ns-3 result"
); | 450 "Linux result should stay within 2% of ns-3 result"
); |
385 } | 451 } |
386 } | 452 } |
387 | 453 |
388 // Test 5: enqueue/dequeue with drops according to CoDel algorithm | 454 /** |
| 455 * \ingroup traffic-control-test |
| 456 * \ingroup tests |
| 457 * |
| 458 * \brief Test 5: enqueue/dequeue with drops according to CoDel algorithm |
| 459 */ |
389 class CoDelQueueDiscBasicDrop : public TestCase | 460 class CoDelQueueDiscBasicDrop : public TestCase |
390 { | 461 { |
391 public: | 462 public: |
| 463 /** |
| 464 * Constructor |
| 465 * |
| 466 * \param mode the mode |
| 467 */ |
392 CoDelQueueDiscBasicDrop (std::string mode); | 468 CoDelQueueDiscBasicDrop (std::string mode); |
393 virtual void DoRun (void); | 469 virtual void DoRun (void); |
394 | 470 |
| 471 /** |
| 472 * Queue test size function |
| 473 * \param queue Ptr<CoDelQueueDisc> |
| 474 * \param size the size |
| 475 * \param error the error string |
| 476 */ |
395 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) | 477 void QueueTestSize (Ptr<CoDelQueueDisc> queue, uint32_t size, std::string erro
r) |
396 { | 478 { |
397 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) | 479 if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) |
398 { | 480 { |
399 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); | 481 NS_TEST_EXPECT_MSG_EQ (queue->GetNBytes (), size, error); |
400 } | 482 } |
401 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) | 483 else if (queue->GetMode () == Queue::QUEUE_MODE_PACKETS) |
402 { | 484 { |
403 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); | 485 NS_TEST_EXPECT_MSG_EQ (queue->GetNPackets (), size, error); |
404 } | 486 } |
405 | 487 |
406 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); | 488 NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), size, error); |
407 } | 489 } |
408 | 490 |
409 private: | 491 private: |
| 492 /** |
| 493 * Enqueue function |
| 494 * \param queue Ptr<CoDelQueueDisc> |
| 495 * \param size the size |
| 496 * \param nPkt the number of packets |
| 497 */ |
410 void Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size, uint32_t nPkt); | 498 void Enqueue (Ptr<CoDelQueueDisc> queue, uint32_t size, uint32_t nPkt); |
| 499 /** Dequeue function |
| 500 * \param queue Ptr<CoDelQueueDisc> |
| 501 * \param modeSize the mode size |
| 502 */ |
411 void Dequeue (Ptr<CoDelQueueDisc> queue, uint32_t modeSize); | 503 void Dequeue (Ptr<CoDelQueueDisc> queue, uint32_t modeSize); |
| 504 /** |
| 505 * Drop next tracer function |
| 506 * \param oldVal the old value |
| 507 * \param newVal the new value |
| 508 */ |
412 void DropNextTracer (uint32_t oldVal, uint32_t newVal); | 509 void DropNextTracer (uint32_t oldVal, uint32_t newVal); |
413 StringValue m_mode; | 510 StringValue m_mode; ///< mode |
414 uint32_t m_dropNextCount; //count the number of times m_dropNext is recalcu
lated | 511 uint32_t m_dropNextCount; ///< count the number of times m_dropNext is reca
lculated |
415 }; | 512 }; |
416 | 513 |
417 CoDelQueueDiscBasicDrop::CoDelQueueDiscBasicDrop (std::string mode) | 514 CoDelQueueDiscBasicDrop::CoDelQueueDiscBasicDrop (std::string mode) |
418 : TestCase ("Basic drop operations for " + mode) | 515 : TestCase ("Basic drop operations for " + mode) |
419 { | 516 { |
420 m_mode = StringValue (mode); | 517 m_mode = StringValue (mode); |
421 m_dropNextCount = 0; | 518 m_dropNextCount = 0; |
422 } | 519 } |
423 | 520 |
424 void | 521 void |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 currentDropCount = queue->GetDropCount (); | 633 currentDropCount = queue->GetDropCount (); |
537 QueueTestSize (queue, initialQSize - (m_dropNextCount + 1) * modeS
ize, "We are in dropping state." | 634 QueueTestSize (queue, initialQSize - (m_dropNextCount + 1) * modeS
ize, "We are in dropping state." |
538 "It's time for next drop." | 635 "It's time for next drop." |
539 "The number of packets dequeued equals to t
he number of times m_dropNext is updated plus initial dequeue"); | 636 "The number of packets dequeued equals to t
he number of times m_dropNext is updated plus initial dequeue"); |
540 NS_TEST_EXPECT_MSG_EQ (currentDropCount, 1 + m_dropNextCount, "The
number of drops equals to the number of times m_dropNext is updated plus 1 from
last dequeue"); | 637 NS_TEST_EXPECT_MSG_EQ (currentDropCount, 1 + m_dropNextCount, "The
number of drops equals to the number of times m_dropNext is updated plus 1 from
last dequeue"); |
541 } | 638 } |
542 } | 639 } |
543 } | 640 } |
544 } | 641 } |
545 | 642 |
| 643 /** |
| 644 * \ingroup traffic-control-test |
| 645 * \ingroup tests |
| 646 * |
| 647 * \brief Co Del Queue Disc Test Suite |
| 648 */ |
546 static class CoDelQueueDiscTestSuite : public TestSuite | 649 static class CoDelQueueDiscTestSuite : public TestSuite |
547 { | 650 { |
548 public: | 651 public: |
549 CoDelQueueDiscTestSuite () | 652 CoDelQueueDiscTestSuite () |
550 : TestSuite ("codel-queue-disc", UNIT) | 653 : TestSuite ("codel-queue-disc", UNIT) |
551 { | 654 { |
552 // Test 1: simple enqueue/dequeue with no drops | 655 // Test 1: simple enqueue/dequeue with no drops |
553 AddTestCase (new CoDelQueueDiscBasicEnqueueDequeue ("QUEUE_MODE_PACKETS"), T
estCase::QUICK); | 656 AddTestCase (new CoDelQueueDiscBasicEnqueueDequeue ("QUEUE_MODE_PACKETS"), T
estCase::QUICK); |
554 AddTestCase (new CoDelQueueDiscBasicEnqueueDequeue ("QUEUE_MODE_BYTES"), Tes
tCase::QUICK); | 657 AddTestCase (new CoDelQueueDiscBasicEnqueueDequeue ("QUEUE_MODE_BYTES"), Tes
tCase::QUICK); |
555 // Test 2: enqueue with drops due to queue overflow | 658 // Test 2: enqueue with drops due to queue overflow |
556 AddTestCase (new CoDelQueueDiscBasicOverflow ("QUEUE_MODE_PACKETS"), TestCas
e::QUICK); | 659 AddTestCase (new CoDelQueueDiscBasicOverflow ("QUEUE_MODE_PACKETS"), TestCas
e::QUICK); |
557 AddTestCase (new CoDelQueueDiscBasicOverflow ("QUEUE_MODE_BYTES"), TestCase:
:QUICK); | 660 AddTestCase (new CoDelQueueDiscBasicOverflow ("QUEUE_MODE_BYTES"), TestCase:
:QUICK); |
558 // Test 3: test NewtonStep() against explicit port of Linux implementation | 661 // Test 3: test NewtonStep() against explicit port of Linux implementation |
559 AddTestCase (new CoDelQueueDiscNewtonStepTest (), TestCase::QUICK); | 662 AddTestCase (new CoDelQueueDiscNewtonStepTest (), TestCase::QUICK); |
560 // Test 4: test ControlLaw() against explicit port of Linux implementation | 663 // Test 4: test ControlLaw() against explicit port of Linux implementation |
561 AddTestCase (new CoDelQueueDiscControlLawTest (), TestCase::QUICK); | 664 AddTestCase (new CoDelQueueDiscControlLawTest (), TestCase::QUICK); |
562 // Test 5: enqueue/dequeue with drops according to CoDel algorithm | 665 // Test 5: enqueue/dequeue with drops according to CoDel algorithm |
563 AddTestCase (new CoDelQueueDiscBasicDrop ("QUEUE_MODE_PACKETS"), TestCase::Q
UICK); | 666 AddTestCase (new CoDelQueueDiscBasicDrop ("QUEUE_MODE_PACKETS"), TestCase::Q
UICK); |
564 AddTestCase (new CoDelQueueDiscBasicDrop ("QUEUE_MODE_BYTES"), TestCase::QUI
CK); | 667 AddTestCase (new CoDelQueueDiscBasicDrop ("QUEUE_MODE_BYTES"), TestCase::QUI
CK); |
565 } | 668 } |
566 } g_coDelQueueTestSuite; | 669 } g_coDelQueueTestSuite; ///< the test suite |
OLD | NEW |