aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-10-09 00:51:36 +0100
committerJustin Clark-Casey (justincc)2014-11-25 23:21:37 +0000
commitdf031fe8be55264bc4edd8872757b3851a60a578 (patch)
treefa667fb1eacec3d97e714b2f686e12d310bf53ef /OpenSim/Region/ClientStack
parentAdd regression test TestClientThrottleRegionLimited() for testing simple beha... (diff)
downloadopensim-SC_OLD-df031fe8be55264bc4edd8872757b3851a60a578.zip
opensim-SC_OLD-df031fe8be55264bc4edd8872757b3851a60a578.tar.gz
opensim-SC_OLD-df031fe8be55264bc4edd8872757b3851a60a578.tar.bz2
opensim-SC_OLD-df031fe8be55264bc4edd8872757b3851a60a578.tar.xz
extend TestClientThrottleRegionLimited for 2 clients after testing 1. Renames to TestSingleClientThrottleRegionLimited()
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs96
1 files changed, 71 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs
index 8c1e66c..b80a485 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs
@@ -98,18 +98,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
98 /// Test throttle setttings where max client throttle has been limited server side. 98 /// Test throttle setttings where max client throttle has been limited server side.
99 /// </summary> 99 /// </summary>
100 [Test] 100 [Test]
101 public void TestClientThrottleRegionLimited() 101 public void TestSingleClientThrottleRegionLimited()
102 { 102 {
103 TestHelpers.InMethod(); 103 TestHelpers.InMethod();
104 // TestHelpers.EnableLogging(); 104 // TestHelpers.EnableLogging();
105 105
106 int resendBytes = 4000; 106 int resendBytes = 6000;
107 int landBytes = 6000; 107 int landBytes = 8000;
108 int windBytes = 8000; 108 int windBytes = 10000;
109 int cloudBytes = 10000; 109 int cloudBytes = 12000;
110 int taskBytes = 12000; 110 int taskBytes = 14000;
111 int textureBytes = 14000; 111 int textureBytes = 16000;
112 int assetBytes = 16000; 112 int assetBytes = 18000;
113 int totalBytes 113 int totalBytes
114 = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2); 114 = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2);
115 115
@@ -117,30 +117,76 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
117 TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); 117 TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene);
118 udpServer.Throttle.RequestedDripRate = totalBytes; 118 udpServer.Throttle.RequestedDripRate = totalBytes;
119 119
120 ScenePresence sp 120 ScenePresence sp1
121 = ClientStackHelpers.AddChildClient( 121 = ClientStackHelpers.AddChildClient(
122 scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); 122 scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
123 123
124 LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; 124 LLUDPClient udpClient1 = ((LLClientView)sp1.ControllingClient).UDPClient;
125 // udpClient.ThrottleDebugLevel = 1;
126 125
127 SetThrottles( 126 SetThrottles(
128 udpClient, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); 127 udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
129 128
130 ClientInfo ci = udpClient.GetClientInfo(); 129 {
130 ClientInfo ci = udpClient1.GetClientInfo();
131
132 // Console.WriteLine(
133 // "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}",
134 // ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle);
135
136 Assert.AreEqual(resendBytes / 2, ci.resendThrottle);
137 Assert.AreEqual(landBytes / 2, ci.landThrottle);
138 Assert.AreEqual(windBytes / 2, ci.windThrottle);
139 Assert.AreEqual(cloudBytes / 2, ci.cloudThrottle);
140 Assert.AreEqual(taskBytes / 2, ci.taskThrottle);
141 Assert.AreEqual(textureBytes / 2, ci.textureThrottle);
142 Assert.AreEqual(assetBytes / 2, ci.assetThrottle);
143 Assert.AreEqual(totalBytes, ci.totalThrottle);
144 }
145
146 // Now add another client
147 ScenePresence sp2
148 = ClientStackHelpers.AddChildClient(
149 scene, udpServer, TestHelpers.ParseTail(0x10), TestHelpers.ParseTail(0x20), 123457);
131 150
132 // Console.WriteLine( 151 LLUDPClient udpClient2 = ((LLClientView)sp2.ControllingClient).UDPClient;
133 // "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}", 152 // udpClient.ThrottleDebugLevel = 1;
134 // ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle);
135 153
136 Assert.AreEqual(resendBytes / 2, ci.resendThrottle); 154 SetThrottles(
137 Assert.AreEqual(landBytes / 2, ci.landThrottle); 155 udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
138 Assert.AreEqual(windBytes / 2, ci.windThrottle); 156
139 Assert.AreEqual(cloudBytes / 2, ci.cloudThrottle); 157 {
140 Assert.AreEqual(taskBytes / 2, ci.taskThrottle); 158 ClientInfo ci = udpClient1.GetClientInfo();
141 Assert.AreEqual(textureBytes / 2, ci.textureThrottle); 159
142 Assert.AreEqual(assetBytes / 2, ci.assetThrottle); 160// Console.WriteLine(
143 Assert.AreEqual(totalBytes, ci.totalThrottle); 161// "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}",
162// ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle);
163
164 Assert.AreEqual(resendBytes / 4, ci.resendThrottle);
165 Assert.AreEqual(landBytes / 4, ci.landThrottle);
166 Assert.AreEqual(windBytes / 4, ci.windThrottle);
167 Assert.AreEqual(cloudBytes / 4, ci.cloudThrottle);
168 Assert.AreEqual(taskBytes / 4, ci.taskThrottle);
169 Assert.AreEqual(textureBytes / 4, ci.textureThrottle);
170 Assert.AreEqual(assetBytes / 4, ci.assetThrottle);
171 Assert.AreEqual(totalBytes / 2, ci.totalThrottle);
172 }
173
174 {
175 ClientInfo ci = udpClient2.GetClientInfo();
176
177 // Console.WriteLine(
178 // "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}",
179 // ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle);
180
181 Assert.AreEqual(resendBytes / 4, ci.resendThrottle);
182 Assert.AreEqual(landBytes / 4, ci.landThrottle);
183 Assert.AreEqual(windBytes / 4, ci.windThrottle);
184 Assert.AreEqual(cloudBytes / 4, ci.cloudThrottle);
185 Assert.AreEqual(taskBytes / 4, ci.taskThrottle);
186 Assert.AreEqual(textureBytes / 4, ci.textureThrottle);
187 Assert.AreEqual(assetBytes / 4, ci.assetThrottle);
188 Assert.AreEqual(totalBytes / 2, ci.totalThrottle);
189 }
144 } 190 }
145 191
146 /// <summary> 192 /// <summary>