diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs index a935dd2..eb262d2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
70 | m_scene = new SceneHelpers().SetupScene(); | 70 | m_scene = new SceneHelpers().SetupScene(); |
71 | StatsManager.SimExtraStats = new SimExtraStatsCollector(); | 71 | StatsManager.SimExtraStats = new SimExtraStatsCollector(); |
72 | } | 72 | } |
73 | 73 | ||
74 | // /// <summary> | 74 | // /// <summary> |
75 | // /// Build an object name packet for test purposes | 75 | // /// Build an object name packet for test purposes |
76 | // /// </summary> | 76 | // /// </summary> |
@@ -84,13 +84,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
84 | // odb.Name = Utils.StringToBytes(objectName); | 84 | // odb.Name = Utils.StringToBytes(objectName); |
85 | // onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; | 85 | // onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; |
86 | // onp.Header.Zerocoded = false; | 86 | // onp.Header.Zerocoded = false; |
87 | // | 87 | // |
88 | // return onp; | 88 | // return onp; |
89 | // } | 89 | // } |
90 | // | 90 | // |
91 | /// <summary> | 91 | /// <summary> |
92 | /// Test adding a client to the stack | 92 | /// Test adding a client to the stack |
93 | /// </summary> | 93 | /// </summary> |
94 | /* | ||
94 | [Test] | 95 | [Test] |
95 | public void TestAddClient() | 96 | public void TestAddClient() |
96 | { | 97 | { |
@@ -156,7 +157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
156 | config.Set("AckTimeout", -1); | 157 | config.Set("AckTimeout", -1); |
157 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics); | 158 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics); |
158 | 159 | ||
159 | ScenePresence sp | 160 | ScenePresence sp |
160 | = ClientStackHelpers.AddChildClient( | 161 | = ClientStackHelpers.AddChildClient( |
161 | m_scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 162 | m_scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
162 | 163 | ||
@@ -165,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
165 | ScenePresence spAfterAckTimeout = m_scene.GetScenePresence(sp.UUID); | 166 | ScenePresence spAfterAckTimeout = m_scene.GetScenePresence(sp.UUID); |
166 | Assert.That(spAfterAckTimeout, Is.Null); | 167 | Assert.That(spAfterAckTimeout, Is.Null); |
167 | } | 168 | } |
168 | 169 | */ | |
169 | // /// <summary> | 170 | // /// <summary> |
170 | // /// Test removing a client from the stack | 171 | // /// Test removing a client from the stack |
171 | // /// </summary> | 172 | // /// </summary> |
@@ -175,21 +176,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
175 | // TestHelper.InMethod(); | 176 | // TestHelper.InMethod(); |
176 | // | 177 | // |
177 | // uint myCircuitCode = 123457; | 178 | // uint myCircuitCode = 123457; |
178 | // | 179 | // |
179 | // TestLLUDPServer testLLUDPServer; | 180 | // TestLLUDPServer testLLUDPServer; |
180 | // TestLLPacketServer testLLPacketServer; | 181 | // TestLLPacketServer testLLPacketServer; |
181 | // AgentCircuitManager acm; | 182 | // AgentCircuitManager acm; |
182 | // SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); | 183 | // SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); |
183 | // AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); | 184 | // AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); |
184 | // | 185 | // |
185 | // testLLUDPServer.RemoveClientCircuit(myCircuitCode); | 186 | // testLLUDPServer.RemoveClientCircuit(myCircuitCode); |
186 | // Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); | 187 | // Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); |
187 | // | 188 | // |
188 | // // Check that removing a non-existent circuit doesn't have any bad effects | 189 | // // Check that removing a non-existent circuit doesn't have any bad effects |
189 | // testLLUDPServer.RemoveClientCircuit(101); | 190 | // testLLUDPServer.RemoveClientCircuit(101); |
190 | // Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 191 | // Assert.IsFalse(testLLUDPServer.HasCircuit(101)); |
191 | // } | 192 | // } |
192 | // | 193 | // |
193 | // /// <summary> | 194 | // /// <summary> |
194 | // /// Make sure that the client stack reacts okay to malformed packets | 195 | // /// Make sure that the client stack reacts okay to malformed packets |
195 | // /// </summary> | 196 | // /// </summary> |
@@ -200,8 +201,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
200 | // | 201 | // |
201 | // uint myCircuitCode = 123458; | 202 | // uint myCircuitCode = 123458; |
202 | // EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 1001); | 203 | // EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 1001); |
203 | // MockScene scene = new MockScene(); | 204 | // MockScene scene = new MockScene(); |
204 | // | 205 | // |
205 | // TestLLUDPServer testLLUDPServer; | 206 | // TestLLUDPServer testLLUDPServer; |
206 | // TestLLPacketServer testLLPacketServer; | 207 | // TestLLPacketServer testLLPacketServer; |
207 | // AgentCircuitManager acm; | 208 | // AgentCircuitManager acm; |
@@ -213,24 +214,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
213 | // // Send two garbled 'packets' in succession | 214 | // // Send two garbled 'packets' in succession |
214 | // testLLUDPServer.LoadReceive(data, testEp); | 215 | // testLLUDPServer.LoadReceive(data, testEp); |
215 | // testLLUDPServer.LoadReceive(data, testEp); | 216 | // testLLUDPServer.LoadReceive(data, testEp); |
216 | // testLLUDPServer.ReceiveData(null); | 217 | // testLLUDPServer.ReceiveData(null); |
217 | // | 218 | // |
218 | // // Check that we are still here | 219 | // // Check that we are still here |
219 | // Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); | 220 | // Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
220 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(0)); | 221 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(0)); |
221 | // | 222 | // |
222 | // // Check that sending a valid packet to same circuit still succeeds | 223 | // // Check that sending a valid packet to same circuit still succeeds |
223 | // Assert.That(scene.ObjectNameCallsReceived, Is.EqualTo(0)); | 224 | // Assert.That(scene.ObjectNameCallsReceived, Is.EqualTo(0)); |
224 | // | 225 | // |
225 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); | 226 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); |
226 | // testLLUDPServer.ReceiveData(null); | 227 | // testLLUDPServer.ReceiveData(null); |
227 | // | 228 | // |
228 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); | 229 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); |
229 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); | 230 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); |
230 | // } | 231 | // } |
231 | // | 232 | // |
232 | // /// <summary> | 233 | // /// <summary> |
233 | // /// Test that the stack continues to work even if some client has caused a | 234 | // /// Test that the stack continues to work even if some client has caused a |
234 | // /// SocketException on Socket.BeginReceive() | 235 | // /// SocketException on Socket.BeginReceive() |
235 | // /// </summary> | 236 | // /// </summary> |
236 | // [Test] | 237 | // [Test] |
@@ -239,32 +240,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
239 | // TestHelper.InMethod(); | 240 | // TestHelper.InMethod(); |
240 | // | 241 | // |
241 | // MockScene scene = new MockScene(); | 242 | // MockScene scene = new MockScene(); |
242 | // | 243 | // |
243 | // uint circuitCodeA = 130000; | 244 | // uint circuitCodeA = 130000; |
244 | // EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); | 245 | // EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); |
245 | // UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); | 246 | // UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); |
246 | // UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); | 247 | // UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); |
247 | // | 248 | // |
248 | // uint circuitCodeB = 130001; | 249 | // uint circuitCodeB = 130001; |
249 | // EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); | 250 | // EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); |
250 | // UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); | 251 | // UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); |
251 | // UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); | 252 | // UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); |
252 | // | 253 | // |
253 | // TestLLUDPServer testLLUDPServer; | 254 | // TestLLUDPServer testLLUDPServer; |
254 | // TestLLPacketServer testLLPacketServer; | 255 | // TestLLPacketServer testLLPacketServer; |
255 | // AgentCircuitManager acm; | 256 | // AgentCircuitManager acm; |
256 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 257 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
257 | // AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); | 258 | // AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); |
258 | // AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); | 259 | // AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); |
259 | // | 260 | // |
260 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet1"), epA); | 261 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet1"), epA); |
261 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet2"), epB); | 262 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet2"), epB); |
262 | // testLLUDPServer.LoadReceiveWithBeginException(epA); | 263 | // testLLUDPServer.LoadReceiveWithBeginException(epA); |
263 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(2, "packet3"), epB); | 264 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(2, "packet3"), epB); |
264 | // testLLUDPServer.ReceiveData(null); | 265 | // testLLUDPServer.ReceiveData(null); |
265 | // | 266 | // |
266 | // Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); | 267 | // Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); |
267 | // | 268 | // |
268 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); | 269 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); |
269 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); | 270 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); |
270 | // } | 271 | // } |