aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-22 19:46:31 +0000
committerJustin Clarke Casey2009-01-22 19:46:31 +0000
commit884009ed33eab204588cc3978a46abff1098b832 (patch)
treed6a714d3c29396e0e85fecfe31788d3953662310 /OpenSim/Region
parent* Remove a few unnecessary locks to try and prevent lock contention in LLImag... (diff)
downloadopensim-SC-884009ed33eab204588cc3978a46abff1098b832.zip
opensim-SC-884009ed33eab204588cc3978a46abff1098b832.tar.gz
opensim-SC-884009ed33eab204588cc3978a46abff1098b832.tar.bz2
opensim-SC-884009ed33eab204588cc3978a46abff1098b832.tar.xz
* Add some caps seed capability path checking to the simple non neighbours standalone region teleport test
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs71
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs25
2 files changed, 73 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
index dee3914..6fa918a 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
@@ -99,40 +99,73 @@ namespace OpenSim.Region.Environment.Scenes.Tests
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Add a root agent 102 /// Generate some standard agent connection data.
103 /// </summary> 103 /// </summary>
104 /// <param name="scene"></param>
105 /// <param name="agentId"></param> 104 /// <param name="agentId"></param>
106 /// <returns></returns> 105 /// <returns></returns>
107 public static TestClient AddRootAgent(Scene scene, UUID agentId) 106 public static AgentCircuitData GenerateAgentData(UUID agentId)
108 { 107 {
109 string firstName = "testfirstname"; 108 string firstName = "testfirstname";
110 109
111 AgentCircuitData agent = new AgentCircuitData(); 110 AgentCircuitData agentData = new AgentCircuitData();
112 agent.AgentID = agentId; 111 agentData.AgentID = agentId;
113 agent.firstname = firstName; 112 agentData.firstname = firstName;
114 agent.lastname = "testlastname"; 113 agentData.lastname = "testlastname";
115 agent.SessionID = UUID.Zero; 114 agentData.SessionID = UUID.Zero;
116 agent.SecureSessionID = UUID.Zero; 115 agentData.SecureSessionID = UUID.Zero;
117 agent.circuitcode = 123; 116 agentData.circuitcode = 123;
118 agent.BaseFolder = UUID.Zero; 117 agentData.BaseFolder = UUID.Zero;
119 agent.InventoryFolder = UUID.Zero; 118 agentData.InventoryFolder = UUID.Zero;
120 agent.startpos = Vector3.Zero; 119 agentData.startpos = Vector3.Zero;
121 agent.CapsPath = "http://wibble.com"; 120 agentData.CapsPath = "http://wibble.com";
122 121
122 return agentData;
123 }
124
125 /// <summary>
126 /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test
127 /// </summary>
128 /// <param name="scene"></param>
129 /// <param name="agentId"></param>
130 /// <returns></returns>
131 public static TestClient AddRootAgent(Scene scene, UUID agentId)
132 {
133 return AddRootAgent(scene, GenerateAgentData(agentId));
134 }
135
136 /// <summary>
137 /// Add a root agent.
138 /// </summary>
139 ///
140 /// This function
141 ///
142 /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the
143 /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
144 /// agent was coming.
145 ///
146 /// 2) Connects the agent with the scene
147 ///
148 /// This function performs actions equivalent with notifying the scene that an agent is
149 /// coming and then actually connecting the agent to the scene. The one step missed out is the very first
150 ///
151 /// <param name="scene"></param>
152 /// <param name="agentData"></param>
153 /// <returns></returns>
154 public static TestClient AddRootAgent(Scene scene, AgentCircuitData agentData)
155 {
123 // We emulate the proper login sequence here by doing things in three stages 156 // We emulate the proper login sequence here by doing things in three stages
124 // Stage 1: simulate login by telling the scene to expect a new user connection 157 // Stage 1: simulate login by telling the scene to expect a new user connection
125 scene.NewUserConnection(agent); 158 scene.NewUserConnection(agentData);
126 159
127 // Stage 2: add the new client as a child agent to the scene 160 // Stage 2: add the new client as a child agent to the scene
128 TestClient client = new TestClient(agent, scene); 161 TestClient client = new TestClient(agentData, scene);
129 scene.AddNewClient(client); 162 scene.AddNewClient(client);
130 163
131 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, 164 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
132 // inventory, etc.) 165 // inventory, etc.)
133 scene.AgentCrossing(agent.AgentID, new Vector3(90, 90, 90), false); 166 scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false);
134 167
135 return client; 168 return client;
136 } 169 }
137 170
138 /// <summary> 171 /// <summary>
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
index a61b9c2..3bc8467 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
@@ -74,17 +74,34 @@ namespace OpenSim.Region.Environment.Scenes.Tests
74 sceneB.SetModuleInterfaces(); 74 sceneB.SetModuleInterfaces();
75 sceneB.RegisterRegionWithGrid(); 75 sceneB.RegisterRegionWithGrid();
76 76
77 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 77 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
78
79 TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId); 78 TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId);
79
80 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
80 81
82 Assert.That(
83 sceneACapsModule.GetCapsPath(agentId),
84 Is.EqualTo(client.CapsSeedUrl),
85 "Incorrect caps object path set up in sceneA");
86
81 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. 87 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
82 client.TeleportTargetScene = sceneB; 88 client.TeleportTargetScene = sceneB;
83
84 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); 89 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
90
85 Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); 91 Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
86 Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); 92 Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
87 93
94 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>();
95
96 // Temporary assertion - caps url construction should at least be doable through a method.
97 Assert.That(
98 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
99 Is.EqualTo(client.CapsSeedUrl),
100 "Incorrect caps object path set up in sceneB");
101
102 // This assertion will currently fail since we don't remove the caps paths when no longer needed
103 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
104
88 // TODO: Check that more of everything is as it should be 105 // TODO: Check that more of everything is as it should be
89 106
90 // TODO: test what happens if we try to teleport to a region that doesn't exist 107 // TODO: test what happens if we try to teleport to a region that doesn't exist