fix: Exempts localhost from IPLimiter. Preps testing for io_uring (#2316)

### Summary
* Exempts localhost from IPLimiter
* Updates tests to have proper sequential testing with packets
* Updates tests to clean up NetState
This commit is contained in:
Kamron Batman 2026-01-20 08:54:15 -08:00 • committed by GitHub
parent 8133983b64
commit 1e4c32c809
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 4612 additions and 4616 deletions

View file

@ -1,35 +1,35 @@
using Server.Network;
using Xunit;
namespace Server.Tests.Network
namespace Server.Tests.Network;
[Collection("Sequential Server Tests")]
public class LightPacketTests
{
public class LightPacketTests
[Fact]
public void TestGlobalLightLevel()
{
[Fact]
public void TestGlobalLightLevel()
{
const byte lightLevel = 5;
var expected = new GlobalLightLevel(lightLevel).Compile();
const byte lightLevel = 5;
var expected = new GlobalLightLevel(lightLevel).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendGlobalLightLevel(lightLevel);
using var ns = PacketTestUtilities.CreateTestNetState();
ns.SendGlobalLightLevel(lightLevel);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
[Fact]
public void TestPersonalLightLevel()
{
var serial = (Serial)0x1024;
byte lightLevel = 5;
var expected = new PersonalLightLevel(serial, lightLevel).Compile();
[Fact]
public void TestPersonalLightLevel()
{
var serial = (Serial)0x1024;
byte lightLevel = 5;
var expected = new PersonalLightLevel(serial, lightLevel).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendPersonalLightLevel(serial, lightLevel);
using var ns = PacketTestUtilities.CreateTestNetState();
ns.SendPersonalLightLevel(serial, lightLevel);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
}