Update mesh test traces due to random variable perturbations
authorTom Henderson <tomh@tomh.org>
Fri, 24 Aug 2012 19:11:51 -0700
changeset 9010 d6cc76205833
parent 9009 51db70f73dc1
child 9011 01f5cd05ab97
Update mesh test traces due to random variable perturbations
src/mesh/helper/mesh-helper.cc
src/mesh/test/dot11s/hwmp-proactive-regression-test-0-1.pcap
src/mesh/test/dot11s/hwmp-proactive-regression-test-1-1.pcap
src/mesh/test/dot11s/hwmp-proactive-regression-test-2-1.pcap
src/mesh/test/dot11s/hwmp-proactive-regression-test-3-1.pcap
src/mesh/test/dot11s/hwmp-proactive-regression-test-4-1.pcap
src/mesh/test/dot11s/hwmp-proactive-regression.cc
src/mesh/test/dot11s/hwmp-reactive-regression-test-0-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression-test-1-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression-test-2-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression-test-3-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression-test-4-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression-test-5-1.pcap
src/mesh/test/dot11s/hwmp-reactive-regression.cc
src/mesh/test/dot11s/hwmp-simplest-regression-test-0-1.pcap
src/mesh/test/dot11s/hwmp-simplest-regression-test-1-1.pcap
src/mesh/test/dot11s/hwmp-simplest-regression.cc
src/mesh/test/dot11s/hwmp-target-flags-regression-test-0-1.pcap
src/mesh/test/dot11s/hwmp-target-flags-regression-test-1-1.pcap
src/mesh/test/dot11s/hwmp-target-flags-regression-test-2-1.pcap
src/mesh/test/dot11s/hwmp-target-flags-regression-test-3-1.pcap
src/mesh/test/dot11s/hwmp-target-flags-regression.cc
src/mesh/test/dot11s/pmp-regression-test-0-1.pcap
src/mesh/test/dot11s/pmp-regression-test-1-1.pcap
src/mesh/test/dot11s/pmp-regression.cc
src/mesh/test/flame/flame-regression-test-0-1.pcap
src/mesh/test/flame/flame-regression-test-1-1.pcap
src/mesh/test/flame/flame-regression-test-2-1.pcap
src/mesh/test/flame/flame-regression.cc
--- a/src/mesh/helper/mesh-helper.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/helper/mesh-helper.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -22,6 +22,7 @@
 #include "ns3/simulator.h"
 #include "ns3/mesh-point-device.h"
 #include "ns3/wifi-net-device.h"
+#include "ns3/minstrel-wifi-manager.h"
 #include "ns3/mesh-wifi-interface-mac.h"
 namespace ns3
 {
@@ -225,6 +226,18 @@
           for (std::vector<Ptr<NetDevice> >::iterator i = ifaces.begin (); i != ifaces.end (); i++)
             {
               wifi = DynamicCast<WifiNetDevice> (*i);
+           
+              // Handle any random numbers in the PHY objects.
+              currentStream += wifi->GetPhy ()->AssignStreams (currentStream);
+
+              // Handle any random numbers in the station managers.
+              Ptr<WifiRemoteStationManager> manager = wifi->GetRemoteStationManager ();
+              Ptr<MinstrelWifiManager> minstrel = DynamicCast<MinstrelWifiManager> (manager);
+              if (minstrel)
+                {
+                  currentStream += minstrel->AssignStreams (currentStream);
+                }
+              // Handle any random numbers in the mesh mac and plugins
               mac = DynamicCast<MeshWifiInterfaceMac> (wifi->GetMac ());
               if (mac)
                 {
Binary file src/mesh/test/dot11s/hwmp-proactive-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-proactive-regression-test-1-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-proactive-regression-test-2-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-proactive-regression-test-3-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-proactive-regression-test-4-1.pcap has changed
--- a/src/mesh/test/dot11s/hwmp-proactive-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/dot11s/hwmp-proactive-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -104,21 +104,26 @@
 void
 HwmpProactiveRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   // This test suite output was originally based on YansErrorRateModel
   wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel");
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::Dot11sStack", "Root", Mac48AddressValue (Mac48Address ("00:00:00:00:00:0d")));
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Five nodes, one device per node, 3 streams per mac
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (3*5), "Stream assignment unexpected value");
+  // Five devices, 4 streams per device 
+  streamsUsed += mesh.AssignStreams (meshDevices, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream mismatch");
+  // No streams used here, by default
+  streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream mismatch");
 
   // 3. setup TCP/IP
   InternetStackHelper internetStack;
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-1-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-2-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-3-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-4-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-reactive-regression-test-5-1.pcap has changed
--- a/src/mesh/test/dot11s/hwmp-reactive-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/dot11s/hwmp-reactive-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -101,21 +101,26 @@
 void
 HwmpReactiveRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   // This test suite output was originally based on YansErrorRateModel
   wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel");
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
+
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::Dot11sStack");
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Six nodes, one device per node, 3 streams per mac
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (6*3), "Stream assignment unexpected value");
+  // Six devices, 4 streams per device
+  streamsUsed += mesh.AssignStreams (meshDevices, streamsUsed);
+  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
+  streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed);
+  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
 
   // 3. setup TCP/IP
   InternetStackHelper internetStack;
Binary file src/mesh/test/dot11s/hwmp-simplest-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-simplest-regression-test-1-1.pcap has changed
--- a/src/mesh/test/dot11s/hwmp-simplest-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/dot11s/hwmp-simplest-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -115,19 +115,23 @@
 void
 HwmpSimplestRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::Dot11sStack");
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Two nodes, one device per node, three streams per device
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (2*3), "Stream assignment unexpected value");
+  // Two devices, four streams per mesh device
+  streamsUsed += mesh.AssignStreams (meshDevices, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
+  streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
 
   // 3. setup TCP/IP
   InternetStackHelper internetStack;
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-1-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-2-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-3-1.pcap has changed
--- a/src/mesh/test/dot11s/hwmp-target-flags-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/dot11s/hwmp-target-flags-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -120,21 +120,26 @@
 void
 HwmpDoRfRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   // This test suite output was originally based on YansErrorRateModel
   wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel");
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::Dot11sStack");
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Four nodes, one device per node, three streams per mac
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (4*3), "Stream assignment unexpected value");
+  // Four devices, four streams per mac
+  streamsUsed += mesh.AssignStreams (meshDevices, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
+  streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
+
   // 3. setup TCP/IP
   InternetStackHelper internetStack;
   internetStack.Install (*m_nodes);
Binary file src/mesh/test/dot11s/pmp-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/pmp-regression-test-1-1.pcap has changed
--- a/src/mesh/test/dot11s/pmp-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/dot11s/pmp-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -87,19 +87,23 @@
 void
 PeerManagementProtocolRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::Dot11sStack");
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Three nodes, one device per node, two streams (one for mac, one for plugin)
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, (3*2), "Stream assignment unexpected value");
+  // Two devices, four streams per device (one for mac, one for phy, 
+  // two for plugins)
+  streamsUsed += mesh.AssignStreams (meshDevices, 0);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 4), "Stream assignment mismatch");
+  wifiChannel.AssignStreams (chan, streamsUsed);
   // 3. write PCAP if needed
   wifiPhy.EnablePcapAll (CreateTempDirFilename (PREFIX));
 }
Binary file src/mesh/test/flame/flame-regression-test-0-1.pcap has changed
Binary file src/mesh/test/flame/flame-regression-test-1-1.pcap has changed
Binary file src/mesh/test/flame/flame-regression-test-2-1.pcap has changed
--- a/src/mesh/test/flame/flame-regression.cc	Fri Aug 24 16:01:24 2012 -0700
+++ b/src/mesh/test/flame/flame-regression.cc	Fri Aug 24 19:11:51 2012 -0700
@@ -91,21 +91,25 @@
 void
 FlameRegressionTest::CreateDevices ()
 {
+  int64_t streamsUsed = 0;
   // 1. setup WiFi
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   // This test suite output was originally based on YansErrorRateModel
   wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel"); 
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
-  wifiPhy.SetChannel (wifiChannel.Create ());
+  Ptr<YansWifiChannel> chan = wifiChannel.Create ();
+  wifiPhy.SetChannel (chan);
   // 2. setup mesh
   MeshHelper mesh = MeshHelper::Default ();
   mesh.SetStackInstaller ("ns3::FlameStack");
   mesh.SetMacType ("RandomStart", TimeValue (Seconds (0.1)));
   mesh.SetNumberOfInterfaces (1);
   NetDeviceContainer meshDevices = mesh.Install (wifiPhy, *m_nodes);
-  // Three nodes, one device per node
-  int64_t streamsUsed = mesh.AssignStreams (meshDevices, 0);
-  NS_TEST_EXPECT_MSG_EQ (streamsUsed, 3, "Stream assignment unexpected value");
+  // Three devices, two streams per device
+  streamsUsed += mesh.AssignStreams (meshDevices, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 2), "Stream assignment unexpected value");
+  streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed);
+  NS_TEST_ASSERT_MSG_EQ (streamsUsed, (meshDevices.GetN () * 2), "Stream assignment unexpected value");
   // 3. setup TCP/IP
   InternetStackHelper internetStack;
   internetStack.Install (*m_nodes);