Trivial (still useful) test of OLSR operation. More...
#include "hello-regression-test.h"
 Inheritance diagram for ns3::olsr::HelloRegressionTest:
 Collaboration diagram for ns3::olsr::HelloRegressionTest:Public Member Functions | |
| HelloRegressionTest () | |
| ~HelloRegressionTest () | |
  Public Member Functions inherited from ns3::TestCase | |
| virtual | ~TestCase () | 
| Destructor.  More... | |
| std::string | GetName (void) const | 
Private Member Functions | |
| void | CreateNodes () | 
| Create & configure test network.  More... | |
| void | DoRun () | 
| Go.  More... | |
| void | ReceivePktProbeA (Ptr< Socket > socket) | 
| Receive raw data on node A.  More... | |
| void | ReceivePktProbeB (Ptr< Socket > socket) | 
| Receive raw data on node B.  More... | |
Private Attributes | |
| uint8_t | m_countA | 
| Packet counter on node A.  More... | |
| uint8_t | m_countB | 
| Packet counter on node B.  More... | |
| Ptr< Ipv4RawSocketImpl > | m_rxSocketA | 
| Receiving socket on node A.  More... | |
| Ptr< Ipv4RawSocketImpl > | m_rxSocketB | 
| Receiving socket on node B.  More... | |
| const Time | m_time | 
| Total simulation time.  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, enum TestDuration duration) | 
| Add an individual child TestCase to this test suite.  More... | |
| TestCase * | GetParent () 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... | |
Trivial (still useful) test of OLSR operation.
This test creates 2 stations with point-to-point link and runs OLSR without any extra traffic. It is expected that only HELLO messages will be sent.
Expected trace (5 seconds):
1 2 |------>| HELLO (empty) src = 10.1.1.1 |<------| HELLO (empty) src = 10.1.1.2 |------>| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1 |<------| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2 |------>| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1 |<------| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2
Definition at line 52 of file hello-regression-test.h.
| ns3::olsr::HelloRegressionTest::HelloRegressionTest | ( | ) | 
Definition at line 45 of file hello-regression-test.cc.
| ns3::olsr::HelloRegressionTest::~HelloRegressionTest | ( | ) | 
Definition at line 51 of file hello-regression-test.cc.
      
  | 
  private | 
Create & configure test network.
Definition at line 71 of file hello-regression-test.cc.
References ns3::Ipv4AddressHelper::Assign(), ns3::OlsrHelper::AssignStreams(), ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), ns3::Object::GetObject(), ns3::InternetStackHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), m_rxSocketA, m_rxSocketB, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_EQ, ns3::UdpL4Protocol::PROT_NUMBER, ReceivePktProbeA(), ReceivePktProbeB(), ns3::Ipv4AddressHelper::SetBase(), ns3::SimpleNetDeviceHelper::SetChannelAttribute(), ns3::SimpleNetDeviceHelper::SetDeviceAttribute(), and ns3::InternetStackHelper::SetRoutingHelper().
Referenced by DoRun().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  privatevirtual | 
Go.
Implements ns3::TestCase.
Definition at line 56 of file hello-regression-test.cc.
References CreateNodes(), ns3::Simulator::Destroy(), m_rxSocketA, m_rxSocketB, m_time, ns3::Simulator::Run(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::Simulator::Stop().
 Here is the call graph for this function:Receive raw data on node A.
Definition at line 107 of file hello-regression-test.cc.
References ns3::olsr::MessageHeader::GetHello(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::Socket::GetRxAvailable(), ns3::Packet::GetSize(), ns3::olsr::MessageHeader::Hello::linkMessages, m_countA, NS_ASSERT, NS_TEST_EXPECT_MSG_EQ, ns3::Socket::Recv(), and ns3::Packet::RemoveHeader().
Referenced by CreateNodes().
 Here is the call graph for this function:
 Here is the caller graph for this function:Receive raw data on node B.
Definition at line 155 of file hello-regression-test.cc.
References ns3::olsr::MessageHeader::GetHello(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::Socket::GetRxAvailable(), ns3::Packet::GetSize(), ns3::olsr::MessageHeader::Hello::linkMessages, m_countA, m_countB, NS_ASSERT, NS_TEST_EXPECT_MSG_EQ, ns3::Socket::Recv(), and ns3::Packet::RemoveHeader().
Referenced by CreateNodes().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  private | 
Packet counter on node A.
Definition at line 68 of file hello-regression-test.h.
Referenced by ReceivePktProbeA(), and ReceivePktProbeB().
      
  | 
  private | 
Packet counter on node B.
Definition at line 74 of file hello-regression-test.h.
Referenced by ReceivePktProbeB().
      
  | 
  private | 
Receiving socket on node A.
Definition at line 70 of file hello-regression-test.h.
Referenced by CreateNodes(), and DoRun().
      
  | 
  private | 
Receiving socket on node B.
Definition at line 76 of file hello-regression-test.h.
Referenced by CreateNodes(), and DoRun().
      
  | 
  private | 
Total simulation time.
Definition at line 59 of file hello-regression-test.h.
Referenced by DoRun().