Skip to content

Commit 60f96f0

Browse files
test fixes
1 parent d215043 commit 60f96f0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Aikido.Zen.Test/BlockListTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public void GlobalAllowedSubnets_IPv4AndIPv6()
9191

9292
// Test empty allowed list
9393
_blockList.UpdateAllowedIps(Array.Empty<string>());
94-
Assert.That(_blockList.IsIPAllowed("192.168.1.100"), Is.False);
95-
Assert.That(_blockList.IsIPAllowed("2001:db8:3333:4444:5555:6666:7777:8888"), Is.False);
94+
Assert.That(_blockList.IsIPAllowed("192.168.1.100"), Is.True);
95+
Assert.That(_blockList.IsIPAllowed("2001:db8:3333:4444:5555:6666:7777:8888"), Is.True);
9696
}
9797

9898
[Test]
@@ -114,7 +114,7 @@ public void InvalidIPHandling()
114114
{
115115
Assert.That(_blockList.IsIPBlocked(invalidIp), Is.False, "Invalid IP should not be blocked");
116116
Assert.That(_blockList.IsIPAllowedForEndpoint(invalidIp, "GET|testUrl"), Is.True, "Invalid IP should be allowed for endpoints");
117-
Assert.That(_blockList.IsIPAllowed(invalidIp), Is.True, "Invalid IP should be allowed globally");
117+
Assert.That(_blockList.IsIPAllowed(invalidIp), Is.False, "Invalid IP should not be allowed globally");
118118
}
119119
}
120120

@@ -231,13 +231,13 @@ public void IsBlocked_ShouldProvideCorrectReason()
231231
}
232232

233233
// Now test public IPs with various rules
234-
_blockList.UpdateBlockedIps(new[] { "203.0.113.0/24" });
235-
_blockList.UpdateAllowedIps(new[] { "198.51.100.0/24", "203.0.113.1", "8.8.4.4" });
234+
_blockList.UpdateBlockedIps(new[] { "123.0.113.0/24" });
235+
_blockList.UpdateAllowedIps(new[] { "123.51.100.0/24", "203.0.113.1", "8.8.4.4", "123.0.113.1" });
236236

237237
// Test blocked IP
238238
Assert.Multiple(() =>
239239
{
240-
Assert.That(_blockList.IsBlocked("203.0.113.1", "ANY", out string reason), Is.True);
240+
Assert.That(_blockList.IsBlocked("123.0.113.1", "ANY", out string reason), Is.True);
241241
Assert.That(reason, Is.EqualTo("IP is blocked"));
242242
});
243243

@@ -266,7 +266,7 @@ public void IsBlocked_ShouldProvideCorrectReason()
266266
// Test allowed IP
267267
Assert.Multiple(() =>
268268
{
269-
Assert.That(_blockList.IsBlocked("198.51.100.1", "ANY", out string reason), Is.False);
269+
Assert.That(_blockList.IsBlocked("123.51.100.1", "ANY", out string reason), Is.False);
270270
Assert.That(reason, Is.EqualTo("IP is allowed"));
271271
});
272272
}

coreclr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit ea63985c1cf56b07324f87c54acb4d49875fa360

0 commit comments

Comments
 (0)