20#include "ns3/internet-stack-helper.h"
42 void DoRun()
override;
47 :
TestCase(
"InternetStackHelperTestCase")
59 Ptr<Node> nodeIpv4Only = CreateObject<Node>();
60 Ptr<Node> nodeIpv6Only = CreateObject<Node>();
61 Ptr<Node> nodeIpv46 = CreateObject<Node>();
65 internet.SetIpv4StackInstall(
true);
66 internet.SetIpv6StackInstall(
false);
67 internet.Install(nodeIpv4Only);
69 internet.SetIpv4StackInstall(
false);
70 internet.SetIpv6StackInstall(
true);
71 internet.Install(nodeIpv6Only);
73 internet.SetIpv4StackInstall(
true);
74 internet.SetIpv6StackInstall(
true);
75 internet.Install(nodeIpv46);
80 "IPv4 not found on IPv4-only node (should have been there)");
83 "IPv6 found on IPv4-only node (should not have been there)");
87 "IPv4 found on IPv6-only node (should not have been there)");
90 "IPv6 not found on IPv6-only node (should have been there)");
94 "IPv4 not found on dual stack node (should have been there)");
97 "IPv6 not found on dual stack node (should have been there)");
101 internet.Install(nodeIpv4Only);
104 internet.Install(nodeIpv6Only);
107 internet.Install(nodeIpv46);
111 nodeIpv4Only->GetObject<
Ipv4>(),
113 "IPv4 not found on IPv4-only, now dual stack node (should have been there)");
115 nodeIpv4Only->GetObject<
Ipv6>(),
117 "IPv6 not found on IPv4-only, now dual stack node (should have been there)");
120 nodeIpv6Only->GetObject<
Ipv4>(),
122 "IPv4 not found on IPv6-only, now dual stack node (should have been there)");
124 nodeIpv6Only->GetObject<
Ipv6>(),
126 "IPv6 not found on IPv6-only, now dual stack node (should have been there)");
130 "IPv4 not found on dual stack node (should have been there)");
133 "IPv6 not found on dual stack node (should have been there)");
InternetStackHelper Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
InternetStackHelperTestCase()
void DoRun() override
Implementation to actually run this TestCase.
InternetStackHelper TestSuite.
InternetStackHelperTestSuite()
aggregate IP/TCP/UDP functionality to existing Nodes.
Access to the IPv4 forwarding table, interfaces, and configuration.
Access to the IPv6 forwarding table, interfaces, and configuration.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
static InternetStackHelperTestSuite g_internetStackHelperTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.