diff --git a/src/libraries/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs b/src/libraries/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs index b1f7d3eaa64dec..6b7568084952db 100644 --- a/src/libraries/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs +++ b/src/libraries/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs @@ -359,6 +359,7 @@ public static IEnumerable InvalidPrefix_TestData() [Theory] [MemberData(nameof(InvalidPrefix_TestData))] + [SkipOnPlatform(TestPlatforms.FreeBSD, "FreeBSD accepts some inputs as valid and test hangs")] public void Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart(string uriPrefix) { var listener = new HttpListener(); @@ -371,6 +372,7 @@ public void Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart(strin [Theory] [MemberData(nameof(InvalidPrefix_TestData))] + [SkipOnPlatform(TestPlatforms.FreeBSD, "FreeBSD accepts some inputs as valid and test hangs")] public void Add_InvalidPrefixAlreadyStarted_ThrowsHttpListenerExceptionOnAdd(string uriPrefix) { using (var factory = new HttpListenerFactory()) diff --git a/src/libraries/System.Net.HttpListener/tests/HttpListenerResponseTests.cs b/src/libraries/System.Net.HttpListener/tests/HttpListenerResponseTests.cs index dce9cf7010697e..4309b23ad94e61 100644 --- a/src/libraries/System.Net.HttpListener/tests/HttpListenerResponseTests.cs +++ b/src/libraries/System.Net.HttpListener/tests/HttpListenerResponseTests.cs @@ -436,6 +436,7 @@ public async Task CloseResponseEntity_SendToClosedConnection_DoesNotThrow(bool w } [Fact] + [SkipOnPlatform(TestPlatforms.FreeBSD, "unreliable on FreeBSD")] public async Task AddLongHeader_DoesNotThrow() { string longString = new string('a', 65536); diff --git a/src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs b/src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs index 4170efafa4ce7e..841fae8c293ca2 100644 --- a/src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs +++ b/src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs @@ -498,7 +498,7 @@ public async Task Write_ContentToClosedConnectionAsynchronously_ThrowsHttpListen [InlineData(true)] [InlineData(false)] [ActiveIssue("https://github.com/dotnet/runtime/issues/21022", platforms: TestPlatforms.Windows)] // Indeterminate failure - socket not always fully disconnected. - [ActiveIssue("https://github.com/dotnet/runtime/issues/21590", TestPlatforms.OSX)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21590", TestPlatforms.OSX | TestPlatforms.FreeBSD)] public async Task Write_ContentToClosedConnectionSynchronously_ThrowsHttpListenerException(bool ignoreWriteExceptions) { const string Text = "Some-String"; diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/TestConfiguration.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/TestConfiguration.cs index 4bd1b0ee30f9a2..4b4dcaf9b6ae98 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/TestConfiguration.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/TestConfiguration.cs @@ -27,7 +27,7 @@ internal static class TestConfiguration public const string NtlmUserFilePath = "/var/tmp/ntlm_user_file"; public static bool SupportsNullEncryption { get { return s_supportsNullEncryption.Value; } } - public static bool SupportsHandshakeAlerts { get { return OperatingSystem.IsLinux() || OperatingSystem.IsWindows(); } } + public static bool SupportsHandshakeAlerts { get { return OperatingSystem.IsLinux() || OperatingSystem.IsWindows() || OperatingSystem.IsFreeBSD(); } } public static bool SupportsRenegotiation { get { return (OperatingSystem.IsWindows() && !PlatformDetection.IsWindows7) || ((OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD()) && PlatformDetection.OpenSslVersion >= new Version(1, 1, 1)); } } public static Task WhenAllOrAnyFailedWithTimeout(params Task[] tasks) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs index 70205f8033cc49..f7475703b3da10 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs @@ -84,6 +84,7 @@ public async Task Datagram_UDP_ShouldImplicitlyBindLocalEndpoint() } [Fact] + [SkipOnPlatform(TestPlatforms.FreeBSD, "FreeBSD allows sendto() to broadcast")] public async Task Datagram_UDP_AccessDenied_Throws_DoesNotBind() { IPEndPoint invalidEndpoint = new IPEndPoint(IPAddress.Broadcast, 1234); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs index 0bf9bdd45688f4..2d87c58b45905a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs @@ -504,7 +504,7 @@ public void SetIPProtectionLevel_ArgumentException(AddressFamily family) } } - [Theory] + [ConditionalTheory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android)] @@ -515,6 +515,7 @@ public void GetSetRawSocketOption_Roundtrips(AddressFamily family) int SO_RCVBUF; if (OperatingSystem.IsWindows() || + OperatingSystem.IsFreeBSD() || OperatingSystem.IsMacOS()) { SOL_SOCKET = 0xffff; @@ -558,7 +559,7 @@ public void Get_AcceptConnection_Succeeds() s.Bind(new IPEndPoint(IPAddress.Loopback, 0)); s.Listen(); - Assert.Equal(1, s.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.AcceptConnection)); + Assert.NotEqual(0, s.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.AcceptConnection)); } }