diff --git a/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs b/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs index 01bdf88402..7152851f37 100644 --- a/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs +++ b/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs @@ -46,6 +46,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests await RegisterAddresses_Success(addressInput, testUrl); } + [ConditionalTheory] + [MemberData(nameof(AddressRegistrationDataIPv4Port5000Default))] + public async Task RegisterAddresses_IPv4Port5000Default_Success(string addressInput, string testUrl) + { + if (!CanBindToEndpoint(IPAddress.Loopback, 5000)) + { + return; + } + + await RegisterAddresses_Success(addressInput, testUrl, 5000); + } + [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv4Port80))] public async Task RegisterAddresses_IPv4Port80_Success(string addressInput, string testUrl) @@ -112,6 +124,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests await RegisterAddresses_Success(addressInput, testUrls); } + [ConditionalTheory] + [MemberData(nameof(AddressRegistrationDataIPv6Port5000Default))] + [IPv6SupportedCondition] + public async Task RegisterAddresses_IPv6Port5000Default_Success(string addressInput, string[] testUrls) + { + if (!CanBindToEndpoint(IPAddress.Loopback, 5000) || !CanBindToEndpoint(IPAddress.IPv6Loopback, 5000)) + { + return; + } + + await RegisterAddresses_Success(addressInput, testUrls); + } + [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv6Port80))] [IPv6SupportedCondition] @@ -845,6 +870,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } + public static TheoryData AddressRegistrationDataIPv4Port5000Default => + new TheoryData + { + { null, "http://127.0.0.1:5000/" }, + { string.Empty, "http://127.0.0.1:5000/" } + }; + public static TheoryData IPEndPointRegistrationDataDynamicPort { get @@ -942,6 +974,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } + public static TheoryData AddressRegistrationDataIPv6Port5000Default => + new TheoryData + { + { null, new[] { "http://127.0.0.1:5000/", "http://[::1]:5000/" } }, + { string.Empty, new[] { "http://127.0.0.1:5000/", "http://[::1]:5000/" } } + }; + public static TheoryData AddressRegistrationDataIPv6Port80 => new TheoryData {