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
|
public class AddressRegistrationTests
|
||||||
{
|
{
|
||||||
|
|
||||||
[Theory, MemberData(nameof(AddressRegistrationDataIPv4))]
|
[Theory, MemberData(nameof(AddressRegistrationDataIPv4))]
|
||||||
public async Task RegisterAddresses_IPv4_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
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()
|
private static IEnumerable<IPAddress> GetIPAddresses()
|
||||||
{
|
{
|
||||||
return NetworkInterface.GetAllNetworkInterfaces()
|
return NetworkInterface.GetAllNetworkInterfaces()
|
||||||
|
.Where(i => i.OperationalStatus == OperationalStatus.Up)
|
||||||
.SelectMany(i => i.GetIPProperties().UnicastAddresses)
|
.SelectMany(i => i.GetIPProperties().UnicastAddresses)
|
||||||
.Select(a => a.Address);
|
.Select(a => a.Address);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue