backend: require confirmation for signed channel updates [CI]
This commit is contained in:
1 parent
7160de2a36
commit
84f9d211bc
62 files changed
+1717
-70
No files matched your search
@@ -0,0 +1,50 @@
|
||||
using MoShiro.Measurement;
|
||||
|
||||
namespace MoShiro.Measurement.Tests;
|
||||
|
||||
public sealed class Ipv6DiagnosticsTests
|
||||
{
|
||||
[Fact]
|
||||
public void Addresses_IgnoresLocalTentativeFailedAndDeprecatedAddresses()
|
||||
{
|
||||
Assert.Null(Ipv6Diagnostics.ParseAddresses(null));
|
||||
Assert.False(Ipv6Diagnostics.ParseAddresses(""));
|
||||
Assert.False(Ipv6Diagnostics.ParseAddresses("00000000000000000000000000000001 01 80 10 80 lo\nfe800000000000000000000000000001 02 40 20 80 eth0"));
|
||||
foreach (string flags in new[] { "40", "08", "20" })
|
||||
{
|
||||
Assert.False(Ipv6Diagnostics.ParseAddresses($"20010db8000000000000000000000001 02 40 00 {flags} eth0"));
|
||||
}
|
||||
|
||||
Assert.True(Ipv6Diagnostics.ParseAddresses("20010db8000000000000000000000001 02 40 00 80 eth0"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Routes_RequiresAnActiveNonLoopbackDefaultRoute()
|
||||
{
|
||||
Assert.Null(Ipv6Diagnostics.ParseRoutes(null));
|
||||
Assert.False(Ipv6Diagnostics.ParseRoutes(""));
|
||||
string prefix = "00000000000000000000000000000000 00 00000000000000000000000000000000 00 fe800000000000000000000000000001 00000400 00000000 00000000 ";
|
||||
Assert.True(Ipv6Diagnostics.ParseRoutes(prefix + "00000003 eth0"));
|
||||
Assert.False(Ipv6Diagnostics.ParseRoutes(prefix + "00000201 eth0"));
|
||||
Assert.False(Ipv6Diagnostics.ParseRoutes(prefix + "00000001 lo"));
|
||||
Assert.False(Ipv6Diagnostics.ParseRoutes(prefix + "00000000 eth0"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(false, true, true, true, "unsupported")]
|
||||
[InlineData(true, true, false, true, "no_global_address")]
|
||||
[InlineData(true, false, true, true, "not_listening")]
|
||||
[InlineData(true, true, true, false, "no_default_route")]
|
||||
[InlineData(true, true, true, true, "ready")]
|
||||
public void Evaluate_DistinguishesConfigurationFromAddressAndRouting(bool supported, bool listening, bool address, bool route, string expected)
|
||||
{
|
||||
Assert.Equal(expected, Ipv6Diagnostics.Evaluate(supported, listening, address, route).State);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Probe_DoesNotRequireAnInboundListener_AndUnavailableDataStaysUnknown()
|
||||
{
|
||||
Assert.Equal("ready", Ipv6Diagnostics.Evaluate(true, null, true, true).State);
|
||||
Assert.Equal("unknown", Ipv6Diagnostics.Evaluate(true, null, null, null).State);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user