32 using NUnit.Framework;
34 using OpenMetaverse.Packets;
35 using OpenSim.Framework;
36 using OpenSim.Framework.Monitoring;
37 using OpenSim.Region.Framework.Scenes;
38 using OpenSim.Tests.Common;
48 private Scene m_scene;
54 Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
63 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
97 TestHelpers.InMethod();
102 UUID myAgentUuid = TestHelpers.ParseTail(0x1);
103 UUID mySessionUuid = TestHelpers.ParseTail(0x2);
104 uint myCircuitCode = 123456;
105 IPEndPoint testEp =
new IPEndPoint(IPAddress.Loopback, 999);
107 UseCircuitCodePacket uccp =
new UseCircuitCodePacket();
109 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock
110 =
new UseCircuitCodePacket.CircuitCodeBlock();
111 uccpCcBlock.Code = myCircuitCode;
112 uccpCcBlock.ID = myAgentUuid;
113 uccpCcBlock.SessionID = mySessionUuid;
114 uccp.CircuitCode = uccpCcBlock;
116 byte[] uccpBytes = uccp.ToBytes();
117 UDPPacketBuffer upb =
new UDPPacketBuffer(testEp, uccpBytes.Length);
118 upb.DataLength = uccpBytes.Length;
119 Buffer.BlockCopy(uccpBytes, 0, upb.Data, 0, uccpBytes.Length);
121 udpServer.PacketReceived(upb);
124 Assert.That(m_scene.GetScenePresence(myAgentUuid), Is.Null);
127 acd.AgentID = myAgentUuid;
128 acd.SessionID = mySessionUuid;
130 m_scene.AuthenticateHandler.AddNewCircuit(myCircuitCode, acd);
132 udpServer.PacketReceived(upb);
136 Assert.That(sp.UUID, Is.EqualTo(myAgentUuid));
138 Assert.That(udpServer.PacketsSent.Count, Is.EqualTo(1));
140 Packet packet = udpServer.PacketsSent[0];
141 Assert.That(packet, Is.InstanceOf(typeof(PacketAckPacket)));
143 PacketAckPacket ackPacket = packet as PacketAckPacket;
144 Assert.That(ackPacket.Packets.Length, Is.EqualTo(1));
145 Assert.That(ackPacket.Packets[0].ID, Is.EqualTo(0));
151 TestHelpers.InMethod();
154 IniConfigSource ics =
new IniConfigSource();
155 IConfig config = ics.AddConfig(
"ClientStack.LindenUDP");
156 config.Set(
"AckTimeout", -1);
157 TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics);
160 = ClientStackHelpers.AddChildClient(
163 udpServer.ClientOutgoingPacketHandler(sp.ControllingClient,
true,
false,
false);
165 ScenePresence spAfterAckTimeout = m_scene.GetScenePresence(sp.UUID);
166 Assert.That(spAfterAckTimeout, Is.Null);
void TestAddClient()
Test adding a client to the stack
static UUID ParseTail(int tail)
Parse tail section into full UUID.
This class enables regression testing of the LLUDPServer by allowing us to intercept outgoing data...
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
This will contain basic tests for the LindenUDP client stack
Helpers for setting up scenes.
void TestLogoutClientDueToAck()
Interactive OpenSim region server