author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 25 Aug 2010 21:31:43 +0200 | |
changeset 7044 | f94b264549d1 |
parent 7040 | 444bb5c76bff |
permissions | -rw-r--r-- |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
2 |
/* |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
3 |
* Copyright (c) 2009 IITP RAS |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
4 |
* |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
8 |
* |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
13 |
* |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
17 |
* |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
18 |
* Authors: Pavel Boyko <boyko@iitp.ru> |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
19 |
*/ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
20 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
21 |
#include "aodv-regression.h" |
6088 | 22 |
#include "bug-772.h" |
23 |
#include "loopback.h" |
|
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
24 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
25 |
#include "ns3/mesh-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
26 |
#include "ns3/simulator.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
27 |
#include "ns3/random-variable.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
28 |
#include "ns3/mobility-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
29 |
#include "ns3/double.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
30 |
#include "ns3/uinteger.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
31 |
#include "ns3/string.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
32 |
#include "ns3/boolean.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
33 |
#include "ns3/yans-wifi-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
34 |
#include "ns3/internet-stack-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
35 |
#include "ns3/ipv4-address-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
36 |
#include "ns3/abort.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
37 |
#include "ns3/udp-echo-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
38 |
#include "ns3/mobility-model.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
39 |
#include "ns3/pcap-file.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
40 |
#include "ns3/aodv-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
41 |
#include "ns3/v4ping-helper.h" |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
42 |
#include "ns3/nqos-wifi-mac-helper.h" |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
43 |
#include "ns3/config.h" |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
44 |
#include <sstream> |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
45 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
46 |
/// Set to true to rewrite reference traces, leave false to run regression tests |
5736 | 47 |
const bool WRITE_VECTORS = false; |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
48 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
49 |
namespace ns3 { |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
50 |
namespace aodv { |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
51 |
//----------------------------------------------------------------------------- |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
52 |
// Test suite |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
53 |
//----------------------------------------------------------------------------- |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
54 |
class AodvRegressionTestSuite : public TestSuite |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
55 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
56 |
public: |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
57 |
AodvRegressionTestSuite () : TestSuite ("routing-aodv-regression", SYSTEM) |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
58 |
{ |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
59 |
// General RREQ-RREP-RRER test case |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
60 |
AddTestCase (new ChainRegressionTest ("aodv-chain-regression-test")); |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
61 |
// Bug 606 test case, should crash if bug is not fixed |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
62 |
AddTestCase (new ChainRegressionTest ("bug-606-test", Seconds (10), 3, Seconds (1))); |
6088 | 63 |
// Bug 772 UDP test case |
64 |
AddTestCase (new Bug772ChainTest ("udp-chain-test", "ns3::UdpSocketFactory", Seconds (3), 10)); |
|
65 |
// Bug 772 TCP test case |
|
66 |
AddTestCase (new Bug772ChainTest ("tcp-chain-test", "ns3::TcpSocketFactory", Seconds (3), 10)); |
|
67 |
// Ping loopback test case |
|
68 |
AddTestCase (new LoopbackTestCase ()); |
|
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
69 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
70 |
} g_aodvRegressionTestSuite; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
71 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
72 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
73 |
//----------------------------------------------------------------------------- |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
74 |
// ChainRegressionTest |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
75 |
//----------------------------------------------------------------------------- |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
76 |
ChainRegressionTest::ChainRegressionTest (const char * const prefix, Time t, uint32_t size, Time arpAliveTimeout) : |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
77 |
TestCase ("AODV chain regression test"), |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
78 |
m_nodes (0), |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
79 |
m_prefix (prefix), |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
80 |
m_time (t), |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
81 |
m_size (size), |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
82 |
m_step (120), |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
83 |
m_arpAliveTimeout (arpAliveTimeout) |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
84 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
85 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
86 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
87 |
ChainRegressionTest::~ChainRegressionTest () |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
88 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
89 |
delete m_nodes; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
90 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
91 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
92 |
bool |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
93 |
ChainRegressionTest::DoRun () |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
94 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
95 |
SeedManager::SetSeed(12345); |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
96 |
Config::SetDefault ("ns3::ArpCache::AliveTimeout", TimeValue (m_arpAliveTimeout)); |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
97 |
|
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
98 |
CreateNodes (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
99 |
CreateDevices (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
100 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
101 |
// At m_time / 3 move central node away and see what will happen |
5730
f530c4943146
time diagram + fixed hop count
Elena Buchatskaia <borovkovaes@iitp.ru>
parents:
5726
diff
changeset
|
102 |
Ptr<Node> node = m_nodes->Get (m_size / 2); |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
103 |
Ptr<MobilityModel> mob = node->GetObject<MobilityModel> (); |
7044
f94b264549d1
introduce implicit conversion operator
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
7040
diff
changeset
|
104 |
Simulator::Schedule (Time (m_time / 3), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5)); |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
105 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
106 |
Simulator::Stop (m_time); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
107 |
Simulator::Run (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
108 |
Simulator::Destroy (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
109 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
110 |
if (!WRITE_VECTORS) CheckResults (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
111 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
112 |
delete m_nodes, m_nodes = 0; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
113 |
return GetErrorStatus (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
114 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
115 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
116 |
void |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
117 |
ChainRegressionTest::CreateNodes () |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
118 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
119 |
m_nodes = new NodeContainer; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
120 |
m_nodes->Create (m_size); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
121 |
MobilityHelper mobility; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
122 |
mobility.SetPositionAllocator ("ns3::GridPositionAllocator", |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
123 |
"MinX", DoubleValue (0.0), |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
124 |
"MinY", DoubleValue (0.0), |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
125 |
"DeltaX", DoubleValue (m_step), |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
126 |
"DeltaY", DoubleValue (0), |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
127 |
"GridWidth", UintegerValue (m_size), |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
128 |
"LayoutType", StringValue ("RowFirst")); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
129 |
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
130 |
mobility.Install (*m_nodes); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
131 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
132 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
133 |
void |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
134 |
ChainRegressionTest::CreateDevices () |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
135 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
136 |
// 1. Setup WiFi |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
137 |
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
138 |
wifiMac.SetType ("ns3::AdhocWifiMac"); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
139 |
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
140 |
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
141 |
wifiPhy.SetChannel (wifiChannel.Create ()); |
6459
d5cfe99001f0
Change default OFDM error rate model to NistErrorRateModel (issue 944)
Tom Henderson <tomh@tomh.org>
parents:
6360
diff
changeset
|
142 |
// This test suite output was originally based on YansErrorRateModel |
d5cfe99001f0
Change default OFDM error rate model to NistErrorRateModel (issue 944)
Tom Henderson <tomh@tomh.org>
parents:
6360
diff
changeset
|
143 |
wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel"); |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
144 |
WifiHelper wifi = WifiHelper::Default (); |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6088
diff
changeset
|
145 |
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"), "RtsCtsThreshold", StringValue ("2200")); |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
146 |
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, *m_nodes); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
147 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
148 |
// 2. Setup TCP/IP & AODV |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
149 |
AodvHelper aodv; // Use default parameters here |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
150 |
InternetStackHelper internetStack; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
151 |
internetStack.SetRoutingHelper (aodv); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
152 |
internetStack.Install (*m_nodes); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
153 |
Ipv4AddressHelper address; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
154 |
address.SetBase ("10.1.1.0", "255.255.255.0"); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
155 |
Ipv4InterfaceContainer interfaces = address.Assign (devices); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
156 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
157 |
// 3. Setup ping |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
158 |
V4PingHelper ping (interfaces.GetAddress (m_size - 1)); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
159 |
ping.SetAttribute ("Verbose", BooleanValue (false)); // don't need verbose ping in regression test |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
160 |
ApplicationContainer p = ping.Install (m_nodes->Get (0)); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
161 |
p.Start (Seconds (0)); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
162 |
p.Stop (m_time); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
163 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
164 |
// 4. write PCAP |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
165 |
std::string prefix = (WRITE_VECTORS ? NS_TEST_SOURCEDIR : GetTempDir ()) + m_prefix; |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
166 |
wifiPhy.EnablePcapAll (prefix); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
167 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
168 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
169 |
void |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
170 |
ChainRegressionTest::CheckResults () |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
171 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
172 |
for (uint32_t i = 0; i < m_size; ++i) |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
173 |
{ |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
174 |
std::ostringstream os1, os2; |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
175 |
// File naming conventions are hard-coded here. |
5847
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
176 |
os1 << NS_TEST_SOURCEDIR << m_prefix << "-" << i << "-0.pcap"; |
e6a70e535416
Bug 606 testcase. Now routing-aodv-regression should crash until bug will be fixed.
Pavel Boyko <boyko@iitp.ru>
parents:
5749
diff
changeset
|
177 |
os2 << GetTempDir () << m_prefix << "-" << i << "-0.pcap"; |
5726
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
178 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
179 |
uint32_t sec(0), usec(0); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
180 |
bool diff = PcapFile::Diff (os1.str(), os2.str(), sec, usec); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
181 |
NS_TEST_EXPECT_MSG_EQ (diff, false, "PCAP traces " << os1.str() << " and " << os2.str() |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
182 |
<< " differ starting from " << sec << " s " << usec << " us"); |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
183 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
184 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
185 |
|
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
186 |
} |
8776c223c36c
[aodv] Broken chain ping regression added (without reference traces yet)
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
187 |
} |