aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/Tests
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/Region/ClientStack/LindenUDP/Tests
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 '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs20
1 files changed, 17 insertions, 3 deletions
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}