aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-24 19:40:45 +0000
committerJustin Clarke Casey2008-10-24 19:40:45 +0000
commit91c2e53277078f2f32ee8057dbb57e29e1cba78b (patch)
tree97630584ebde7dca8412f2f3dd1fb6a4230d7168 /OpenSim
parent* minor: refactor out AddUser test setup to common method (diff)
downloadopensim-SC_OLD-91c2e53277078f2f32ee8057dbb57e29e1cba78b.zip
opensim-SC_OLD-91c2e53277078f2f32ee8057dbb57e29e1cba78b.tar.gz
opensim-SC_OLD-91c2e53277078f2f32ee8057dbb57e29e1cba78b.tar.bz2
opensim-SC_OLD-91c2e53277078f2f32ee8057dbb57e29e1cba78b.tar.xz
* Change AddClient test such that we now successfully authenticate
* The fact that the assert passed even when authentication failed reveals a bug in the code that will be corrected soonish
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/AgentCircuitManager.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs3
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs20
3 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs
index 027d0c6..a73e86d 100644
--- a/OpenSim/Framework/AgentCircuitManager.cs
+++ b/OpenSim/Framework/AgentCircuitManager.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Framework
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Add information about a new circuit. 77 /// Add information about a new circuit so that later on we can authenticate a new client session.
78 /// </summary> 78 /// </summary>
79 /// <param name="circuitCode"></param> 79 /// <param name="circuitCode"></param>
80 /// <param name="agentData"></param> 80 /// <param name="agentData"></param>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index b786989..2e9af74 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -395,8 +395,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
395 "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", 395 "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}",
396 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); 396 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
397 397
398 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); 398 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
399
400 isNewCircuit = true; 399 isNewCircuit = true;
401 } 400 }
402 } 401 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
index 29f0c20..c90aecf 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
@@ -28,6 +28,7 @@
28using System.Net; 28using System.Net;
29using log4net; 29using log4net;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenMetaverse;
31using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
32using OpenSim.Framework; 33using OpenSim.Framework;
33using OpenSim.Framework.Communications; 34using OpenSim.Framework.Communications;
@@ -58,18 +59,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
58 [Test] 59 [Test]
59 public void TestAddClient() 60 public void TestAddClient()
60 { 61 {
62 uint myCircuitCode = 123456;
63 UUID myAgentUuid = UUID.Parse("00000000-0000-0000-0000-000000000001");
64 UUID mySessionUuid = UUID.Parse("00000000-0000-0000-0000-000000000002");
65
61 TestLLUDPServer testLLUDPServer = new TestLLUDPServer(); 66 TestLLUDPServer testLLUDPServer = new TestLLUDPServer();
62 ClientStackUserSettings userSettings = new ClientStackUserSettings(); 67 ClientStackUserSettings userSettings = new ClientStackUserSettings();
63 68
69 AgentCircuitManager acm = new AgentCircuitManager();
70 AgentCircuitData acd = new AgentCircuitData();
71 acd.AgentID = myAgentUuid;
72 acd.SessionID = mySessionUuid;
73 acm.AddNewCircuit(myCircuitCode, acd);
74
64 uint port = 666; 75 uint port = 666;
65 testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, new AgentCircuitManager()); 76 testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm);
66 LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings); 77 LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings);
67 testLLUDPServer.LocalScene = new MockScene(); 78 testLLUDPServer.LocalScene = new MockScene();
68 79
69 UseCircuitCodePacket uccp = new UseCircuitCodePacket(); 80 UseCircuitCodePacket uccp = new UseCircuitCodePacket();
81
70 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock 82 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock
71 = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); 83 = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock();
72 uccpCcBlock.Code = 123456; 84 uccpCcBlock.Code = myCircuitCode;
85 uccpCcBlock.ID = myAgentUuid;
86 uccpCcBlock.SessionID = mySessionUuid;
73 uccp.CircuitCode = uccpCcBlock; 87 uccp.CircuitCode = uccpCcBlock;
74 88
75 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); 89 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
@@ -78,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
78 testLLUDPServer.ReceiveData(null); 92 testLLUDPServer.ReceiveData(null);
79 93
80 Assert.IsFalse(testLLUDPServer.HasCircuit(101)); 94 Assert.IsFalse(testLLUDPServer.HasCircuit(101));
81 Assert.IsTrue(testLLUDPServer.HasCircuit(123456)); 95 Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
82 } 96 }
83 } 97 }
84} 98}