aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-05 18:30:56 +0000
committerJustin Clarke Casey2009-01-05 18:30:56 +0000
commitfcab408cc49508efb85d612029dee271a88d13d0 (patch)
tree0d3f510b67f3b6e8fef1f355b1bb7ceace6c4deb
parentfixes mantis #2950 (diff)
downloadopensim-SC-fcab408cc49508efb85d612029dee271a88d13d0.zip
opensim-SC-fcab408cc49508efb85d612029dee271a88d13d0.tar.gz
opensim-SC-fcab408cc49508efb85d612029dee271a88d13d0.tar.bz2
opensim-SC-fcab408cc49508efb85d612029dee271a88d13d0.tar.xz
* Add seed cap check to login test
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs20
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs2
2 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index 1e1fa73..2dc644a 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Net; 30using System.Net;
31using System.Text.RegularExpressions;
31using NUnit.Framework; 32using NUnit.Framework;
32using NUnit.Framework.SyntaxHelpers; 33using NUnit.Framework.SyntaxHelpers;
33using Nwc.XmlRpc; 34using Nwc.XmlRpc;
@@ -43,9 +44,9 @@ namespace OpenSim.Framework.Communications.Tests
43 /// </summary> 44 /// </summary>
44 [TestFixture] 45 [TestFixture]
45 public class LoginServiceTests 46 public class LoginServiceTests
46 { 47 {
47 /// <summary> 48 /// <summary>
48 /// Test the normal response to a login. Does not test authentication. Doesn't yet do what it says on the tin. 49 /// Test the normal response to a login. Does not test authentication.
49 /// </summary> 50 /// </summary>
50 [Test] 51 [Test]
51 public void TestNormalLoginResponse() 52 public void TestNormalLoginResponse()
@@ -54,12 +55,14 @@ namespace OpenSim.Framework.Communications.Tests
54 55
55 string firstName = "Timmy"; 56 string firstName = "Timmy";
56 string lastName = "Mallet"; 57 string lastName = "Mallet";
58 string regionExternalName = "localhost";
59 IPEndPoint capsEndPoint = new IPEndPoint(IPAddress.Loopback, 9123);
57 60
58 CommunicationsManager commsManager 61 CommunicationsManager commsManager
59 = new TestCommunicationsManager(new OpenSim.Framework.NetworkServersInfo(42, 43)); 62 = new TestCommunicationsManager(new OpenSim.Framework.NetworkServersInfo(42, 43));
60 63
61 commsManager.GridService.RegisterRegion( 64 commsManager.GridService.RegisterRegion(
62 new RegionInfo(42, 43, new IPEndPoint(IPAddress.Loopback, 9000), "localhost")); 65 new RegionInfo(42, 43, capsEndPoint, regionExternalName));
63 commsManager.GridService.RegionLoginsEnabled = true; 66 commsManager.GridService.RegionLoginsEnabled = true;
64 67
65 LoginService loginService 68 LoginService loginService
@@ -84,10 +87,17 @@ namespace OpenSim.Framework.Communications.Tests
84 // TODO: Not check inventory part of response yet. 87 // TODO: Not check inventory part of response yet.
85 // TODO: Not checking all of login response thoroughly yet. 88 // TODO: Not checking all of login response thoroughly yet.
86 89
90 Assert.That(responseData["first_name"], Is.EqualTo(firstName));
91 Assert.That(responseData["last_name"], Is.EqualTo(lastName));
87 Assert.That( 92 Assert.That(
88 responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(System.Int32.MaxValue)); 93 responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(System.Int32.MaxValue));
89 Assert.That(responseData["first_name"], Is.EqualTo(firstName)); 94
90 Assert.That(responseData["last_name"], Is.EqualTo(lastName)); 95 Regex capsSeedPattern
96 = new Regex("^http://"
97 + regionExternalName
98 + ":9000/CAPS/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{8}0000/$");
99
100 Assert.That(capsSeedPattern.IsMatch((string)responseData["seed_capability"]), Is.True);
91 } 101 }
92 } 102 }
93} 103}
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 8aa88f7..e68398b 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -312,7 +312,7 @@ namespace OpenSim.Region.Communications.Local
312 seedcap = "http://" + regionInfo.ExternalHostName + ":" + serversInfo.HttpListenerPort + "/CAPS/" + capsPath + "0000/"; 312 seedcap = "http://" + regionInfo.ExternalHostName + ":" + serversInfo.HttpListenerPort + "/CAPS/" + capsPath + "0000/";
313 } 313 }
314 314
315 response.SeedCapability = seedcap; //regionInfo.ExternalEndPoint.Address.ToString() + ":" + regionInfo.HttpPort + "/CAPS/" + capsPath + "0000/"; 315 response.SeedCapability = seedcap;
316 316
317 // Notify the target of an incoming user 317 // Notify the target of an incoming user
318 m_log.InfoFormat( 318 m_log.InfoFormat(