Only test binding to "operational" network interfaces
This commit is contained in:
parent
2f36c80970
commit
7e1aa4e1d0
|
|
@ -22,7 +22,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
|||
{
|
||||
public class AddressRegistrationTests
|
||||
{
|
||||
|
||||
[Theory, MemberData(nameof(AddressRegistrationDataIPv4))]
|
||||
public async Task RegisterAddresses_IPv4_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
||||
{
|
||||
|
|
@ -273,6 +272,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
|||
private static IEnumerable<IPAddress> GetIPAddresses()
|
||||
{
|
||||
return NetworkInterface.GetAllNetworkInterfaces()
|
||||
.Where(i => i.OperationalStatus == OperationalStatus.Up)
|
||||
.SelectMany(i => i.GetIPProperties().UnicastAddresses)
|
||||
.Select(a => a.Address);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue