Don't fail tests if port 5000 is in use (#1650)
This commit is contained in:
parent
99278c4691
commit
db159190bd
|
|
@ -34,6 +34,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
await RegisterAddresses_Success(addressInput, testUrls);
|
await RegisterAddresses_Success(addressInput, testUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv4Port5000Default))]
|
||||||
|
[PortSupportedCondition(5000)]
|
||||||
|
public async Task RegisterAddresses_IPv4Port5000Default_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
||||||
|
{
|
||||||
|
await RegisterAddresses_Success(addressInput, testUrls);
|
||||||
|
}
|
||||||
|
|
||||||
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv4Port80))]
|
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv4Port80))]
|
||||||
[PortSupportedCondition(80)]
|
[PortSupportedCondition(80)]
|
||||||
public async Task RegisterAddresses_IPv4Port80_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
public async Task RegisterAddresses_IPv4Port80_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
||||||
|
|
@ -63,6 +70,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
await RegisterAddresses_Success(addressInput, testUrls);
|
await RegisterAddresses_Success(addressInput, testUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv6Port5000Default))]
|
||||||
|
[IPv6SupportedCondition]
|
||||||
|
[PortSupportedCondition(5000)]
|
||||||
|
public async Task RegisterAddresses_IPv6Port5000Default_Success(string addressInput, Func<IServerAddressesFeature, string[]> testUrls)
|
||||||
|
{
|
||||||
|
await RegisterAddresses_Success(addressInput, testUrls);
|
||||||
|
}
|
||||||
|
|
||||||
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv6Port80))]
|
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv6Port80))]
|
||||||
[IPv6SupportedCondition]
|
[IPv6SupportedCondition]
|
||||||
[PortSupportedCondition(80)]
|
[PortSupportedCondition(80)]
|
||||||
|
|
@ -273,10 +288,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
{
|
{
|
||||||
var dataset = new TheoryData<string, Func<IServerAddressesFeature, string[]>>();
|
var dataset = new TheoryData<string, Func<IServerAddressesFeature, string[]>>();
|
||||||
|
|
||||||
// Default host and port
|
|
||||||
dataset.Add(null, _ => new[] { "http://127.0.0.1:5000/" });
|
|
||||||
dataset.Add(string.Empty, _ => new[] { "http://127.0.0.1:5000/" });
|
|
||||||
|
|
||||||
// Static ports
|
// Static ports
|
||||||
var port = GetNextPort();
|
var port = GetNextPort();
|
||||||
|
|
||||||
|
|
@ -305,6 +316,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TheoryData<string, Func<IServerAddressesFeature, string[]>> AddressRegistrationDataIPv4Port5000Default =>
|
||||||
|
new TheoryData<string, Func<IServerAddressesFeature, string[]>>
|
||||||
|
{
|
||||||
|
{ null, _ => new[] { "http://127.0.0.1:5000/" } },
|
||||||
|
{ string.Empty, _ => new[] { "http://127.0.0.1:5000/" } }
|
||||||
|
};
|
||||||
|
|
||||||
public static TheoryData<IPEndPoint, Func<IPEndPoint, string>> IPEndPointRegistrationDataRandomPort
|
public static TheoryData<IPEndPoint, Func<IPEndPoint, string>> IPEndPointRegistrationDataRandomPort
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -384,10 +402,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
{
|
{
|
||||||
var dataset = new TheoryData<string, Func<IServerAddressesFeature, string[]>>();
|
var dataset = new TheoryData<string, Func<IServerAddressesFeature, string[]>>();
|
||||||
|
|
||||||
// Default host and port
|
|
||||||
dataset.Add(null, _ => new[] { "http://127.0.0.1:5000/", "http://[::1]:5000/" });
|
|
||||||
dataset.Add(string.Empty, _ => new[] { "http://127.0.0.1:5000/", "http://[::1]:5000/" });
|
|
||||||
|
|
||||||
// Static ports
|
// Static ports
|
||||||
var port = GetNextPort();
|
var port = GetNextPort();
|
||||||
|
|
||||||
|
|
@ -422,6 +436,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TheoryData<string, Func<IServerAddressesFeature, string[]>> AddressRegistrationDataIPv6Port5000Default =>
|
||||||
|
new TheoryData<string, Func<IServerAddressesFeature, string[]>>
|
||||||
|
{
|
||||||
|
{ 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<string, Func<IServerAddressesFeature, string[]>> AddressRegistrationDataIPv6Port80
|
public static TheoryData<string, Func<IServerAddressesFeature, string[]>> AddressRegistrationDataIPv6Port80
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue