From 87f7db329e13862fe4e8c75476d23f72c2fa9244 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 10:22:42 -0400 Subject: [PATCH 01/28] PNSE for domain sockets on iOS/tvOS --- .../Common/src/System/Net/SocketProtocolSupportPal.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index a61f47a0fa458..04f3d8846bb89 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Net.Sockets; +using System.Runtime.InteropServices; namespace System.Net { @@ -12,7 +13,8 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); + // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); private static bool IsIPv6Disabled() { From d17c748f6a6d60a4a09a519d1e77d4d58f87a383 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 10:26:57 -0400 Subject: [PATCH 02/28] Re-enable some tests which SHOULD now throw PNSE --- .../System.IO/tests/StreamReader/StreamReaderTests.cs | 1 - src/libraries/tests.proj | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 24cf85352ff2d..26d0a46c628d0 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -556,7 +556,6 @@ public async Task ReadBlockAsync_RepeatsReadsUntilReadDesiredAmount() [InlineData(1, true)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51390", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled) { Func> func = method switch diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index af0b5dd006ef4..be3edb3215463 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -339,11 +339,6 @@ - - - - - From 401a14d00c37aea64157398fd9f0695bd22ec1e9 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 14:25:20 -0400 Subject: [PATCH 03/28] Try handling Catalyst==iOS case better --- .../Common/src/System/Net/SocketProtocolSupportPal.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index 04f3d8846bb89..9332b18a1554f 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -14,7 +14,9 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); + // Mac Catalyst returns true on iOS tests, so we need to explicitly check for the case + // "is iOS but not Catalyst" as unsupported, but Catalyst itself is supported. + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")) && (!RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")) || RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST"))); private static bool IsIPv6Disabled() { From 394cbfbbbae2bb1725b1d9af8f1b216b9f194da2 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 14:27:15 -0400 Subject: [PATCH 04/28] Move "sockets supported" check _before_ "socket path name too long" check --- .../src/System/Net/Sockets/UnixDomainSocketEndPoint.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs index 0a06e5d418fda..6a767ffbd2473 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs @@ -44,6 +44,11 @@ private UnixDomainSocketEndPoint(string path, string? boundFileName) bufferLength++; } + if (!Socket.OSSupportsUnixDomainSockets) + { + throw new PlatformNotSupportedException(); + } + if (path.Length == 0 || bufferLength > s_nativePathLength) { throw new ArgumentOutOfRangeException( @@ -55,11 +60,6 @@ private UnixDomainSocketEndPoint(string path, string? boundFileName) _encodedPath = new byte[bufferLength]; int bytesEncoded = Encoding.UTF8.GetBytes(path, 0, path.Length, _encodedPath, 0); Debug.Assert(bufferLength - (isAbstract ? 0 : 1) == bytesEncoded); - - if (!Socket.OSSupportsUnixDomainSockets) - { - throw new PlatformNotSupportedException(); - } } internal static int MaxAddressSize => s_nativeAddressSize; From 2f7ff832f6288d59404ffd6bcd6bd2560007cf23 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 14:33:52 -0400 Subject: [PATCH 05/28] Newer API, from Jan --- .../Common/src/System/Net/SocketProtocolSupportPal.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index 9332b18a1554f..db9bcf56b6747 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -14,9 +14,9 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind - // Mac Catalyst returns true on iOS tests, so we need to explicitly check for the case + // Mac Catalyst returns true on iOS tests, so we need to explicitly check for the case // "is iOS but not Catalyst" as unsupported, but Catalyst itself is supported. - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")) && (!RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")) || RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST"))); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()); private static bool IsIPv6Disabled() { From 995cf18d55285c5de3b45189f69362a3c5f82c7d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Aug 2022 17:50:19 -0400 Subject: [PATCH 06/28] Skip various tests on iOS/tvOS explicitly. The same ones which fail on Linux Bionic, which has a similar problem --- .../Common/src/System/Net/SocketProtocolSupportPal.cs | 2 +- .../tests/NamedPipeTests/NamedPipeTest.CreateServer.cs | 3 +++ .../tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs | 3 +++ .../tests/NamedPipeTests/NamedPipeTest.Specific.cs | 9 +++++++++ .../System.IO/tests/StreamReader/StreamReaderTests.cs | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index db9bcf56b6747..9223283f9cea7 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -14,7 +14,7 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind - // Mac Catalyst returns true on iOS tests, so we need to explicitly check for the case + // Mac Catalyst returns true on IsIOS, so we need to explicitly check for the case // "is iOS but not Catalyst" as unsupported, but Catalyst itself is supported. public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()); diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index 412010a0c9953..3bf00e59776ae 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs @@ -56,6 +56,7 @@ public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirec [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Create_PipeName() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName()).Dispose(); @@ -63,6 +64,7 @@ public static void Create_PipeName() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Create_PipeName_Direction_MaxInstances() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1).Dispose(); @@ -208,6 +210,7 @@ public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedE [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // accessing SafePipeHandle on Unix fails for a non-connected stream [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException() { using (var pipe = new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1, PipeTransmissionMode.Byte)) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs index 858c7a77fff6f..009b8bf4cc0d7 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs @@ -15,6 +15,7 @@ public sealed class NamedPipeTest_CrossProcess { [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void InheritHandles_AvailableInChildProcess() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -47,6 +48,7 @@ void ChildFunc(string handle) [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void PingPong_Sync() { // Create names for two pipes @@ -74,6 +76,7 @@ public void PingPong_Sync() [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task PingPong_Async() { // Create names for two pipes diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 6f653c836a880..7257522560f87 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -86,6 +86,7 @@ public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException( [InlineData(1)] [InlineData(3)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -122,6 +123,7 @@ async Task ConnectClientAndReadAsync() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void MaxNumberOfServerInstances_TooManyServers_Throws() { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -160,6 +162,7 @@ public void MaxNumberOfServerInstances_TooManyServers_Throws() [InlineData(1)] [InlineData(4)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -357,6 +360,7 @@ public async Task Windows_GetImpersonationUserName_Succeed(TokenImpersonationLev [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invoke to verify the user name [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task Unix_GetImpersonationUserName_Succeed() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -388,6 +392,7 @@ public void Unix_MessagePipeTransmissionMode() [InlineData(PipeDirection.InOut)] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implementation uses bidirectional sockets [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Unix_BufferSizeRoundtripping(PipeDirection direction) { int desiredBufferSize = 0; @@ -452,6 +457,7 @@ public static void Windows_BufferSizeRoundtripping() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task PipeTransmissionMode_Returns_Byte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -508,6 +514,7 @@ public void Windows_SetReadModeTo__PipeTransmissionModeByte() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix doesn't currently support message mode [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void Unix_SetReadModeTo__PipeTransmissionModeByte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -549,6 +556,7 @@ public void Unix_SetReadModeTo__PipeTransmissionModeByte() [InlineData(PipeDirection.Out, PipeDirection.In)] [InlineData(PipeDirection.In, PipeDirection.Out)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection serverDirection, PipeDirection clientDirection) { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -567,6 +575,7 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void NameTooLong_MaxLengthPerPlatform() { // Increase a name's length until it fails diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 26d0a46c628d0..600e750c46058 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -556,6 +556,7 @@ public async Task ReadBlockAsync_RepeatsReadsUntilReadDesiredAmount() [InlineData(1, true)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled) { Func> func = method switch From f383463997b90c16cb464d914760f6a7b522986a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 08:33:18 -0400 Subject: [PATCH 07/28] Update src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs Co-authored-by: Theodore Tsirpanis --- src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index 9223283f9cea7..19a3c254f89be 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -16,7 +16,7 @@ internal static partial class SocketProtocolSupportPal // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind // Mac Catalyst returns true on IsIOS, so we need to explicitly check for the case // "is iOS but not Catalyst" as unsupported, but Catalyst itself is supported. - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()); + public static bool OSSupportsUnixDomainSockets { get; } = !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()) && IsSupported(AddressFamily.Unix); private static bool IsIPv6Disabled() { From 489e1d9abb316d0fe24549c6d0425edd2691c7ac Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 08:44:48 -0400 Subject: [PATCH 08/28] Try to mark up unrunnable #67853 tests, and reenable the rest to see --- .../System/IO/StreamConformanceTests.cs | 47 +++++++++---------- .../tests/Base/FileGetSetAttributes.cs | 1 - .../tests/Directory/CreateDirectory.cs | 1 - .../tests/Directory/Delete.cs | 2 - .../tests/Directory/Exists.cs | 2 +- .../Directory/GetFileSystemEntries_str_str.cs | 1 - .../tests/Directory/GetLogicalDrives.cs | 1 - .../tests/DirectoryInfo/Exists.cs | 2 +- .../System.IO.FileSystem/tests/File/Exists.cs | 2 +- .../tests/File/ReadWriteAllBytes.cs | 2 +- .../tests/File/ReadWriteAllBytesAsync.cs | 2 +- .../tests/FileInfo/Exists.cs | 2 +- .../FileStream/DevicesPipesAndSockets.cs | 4 +- .../tests/Path/Exists_File.cs | 2 +- 14 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 1c21996128bf6..7226fa6617d8e 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -722,7 +722,6 @@ public abstract class StandaloneStreamConformanceTests : StreamConformanceTests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public virtual async Task ArgumentValidation_ThrowsExpectedException() { await foreach (Stream? stream in GetStreamsForValidation()) @@ -736,7 +735,6 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public virtual async Task Disposed_ThrowsObjectDisposedException() { await foreach (Stream? stream in GetStreamsForValidation()) @@ -801,7 +799,6 @@ public virtual async Task Write_Nop_Success(ReadWriteMode mode) [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) { const byte Expected = 42; @@ -1635,7 +1632,7 @@ protected static bool Bidirectional(StreamPair streams) => streams.Stream2.CanRead && streams.Stream2.CanWrite; [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ArgumentValidation_ThrowsExpectedException() { @@ -1648,7 +1645,7 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Disposed_ThrowsObjectDisposedException() { @@ -1662,7 +1659,7 @@ public virtual async Task Disposed_ThrowsObjectDisposedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException() { @@ -1677,7 +1674,7 @@ public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellatio [Theory] [InlineData(0)] [InlineData(100)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationException(int cancellationDelay) { @@ -1690,7 +1687,7 @@ public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationExceptio [Theory] [InlineData(0)] [InlineData(100)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationException(int cancellationDelay) { @@ -1701,7 +1698,7 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWriteByte_Success() { @@ -1775,7 +1772,7 @@ public virtual async Task ReadWrite_Success_Large(ReadWriteMode mode, int writeS [Theory] [MemberData(nameof(ReadWrite_Success_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) { @@ -1833,7 +1830,7 @@ public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, b [Theory] [MemberData(nameof(ReadWrite_Modes))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWriteMode mode) { @@ -1883,7 +1880,7 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr [Theory] [MemberData(nameof(AllReadWriteModesAndValue), false)] [MemberData(nameof(AllReadWriteModesAndValue), true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailableFirst) { @@ -1923,7 +1920,7 @@ public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailab [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) { @@ -1954,7 +1951,7 @@ public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Write_DataReadFromDesiredOffset(ReadWriteMode mode) { @@ -2054,7 +2051,7 @@ public static IEnumerable ReadAsync_ContinuesOnCurrentContextIfDesired [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2138,7 +2135,7 @@ public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDe [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentTaskSchedulerIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2229,7 +2226,7 @@ await Task.Factory.StartNew(() => [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteMode mode) { @@ -2297,7 +2294,7 @@ public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteM [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteMode mode) { @@ -2352,7 +2349,7 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM [Theory] [InlineData(false)] [InlineData(true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_CustomMemoryManager_Success(bool useAsync) { @@ -2475,7 +2472,7 @@ public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => [Theory] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) { @@ -2515,7 +2512,7 @@ await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Timeout_Roundtrips() { @@ -2551,7 +2548,7 @@ public virtual async Task Timeout_Roundtrips() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadTimeout_Expires_Throws() { @@ -2688,7 +2685,7 @@ public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() { @@ -2704,7 +2701,7 @@ public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Flush_ValidOnReadableStream_Success() { @@ -2723,7 +2720,7 @@ public virtual async Task Flush_ValidOnReadableStream_Success() [InlineData(0)] [InlineData(1)] [InlineData(2)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Dispose_ClosesStream(int disposeMode) { diff --git a/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs b/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs index cbf6e8eadeea6..9e9ad35ac0f34 100644 --- a/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs +++ b/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs @@ -81,7 +81,6 @@ public void SettingInvalidAttributes_Unix(FileAttributes attributes) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))] [InlineData(FileAttributes.Hidden)] [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void SettingInvalidAttributes_UnixExceptOSXAndFreeBSD(FileAttributes attributes) { string path = CreateItem(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index 988914e56f00d..3eb39368912e2 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -468,7 +468,6 @@ public void DriveLetter_Windows() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // drive letters casing - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void DriveLetter_Unix() { // On Unix, there's no special casing for drive letters. These may or may not be valid names, depending diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs index fa6cc76cda47b..414c8f51a8986 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -122,7 +122,6 @@ public void DeletingSymLinkDoesntDeleteTarget() } [ConditionalFact(nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void ExtendedDirectoryWithSubdirectories() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -132,7 +131,6 @@ public void ExtendedDirectoryWithSubdirectories() } [ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void LongPathExtendedDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500)); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index b5daf1323139b..0ed92de3ce0eb 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -394,7 +394,7 @@ public void ExtendedPathAlreadyExistsAsFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Makes call to native code (libc) - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs index 7ccdc8bcb3f93..8ae44e8899272 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs @@ -698,7 +698,6 @@ public void WindowsSearchPatternWhitespace() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void SearchPatternCaseSensitive() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs b/src/libraries/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs index 3f0dc42e96e99..0061ab46b077a 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs @@ -11,7 +11,6 @@ public class Directory_GetLogicalDrives { [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Valid drive strings on Unix - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] public void GetsValidDriveStrings_Unix() { string[] drives = Directory.GetLogicalDrives(); diff --git a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs index d0f3d095d2da0..5385f79fa3fc9 100644 --- a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs @@ -109,7 +109,7 @@ public void FalseForFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs index 48d87fc2b7946..50f1f4c5477f9 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs @@ -255,7 +255,7 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs index a3abe2311868e..29992a80dc631 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs @@ -194,7 +194,7 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public async Task ReadAllBytes_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs index 8ae63fe3c9e0a..4c1347f5e0d83 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs @@ -204,7 +204,7 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public async Task ReadAllBytesAsync_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs index 04e13706db656..c0cf8ea1ec3ce 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs @@ -90,7 +90,7 @@ public void FalseForDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs index 86a4901b344ce..17efe194f705f 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs @@ -63,7 +63,7 @@ public async Task CharacterDevice_WriteAllTextAsync(string devicePath) [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task NamedPipe_ReadWrite() { @@ -85,7 +85,7 @@ await Task.WhenAll( [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task NamedPipe_ReadWrite_Async() { diff --git a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs index 652d348b5c3f3..108c63f5ce4fd 100644 --- a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs +++ b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs @@ -22,7 +22,7 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); From 437fd7916abcaa9343d72fcaca9295a427d0e5cc Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 09:56:53 -0400 Subject: [PATCH 09/28] Maybe mkfifo works after all? Try it out --- src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs | 1 - src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs | 1 - src/libraries/System.IO.FileSystem/tests/File/Exists.cs | 1 - .../System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs | 1 - .../System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs | 1 - src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs | 1 - src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs | 1 - 7 files changed, 7 deletions(-) diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index 0ed92de3ce0eb..feaad06c3e0d2 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -394,7 +394,6 @@ public void ExtendedPathAlreadyExistsAsFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Makes call to native code (libc) - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs index 5385f79fa3fc9..9c076d4ddaead 100644 --- a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs @@ -109,7 +109,6 @@ public void FalseForFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs index 50f1f4c5477f9..ff2c8845bc58a 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs @@ -255,7 +255,6 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs index 29992a80dc631..0cf553e3c5f4b 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs @@ -194,7 +194,6 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public async Task ReadAllBytes_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs index 4c1347f5e0d83..7c76ff3397b2f 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs @@ -204,7 +204,6 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public async Task ReadAllBytesAsync_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs index c0cf8ea1ec3ce..4435b64befbcc 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs @@ -90,7 +90,6 @@ public void FalseForDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs index 108c63f5ce4fd..64af8e84c009d 100644 --- a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs +++ b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs @@ -22,7 +22,6 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks mkfifo")] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); From 99771fa5449d67b9443365b7d497959d741c6f1a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 10:07:27 -0400 Subject: [PATCH 10/28] YOLO --- .../System/IO/StreamConformanceTests.cs | 22 ------------------- .../FileStream/DevicesPipesAndSockets.cs | 2 -- .../NamedPipeTest.CreateServer.cs | 3 --- .../NamedPipeTest.CrossProcess.cs | 3 --- .../NamedPipeTests/NamedPipeTest.Specific.cs | 9 -------- .../tests/StreamReader/StreamReaderTests.cs | 1 - 6 files changed, 40 deletions(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 7226fa6617d8e..83b6b0bcb0084 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -1632,7 +1632,6 @@ protected static bool Bidirectional(StreamPair streams) => streams.Stream2.CanRead && streams.Stream2.CanWrite; [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ArgumentValidation_ThrowsExpectedException() { @@ -1645,7 +1644,6 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Disposed_ThrowsObjectDisposedException() { @@ -1659,7 +1657,6 @@ public virtual async Task Disposed_ThrowsObjectDisposedException() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException() { @@ -1674,7 +1671,6 @@ public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellatio [Theory] [InlineData(0)] [InlineData(100)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationException(int cancellationDelay) { @@ -1687,7 +1683,6 @@ public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationExceptio [Theory] [InlineData(0)] [InlineData(100)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationException(int cancellationDelay) { @@ -1698,7 +1693,6 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWriteByte_Success() { @@ -1772,7 +1766,6 @@ public virtual async Task ReadWrite_Success_Large(ReadWriteMode mode, int writeS [Theory] [MemberData(nameof(ReadWrite_Success_MemberData))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) { @@ -1830,7 +1823,6 @@ public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, b [Theory] [MemberData(nameof(ReadWrite_Modes))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWriteMode mode) { @@ -1880,7 +1872,6 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr [Theory] [MemberData(nameof(AllReadWriteModesAndValue), false)] [MemberData(nameof(AllReadWriteModesAndValue), true)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailableFirst) { @@ -1920,7 +1911,6 @@ public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailab [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) { @@ -1951,7 +1941,6 @@ public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Write_DataReadFromDesiredOffset(ReadWriteMode mode) { @@ -2051,7 +2040,6 @@ public static IEnumerable ReadAsync_ContinuesOnCurrentContextIfDesired [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2135,7 +2123,6 @@ public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDe [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentTaskSchedulerIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2226,7 +2213,6 @@ await Task.Factory.StartNew(() => [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteMode mode) { @@ -2294,7 +2280,6 @@ public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteM [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteMode mode) { @@ -2349,7 +2334,6 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM [Theory] [InlineData(false)] [InlineData(true)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadWrite_CustomMemoryManager_Success(bool useAsync) { @@ -2472,7 +2456,6 @@ public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => [Theory] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) { @@ -2512,7 +2495,6 @@ await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Timeout_Roundtrips() { @@ -2548,7 +2530,6 @@ public virtual async Task Timeout_Roundtrips() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task ReadTimeout_Expires_Throws() { @@ -2685,7 +2666,6 @@ public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() { @@ -2701,7 +2681,6 @@ public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Flush_ValidOnReadableStream_Success() { @@ -2720,7 +2699,6 @@ public virtual async Task Flush_ValidOnReadableStream_Success() [InlineData(0)] [InlineData(1)] [InlineData(2)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public virtual async Task Dispose_ClosesStream(int disposeMode) { diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs index 17efe194f705f..2f9d802cf3fd4 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs @@ -63,7 +63,6 @@ public async Task CharacterDevice_WriteAllTextAsync(string devicePath) [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task NamedPipe_ReadWrite() { @@ -85,7 +84,6 @@ await Task.WhenAll( [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task NamedPipe_ReadWrite_Async() { diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index 3bf00e59776ae..412010a0c9953 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs @@ -56,7 +56,6 @@ public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirec [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Create_PipeName() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName()).Dispose(); @@ -64,7 +63,6 @@ public static void Create_PipeName() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Create_PipeName_Direction_MaxInstances() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1).Dispose(); @@ -210,7 +208,6 @@ public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedE [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // accessing SafePipeHandle on Unix fails for a non-connected stream [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException() { using (var pipe = new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1, PipeTransmissionMode.Byte)) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs index 009b8bf4cc0d7..858c7a77fff6f 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs @@ -15,7 +15,6 @@ public sealed class NamedPipeTest_CrossProcess { [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void InheritHandles_AvailableInChildProcess() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -48,7 +47,6 @@ void ChildFunc(string handle) [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void PingPong_Sync() { // Create names for two pipes @@ -76,7 +74,6 @@ public void PingPong_Sync() [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task PingPong_Async() { // Create names for two pipes diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 7257522560f87..6f653c836a880 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -86,7 +86,6 @@ public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException( [InlineData(1)] [InlineData(3)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -123,7 +122,6 @@ async Task ConnectClientAndReadAsync() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void MaxNumberOfServerInstances_TooManyServers_Throws() { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -162,7 +160,6 @@ public void MaxNumberOfServerInstances_TooManyServers_Throws() [InlineData(1)] [InlineData(4)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -360,7 +357,6 @@ public async Task Windows_GetImpersonationUserName_Succeed(TokenImpersonationLev [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invoke to verify the user name [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task Unix_GetImpersonationUserName_Succeed() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -392,7 +388,6 @@ public void Unix_MessagePipeTransmissionMode() [InlineData(PipeDirection.InOut)] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implementation uses bidirectional sockets [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public static void Unix_BufferSizeRoundtripping(PipeDirection direction) { int desiredBufferSize = 0; @@ -457,7 +452,6 @@ public static void Windows_BufferSizeRoundtripping() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task PipeTransmissionMode_Returns_Byte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -514,7 +508,6 @@ public void Windows_SetReadModeTo__PipeTransmissionModeByte() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix doesn't currently support message mode [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void Unix_SetReadModeTo__PipeTransmissionModeByte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -556,7 +549,6 @@ public void Unix_SetReadModeTo__PipeTransmissionModeByte() [InlineData(PipeDirection.Out, PipeDirection.In)] [InlineData(PipeDirection.In, PipeDirection.Out)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection serverDirection, PipeDirection clientDirection) { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -575,7 +567,6 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public void NameTooLong_MaxLengthPerPlatform() { // Increase a name's length until it fails diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 600e750c46058..26d0a46c628d0 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -556,7 +556,6 @@ public async Task ReadBlockAsync_RepeatsReadsUntilReadDesiredAmount() [InlineData(1, true)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS 10.0+ blocks UNIX sockets")] public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled) { Func> func = method switch From 17e9b6281c41f3d3e331432c6d1b341a73a939eb Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 10:09:17 -0400 Subject: [PATCH 11/28] YOLO2 --- .../Common/src/System/Net/SocketProtocolSupportPal.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index 19a3c254f89be..a61f47a0fa458 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Net.Sockets; -using System.Runtime.InteropServices; namespace System.Net { @@ -13,10 +12,7 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); - // iOS/tvOS ostensibly has AF_UNIX, but throws EPERM on iOS/tvOS 10.0+ on bind - // Mac Catalyst returns true on IsIOS, so we need to explicitly check for the case - // "is iOS but not Catalyst" as unsupported, but Catalyst itself is supported. - public static bool OSSupportsUnixDomainSockets { get; } = !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()) && IsSupported(AddressFamily.Unix); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); private static bool IsIPv6Disabled() { From 41baae1672e1c94a11fe10519068a97e6d187865 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 13:40:07 -0400 Subject: [PATCH 12/28] Actually run UDS tests on iOS derivs --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 28432569547fe..98ea9f6815252 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -30,7 +30,6 @@ public void OSSupportsUnixDomainSockets_ReturnsCorrectValue() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { @@ -86,7 +85,6 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() { string path = GetRandomNonExistingFilePath(); @@ -125,7 +123,6 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public void Socket_SendReceive_Success() { @@ -158,7 +155,6 @@ public void Socket_SendReceive_Success() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public void Socket_SendReceive_Clone_Success() { @@ -204,7 +200,6 @@ public void Socket_SendReceive_Clone_Success() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task Socket_SendReceiveAsync_Success() { @@ -242,7 +237,6 @@ public async Task Socket_SendReceiveAsync_Success() [InlineData(500, 18, 21)] [InlineData(500, 21, 18)] [InlineData(5, 128000, 64000)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iterations, int writeBufferSize, int readBufferSize) { @@ -299,7 +293,6 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] [InlineData(false)] [InlineData(true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task ConcurrentSendReceive(bool forceNonBlocking) { @@ -343,7 +336,6 @@ public async Task ConcurrentSendReceive(bool forceNonBlocking) } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public async Task ConcurrentSendReceiveAsync() { @@ -399,7 +391,6 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] [InlineData(false)] [InlineData(true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress) { @@ -534,7 +525,6 @@ public void AbstractPathEquality() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void FilePathEquality() { string path1 = "relative" + Path.DirectorySeparatorChar + "path"; From 818b93433d11673ce8000191878febb60cbad430 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 13:51:52 -0400 Subject: [PATCH 13/28] Shrink socket path, just for sanity testing --- .../System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs index 165c9787c6875..116a7c2bc4159 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs @@ -30,7 +30,7 @@ public abstract partial class PipeStream : Stream private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars(); /// Prefix to prepend to all pipe names. - private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_"); + private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) ? "x" :"CoreFxPipe_"); public override int Read(byte[] buffer, int offset, int count) { From 855fe09af53d1a6dde7cfd3d420d3f0f70059e1d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 17:02:10 -0400 Subject: [PATCH 14/28] Make test not increase UDS path by 1-32 characters --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 98ea9f6815252..473ced31a07e7 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -544,11 +544,22 @@ public void FilePathEquality() private static string GetRandomNonExistingFilePath() { + FieldInfo fi = typeof(UnixDomainSocketEndPoint).GetField("s_nativePathLength", BindingFlags.Static | BindingFlags.NonPublic); + Assert.NotNull(fi); + int maxNativeSize = (int)fi.GetValue(null); + // check whether path lengths could even work on this platform + Assert.True(Path.GetTempPath() + 1 < maxNativeSize) + string result; do { // get random name and append random number of characters to get variable name length. result = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + new string('A', Random.Shared.Next(1, 32))); + // truncate result to fit + if (result.Length > maxNativeSize) + { + result = result.SubString(maxNativeSize); + } } while (File.Exists(result)); From 227bbe996eec4604e7e8a531fbc70d3caff43b84 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 17:11:09 -0400 Subject: [PATCH 15/28] Better approach --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 473ced31a07e7..def0ecbf97fa1 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -544,22 +544,18 @@ public void FilePathEquality() private static string GetRandomNonExistingFilePath() { + // ensure we have room for at least one random character appended to the UDS path FieldInfo fi = typeof(UnixDomainSocketEndPoint).GetField("s_nativePathLength", BindingFlags.Static | BindingFlags.NonPublic); Assert.NotNull(fi); int maxNativeSize = (int)fi.GetValue(null); - // check whether path lengths could even work on this platform - Assert.True(Path.GetTempPath() + 1 < maxNativeSize) + int remainingUDSPathChars = maxNativeSize - Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()).Length; + Assert.True(remainingUDSPathChars > 0); string result; do { // get random name and append random number of characters to get variable name length. - result = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + new string('A', Random.Shared.Next(1, 32))); - // truncate result to fit - if (result.Length > maxNativeSize) - { - result = result.SubString(maxNativeSize); - } + result = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + new string('A', Random.Shared.Next(0, remainingUDSPathChars))); } while (File.Exists(result)); From d814cc050a26361bdb7c38092edf7e3eb42dc50a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 17:13:12 -0400 Subject: [PATCH 16/28] Limit last change to 32 chars of randomness --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index def0ecbf97fa1..75816370d1a65 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -548,7 +548,7 @@ private static string GetRandomNonExistingFilePath() FieldInfo fi = typeof(UnixDomainSocketEndPoint).GetField("s_nativePathLength", BindingFlags.Static | BindingFlags.NonPublic); Assert.NotNull(fi); int maxNativeSize = (int)fi.GetValue(null); - int remainingUDSPathChars = maxNativeSize - Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()).Length; + int remainingUDSPathChars = Math.Min(32, maxNativeSize - Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()).Length); Assert.True(remainingUDSPathChars > 0); string result; From 0d38fb8080622f37b92b17b0edd386aa3a45864f Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 5 Aug 2022 23:16:24 -0400 Subject: [PATCH 17/28] Annotate Assert, since just 'True != False' is unhelpful --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 75816370d1a65..a1c20f82ac2ad 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -549,7 +549,7 @@ private static string GetRandomNonExistingFilePath() Assert.NotNull(fi); int maxNativeSize = (int)fi.GetValue(null); int remainingUDSPathChars = Math.Min(32, maxNativeSize - Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()).Length); - Assert.True(remainingUDSPathChars > 0); + Assert.True(remainingUDSPathChars > 0, "Path to UDS on this platform is too long."); string result; do From d79e29337077af1b2e92c55c5a0c8d8ea2a05010 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 10:08:53 -0400 Subject: [PATCH 18/28] Okay, CONFIRMED: PNSE on iOS/tvOS --- src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index a61f47a0fa458..7b84692ff047d 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -12,7 +12,7 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()); private static bool IsIPv6Disabled() { From e7ab37359da8adc772511f82fd5391a805f7cc38 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 10:18:10 -0400 Subject: [PATCH 19/28] Try to fix up UDS-specific test failures on iOS/tvOS --- .../System/IO/StreamConformanceTests.cs | 25 +++++++++++++++++++ .../FileStream/DevicesPipesAndSockets.cs | 2 ++ .../src/System/IO/Pipes/PipeStream.Unix.cs | 2 +- .../tests/StreamReader/StreamReaderTests.cs | 1 + 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 83b6b0bcb0084..a889bdf462319 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -1633,6 +1633,7 @@ protected static bool Bidirectional(StreamPair streams) => [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ArgumentValidation_ThrowsExpectedException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1645,6 +1646,7 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Disposed_ThrowsObjectDisposedException() { StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1658,6 +1660,7 @@ public virtual async Task Disposed_ThrowsObjectDisposedException() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1672,6 +1675,7 @@ public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellatio [InlineData(0)] [InlineData(100)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationException(int cancellationDelay) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1684,6 +1688,7 @@ public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationExceptio [InlineData(0)] [InlineData(100)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationException(int cancellationDelay) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1694,6 +1699,7 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWriteByte_Success() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1767,6 +1773,7 @@ public virtual async Task ReadWrite_Success_Large(ReadWriteMode mode, int writeS [Theory] [MemberData(nameof(ReadWrite_Success_MemberData))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) { foreach (CancellationToken nonCanceledToken in new[] { CancellationToken.None, new CancellationTokenSource().Token }) @@ -1824,6 +1831,7 @@ public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, b [Theory] [MemberData(nameof(ReadWrite_Modes))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWriteMode mode) { if (!FlushGuaranteesAllDataWritten) @@ -1873,6 +1881,7 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr [MemberData(nameof(AllReadWriteModesAndValue), false)] [MemberData(nameof(AllReadWriteModesAndValue), true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailableFirst) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1912,6 +1921,7 @@ public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailab [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1942,6 +1952,7 @@ public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Write_DataReadFromDesiredOffset(ReadWriteMode mode) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2041,6 +2052,7 @@ public static IEnumerable ReadAsync_ContinuesOnCurrentContextIfDesired [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx @@ -2124,6 +2136,7 @@ public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDe [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentTaskSchedulerIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx @@ -2214,6 +2227,7 @@ await Task.Factory.StartNew(() => [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteMode mode) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2281,6 +2295,7 @@ public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteM [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteMode mode) { byte[][] buffers = new[] { Array.Empty(), "hello"u8.ToArray(), Array.Empty(), "world"u8.ToArray() }; @@ -2335,6 +2350,7 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_CustomMemoryManager_Success(bool useAsync) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2400,6 +2416,7 @@ await readable.ReadAsync(readBuffer.Memory.Slice(bytesRead)) : [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ConcurrentBidirectionalReadsWrites_Success() { if (!SupportsConcurrentBidirectionalUse) @@ -2457,6 +2474,7 @@ public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => [Theory] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2486,6 +2504,7 @@ public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync [OuterLoop("May take several seconds")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Parallel_ReadWriteMultipleStreamsConcurrently() { await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => @@ -2496,6 +2515,7 @@ await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Timeout_Roundtrips() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2531,6 +2551,7 @@ public virtual async Task Timeout_Roundtrips() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadTimeout_Expires_Throws() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2646,6 +2667,7 @@ public virtual async Task ClosedConnection_WritesFailImmediately_ThrowException( [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() { if (UnsupportedConcurrentExceptionType is null) @@ -2667,6 +2689,7 @@ public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2682,6 +2705,7 @@ public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Flush_ValidOnReadableStream_Success() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2700,6 +2724,7 @@ public virtual async Task Flush_ValidOnReadableStream_Success() [InlineData(1)] [InlineData(2)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Dispose_ClosesStream(int disposeMode) { if (!CansReturnFalseAfterDispose) diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs index 2f9d802cf3fd4..9c9b6ae697fcd 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs @@ -64,6 +64,7 @@ public async Task CharacterDevice_WriteAllTextAsync(string devicePath) [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task NamedPipe_ReadWrite() { string fifoPath = GetTestFilePath(); @@ -85,6 +86,7 @@ await Task.WhenAll( [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task NamedPipe_ReadWrite_Async() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs index 116a7c2bc4159..165c9787c6875 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs @@ -30,7 +30,7 @@ public abstract partial class PipeStream : Stream private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars(); /// Prefix to prepend to all pipe names. - private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) ? "x" :"CoreFxPipe_"); + private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_"); public override int Read(byte[] buffer, int offset, int count) { diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 26d0a46c628d0..59b483a47ba79 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -556,6 +556,7 @@ public async Task ReadBlockAsync_RepeatsReadsUntilReadDesiredAmount() [InlineData(1, true)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled) { Func> func = method switch From 4e763c4ee5808c283856a838a2c381f571155d9a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 10:20:11 -0400 Subject: [PATCH 20/28] Revert change which only benefited tvOS/iOS UDS --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index a1c20f82ac2ad..98ea9f6815252 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -544,18 +544,11 @@ public void FilePathEquality() private static string GetRandomNonExistingFilePath() { - // ensure we have room for at least one random character appended to the UDS path - FieldInfo fi = typeof(UnixDomainSocketEndPoint).GetField("s_nativePathLength", BindingFlags.Static | BindingFlags.NonPublic); - Assert.NotNull(fi); - int maxNativeSize = (int)fi.GetValue(null); - int remainingUDSPathChars = Math.Min(32, maxNativeSize - Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()).Length); - Assert.True(remainingUDSPathChars > 0, "Path to UDS on this platform is too long."); - string result; do { // get random name and append random number of characters to get variable name length. - result = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + new string('A', Random.Shared.Next(0, remainingUDSPathChars))); + result = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + new string('A', Random.Shared.Next(1, 32))); } while (File.Exists(result)); From 80c4b471c24d31c4c05cdea08601d7f9e94420d7 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 13:13:28 -0400 Subject: [PATCH 21/28] Mark more tests as unpassable due to PNSE --- .../NamedPipeTest.CreateServer.cs | 3 +++ .../NamedPipeTests/NamedPipeTest.Specific.cs | 9 +++++++++ .../tests/PipeStreamConformanceTests.cs | 17 +++++++++++++++++ .../FunctionalTests/UnixDomainSocketTest.cs | 9 +++++++++ 4 files changed, 38 insertions(+) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index 412010a0c9953..c6de0d3748419 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs @@ -56,6 +56,7 @@ public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirec [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Create_PipeName() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName()).Dispose(); @@ -63,6 +64,7 @@ public static void Create_PipeName() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Create_PipeName_Direction_MaxInstances() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1).Dispose(); @@ -208,6 +210,7 @@ public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedE [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // accessing SafePipeHandle on Unix fails for a non-connected stream [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException() { using (var pipe = new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1, PipeTransmissionMode.Byte)) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 6f653c836a880..0b29aa64c6d90 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -86,6 +86,7 @@ public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException( [InlineData(1)] [InlineData(3)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -122,6 +123,7 @@ async Task ConnectClientAndReadAsync() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void MaxNumberOfServerInstances_TooManyServers_Throws() { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -160,6 +162,7 @@ public void MaxNumberOfServerInstances_TooManyServers_Throws() [InlineData(1)] [InlineData(4)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -357,6 +360,7 @@ public async Task Windows_GetImpersonationUserName_Succeed(TokenImpersonationLev [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invoke to verify the user name [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Unix_GetImpersonationUserName_Succeed() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -388,6 +392,7 @@ public void Unix_MessagePipeTransmissionMode() [InlineData(PipeDirection.InOut)] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implementation uses bidirectional sockets [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Unix_BufferSizeRoundtripping(PipeDirection direction) { int desiredBufferSize = 0; @@ -452,6 +457,7 @@ public static void Windows_BufferSizeRoundtripping() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task PipeTransmissionMode_Returns_Byte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -508,6 +514,7 @@ public void Windows_SetReadModeTo__PipeTransmissionModeByte() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix doesn't currently support message mode [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Unix_SetReadModeTo__PipeTransmissionModeByte() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -549,6 +556,7 @@ public void Unix_SetReadModeTo__PipeTransmissionModeByte() [InlineData(PipeDirection.Out, PipeDirection.In)] [InlineData(PipeDirection.In, PipeDirection.Out)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection serverDirection, PipeDirection clientDirection) { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -567,6 +575,7 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void NameTooLong_MaxLengthPerPlatform() { // Increase a name's length until it fails diff --git a/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs index 3d03bdc1b2e06..4ad323702d0fe 100644 --- a/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs +++ b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs @@ -120,6 +120,7 @@ public static IEnumerable OneWayReadWritesMemberData() => [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ClonedServer_ActsAsOriginalServer() { byte[] msg1 = new byte[] { 5, 7, 9, 10 }; @@ -159,6 +160,7 @@ public async Task ClonedServer_ActsAsOriginalServer() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ClonedClient_ActsAsOriginalClient() { byte[] msg1 = new byte[] { 5, 7, 9, 10 }; @@ -197,6 +199,7 @@ public async Task ClonedClient_ActsAsOriginalClient() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -208,6 +211,7 @@ public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationExcepti [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperationException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -221,6 +225,7 @@ public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperat [InlineData(0)] [InlineData(100)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task CancelTokenOn_ServerWaitForConnectionAsync_Throws_OperationCanceledException(int cancellationDelay) { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -278,6 +283,7 @@ public async Task CancelTokenOn_ServerWaitForConnectionAsyncWithOuterCancellatio [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task OperationsOnDisconnectedServer() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -315,6 +321,7 @@ public async Task OperationsOnDisconnectedServer() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task OperationsOnDisconnectedClient() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -360,6 +367,7 @@ public virtual async Task OperationsOnDisconnectedClient() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Windows_OperationsOnNamedServerWithDisposedClient() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -384,6 +392,7 @@ public async Task Windows_OperationsOnNamedServerWithDisposedClient() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void OperationsOnUnconnectedServer() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -420,6 +429,7 @@ public void OperationsOnUnconnectedServer() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void OperationsOnUnconnectedClient() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -452,6 +462,7 @@ public void OperationsOnUnconnectedClient() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task DisposedServerPipe_Throws_ObjectDisposedException() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -465,6 +476,7 @@ public async Task DisposedServerPipe_Throws_ObjectDisposedException() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task DisposedClientPipe_Throws_ObjectDisposedException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -478,6 +490,7 @@ public async Task DisposedClientPipe_Throws_ObjectDisposedException() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ReadAsync_DisconnectDuringRead_Returns0() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -490,6 +503,7 @@ public async Task ReadAsync_DisconnectDuringRead_Returns0() [PlatformSpecific(TestPlatforms.Windows)] // Unix named pipes are on sockets, where small writes with an empty buffer will succeed immediately [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] [Fact] public async Task WriteAsync_DisconnectDuringWrite_Throws() { @@ -503,6 +517,7 @@ public async Task WriteAsync_DisconnectDuringWrite_Throws() [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Server_ReadWriteCancelledToken_Throws_OperationCanceledException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -605,6 +620,7 @@ public async Task CancelTokenOn_Server_ReadWriteCancelledToken_Throws_OperationC [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Client_ReadWriteCancelledToken_Throws_OperationCanceledException() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -707,6 +723,7 @@ public async Task CancelTokenOn_Client_ReadWriteCancelledToken_Throws_OperationC [Fact] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task TwoServerInstances_OnceDisposed_Throws() { if ((Options & PipeOptions.Asynchronous) == 0) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 98ea9f6815252..ee92746770682 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -31,6 +31,7 @@ public void OSSupportsUnixDomainSockets_ReturnsCorrectValue() [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { string path = null; @@ -124,6 +125,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Socket_SendReceive_Success() { string path = GetRandomNonExistingFilePath(); @@ -156,6 +158,7 @@ public void Socket_SendReceive_Success() [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Socket_SendReceive_Clone_Success() { string path = GetRandomNonExistingFilePath(); @@ -201,6 +204,7 @@ public void Socket_SendReceive_Clone_Success() [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_SendReceiveAsync_Success() { string path = GetRandomNonExistingFilePath(); @@ -238,6 +242,7 @@ public async Task Socket_SendReceiveAsync_Success() [InlineData(500, 21, 18)] [InlineData(5, 128000, 64000)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iterations, int writeBufferSize, int readBufferSize) { var writeBuffer = new byte[writeBufferSize * iterations]; @@ -294,6 +299,7 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConcurrentSendReceive(bool forceNonBlocking) { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -337,6 +343,7 @@ public async Task ConcurrentSendReceive(bool forceNonBlocking) [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConcurrentSendReceiveAsync() { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -392,6 +399,7 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress) { string serverAddress; @@ -472,6 +480,7 @@ public void Socket_CreateUnixDomainSocket_Throws_OnWindows() [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_RelativePathDeletesFile() { if (!PlatformSupportsUnixDomainSockets) From 24023e4711952af9c8ea9adf5667922b03c34d39 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 14:11:48 -0400 Subject: [PATCH 22/28] Re-ActiveIssue tests failing due to #67853 bugs, not UDS bugs --- .../System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs | 4 ++-- .../System.IO.FileSystem/tests/Directory/CreateDirectory.cs | 1 + src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs | 2 ++ src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs | 1 + .../System.IO.FileSystem/tests/DirectoryInfo/Exists.cs | 1 + src/libraries/System.IO.FileSystem/tests/File/Exists.cs | 1 + .../System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs | 1 + .../System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs | 1 + src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs | 1 + src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs | 1 + 10 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs b/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs index 9e9ad35ac0f34..7910217565906 100644 --- a/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs +++ b/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs @@ -27,7 +27,7 @@ public void SettingAttributes_Unix_ReadOnly() [Theory] [InlineData(FileAttributes.Hidden)] - [PlatformSpecific(TestPlatforms.OSX | TestPlatforms.FreeBSD)] + [PlatformSpecific(TestPlatforms.OSX | TestPlatforms.FreeBSD | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SettingAttributes_OSXAndFreeBSD(FileAttributes attributes) { string path = CreateItem(); @@ -80,7 +80,7 @@ public void SettingInvalidAttributes_Unix(FileAttributes attributes) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))] [InlineData(FileAttributes.Hidden)] - [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] + [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.OSX | TestPlatforms.FreeBSD | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst))] public void SettingInvalidAttributes_UnixExceptOSXAndFreeBSD(FileAttributes attributes) { string path = CreateItem(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index 3eb39368912e2..4cf06cc34b99f 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -468,6 +468,7 @@ public void DriveLetter_Windows() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // drive letters casing + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void DriveLetter_Unix() { // On Unix, there's no special casing for drive letters. These may or may not be valid names, depending diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs index 414c8f51a8986..feef272704f48 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -122,6 +122,7 @@ public void DeletingSymLinkDoesntDeleteTarget() } [ConditionalFact(nameof(UsingNewNormalization))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void ExtendedDirectoryWithSubdirectories() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -131,6 +132,7 @@ public void ExtendedDirectoryWithSubdirectories() } [ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void LongPathExtendedDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500)); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index feaad06c3e0d2..74b77fd2f3bcb 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -394,6 +394,7 @@ public void ExtendedPathAlreadyExistsAsFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Makes call to native code (libc) + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs index 9c076d4ddaead..05b41aa991adc 100644 --- a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs @@ -109,6 +109,7 @@ public void FalseForFile() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs index ff2c8845bc58a..2716c13b290d4 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs @@ -255,6 +255,7 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs index 0cf553e3c5f4b..ce2699fcdf1f5 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs @@ -194,6 +194,7 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAllBytes_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs index 7c76ff3397b2f..47b8324f66c34 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs @@ -204,6 +204,7 @@ static async Task WaitConnectionAndWritePipeStreamAsync(NamedPipeServerStream na [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAllBytesAsync_NonSeekableFileStream_InUnix() { string fifoPath = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs index 4435b64befbcc..782f0cc344562 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs @@ -90,6 +90,7 @@ public void FalseForDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs index 64af8e84c009d..80f1dc52c6fbb 100644 --- a/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs +++ b/src/libraries/System.IO.FileSystem/tests/Path/Exists_File.cs @@ -22,6 +22,7 @@ public void PathAlreadyExistsAsDirectory() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] // Uses P/Invokes + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); From b4c1c5bd42080ca02c0ee202d78dd698ccd8157e Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 16:16:31 -0400 Subject: [PATCH 23/28] Latest test results --- .../tests/NamedPipeTests/NamedPipeTest.Specific.cs | 4 ++++ .../tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs | 2 ++ .../System.Net.Sockets/tests/FunctionalTests/Accept.cs | 1 + .../System.Net.Sockets/tests/FunctionalTests/SendFile.cs | 1 + .../tests/FunctionalTests/UnixDomainSocketTest.cs | 6 ++++++ 5 files changed, 14 insertions(+) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 0b29aa64c6d90..03f1fffb35df5 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -31,6 +31,7 @@ public void InvalidConnectTimeout_Throws_ArgumentOutOfRangeException() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConnectToNonExistentServer_Throws_TimeoutException() { using (NamedPipeClientStream client = new NamedPipeClientStream(".", "notthere")) @@ -46,6 +47,7 @@ await Assert.ThrowsAsync(() => } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task CancelConnectToNonExistentServer_Throws_OperationCanceledException() { using (NamedPipeClientStream client = new NamedPipeClientStream(".", "notthere")) @@ -620,6 +622,7 @@ public void NameTooLong_MaxLengthPerPlatform() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void ClientConnect_Throws_Timeout_When_Pipe_Not_Found() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -631,6 +634,7 @@ public void ClientConnect_Throws_Timeout_When_Pipe_Not_Found() [Theory] [MemberData(nameof(GetCancellationTokens))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ClientConnectAsync_Throws_Timeout_When_Pipe_Not_Found(CancellationToken cancellationToken) { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs index 6a473be5aeefd..67ec9825de306 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs @@ -11,6 +11,7 @@ public class NamedPipeTest_UnixDomainSockets { [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void NamedPipeServer_Connects_With_UnixDomainSocketEndPointClient() { string pipeName = Path.Combine(Path.GetTempPath(), "pipe-tests-corefx-" + Path.GetRandomFileName()); @@ -28,6 +29,7 @@ public void NamedPipeServer_Connects_With_UnixDomainSocketEndPointClient() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task NamedPipeClient_Connects_With_UnixDomainSocketEndPointServer() { string pipeName = Path.Combine(Path.GetTempPath(), "pipe-tests-corefx-" + Path.GetRandomFileName()); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs index 73c93100acdfa..1a254fc09b0d7 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs @@ -299,6 +299,7 @@ public async Task AcceptAsync_MultipleAcceptsThenDispose_AcceptsThrowAfterDispos [Theory] [MemberData(nameof(AcceptGetsCanceledByDispose_Data))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73536", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task AcceptGetsCanceledByDispose(IPAddress loopback) { // We try this a couple of times to deal with a timing race: if the Dispose happens diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs index 35b427eaf32e8..9c56f86515abe 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs @@ -236,6 +236,7 @@ public async Task SliceBuffers_Success() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73536", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task SendFileGetsCanceledByDispose() { // We try this a couple of times to deal with a timing race: if the Dispose happens diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index ee92746770682..a0eeff7006bc5 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -24,6 +24,7 @@ public UnixDomainSocketTest(ITestOutputHelper output) } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void OSSupportsUnixDomainSockets_ReturnsCorrectValue() { Assert.Equal(PlatformSupportsUnixDomainSockets, Socket.OSSupportsUnixDomainSockets); @@ -86,6 +87,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() { string path = GetRandomNonExistingFilePath(); @@ -382,6 +384,7 @@ public async Task ConcurrentSendReceiveAsync() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_InvalidPaths_Throws() { Assert.Throws(() => new UnixDomainSocketEndPoint(null)); @@ -450,6 +453,7 @@ public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstra [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Linux)] // Don't support abstract socket addresses. [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android | TestPlatforms.LinuxBionic)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_UsingAbstractSocketAddressOnUnsupported_Throws() { // An abstract socket address starts with a zero byte. @@ -519,6 +523,7 @@ public void UnixDomainSocketEndPoint_RelativePathDeletesFile() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void AbstractPathEquality() { string abstractPath = '\0' + Guid.NewGuid().ToString(); @@ -534,6 +539,7 @@ public void AbstractPathEquality() } [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void FilePathEquality() { string path1 = "relative" + Path.DirectorySeparatorChar + "path"; From b3db23c3260991919a18a9ce261d451be62e400c Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 16:52:40 -0400 Subject: [PATCH 24/28] Move tvOS/iOS hardcode to SocketProtocolSupportPal.Unix.cs --- .../Common/src/System/Net/SocketProtocolSupportPal.Unix.cs | 6 ++++++ .../Common/src/System/Net/SocketProtocolSupportPal.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs index c755c16517c77..973254788e542 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs @@ -11,6 +11,12 @@ internal static partial class SocketProtocolSupportPal { private static unsafe bool IsSupported(AddressFamily af) { + // Check for AF_UNIX on iOS/tvOS. The OS claims to support this, but returns EPERM on bind. + // We should explicitly set the return here to false, to avoid giving a false impression. + if (af == AddressFamily.Unix && (OperatingSystem.IsTvOS() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()))) + { + return false; + } IntPtr invalid = (IntPtr)(-1); IntPtr socket = invalid; try diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs index 7b84692ff047d..a61f47a0fa458 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs @@ -12,7 +12,7 @@ internal static partial class SocketProtocolSupportPal public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6) && !IsIPv6Disabled(); public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); - public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix) && !OperatingSystem.IsTvOS() && (!OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst()); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); private static bool IsIPv6Disabled() { From 61ca917a354b06d7ae027b14e7fc4ab86a26284b Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 16:56:50 -0400 Subject: [PATCH 25/28] Use Socket.OSSupportsUnixDomainSockets --- .../FunctionalTests/UnixDomainSocketTest.cs | 69 ++++--------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index a0eeff7006bc5..74fb51596f992 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -23,16 +23,8 @@ public UnixDomainSocketTest(ITestOutputHelper output) _log = output; } - [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] - public void OSSupportsUnixDomainSockets_ReturnsCorrectValue() - { - Assert.Equal(PlatformSupportsUnixDomainSockets, Socket.OSSupportsUnixDomainSockets); - } - - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { string path = null; @@ -86,8 +78,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() { string path = GetRandomNonExistingFilePath(); @@ -125,9 +116,8 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Socket_SendReceive_Success() { string path = GetRandomNonExistingFilePath(); @@ -158,9 +148,8 @@ public void Socket_SendReceive_Success() Assert.False(File.Exists(path)); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Socket_SendReceive_Clone_Success() { string path = GetRandomNonExistingFilePath(); @@ -204,9 +193,8 @@ public void Socket_SendReceive_Clone_Success() Assert.False(File.Exists(path)); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_SendReceiveAsync_Success() { string path = GetRandomNonExistingFilePath(); @@ -238,13 +226,12 @@ public async Task Socket_SendReceiveAsync_Success() } [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(5000, 1, 1)] [InlineData(500, 18, 21)] [InlineData(500, 21, 18)] [InlineData(5, 128000, 64000)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iterations, int writeBufferSize, int readBufferSize) { var writeBuffer = new byte[writeBufferSize * iterations]; @@ -296,12 +283,11 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio Assert.False(File.Exists(path)); } - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConcurrentSendReceive(bool forceNonBlocking) { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -343,9 +329,8 @@ public async Task ConcurrentSendReceive(bool forceNonBlocking) } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConcurrentSendReceiveAsync() { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -383,8 +368,7 @@ public async Task ConcurrentSendReceiveAsync() } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void UnixDomainSocketEndPoint_InvalidPaths_Throws() { Assert.Throws(() => new UnixDomainSocketEndPoint(null)); @@ -398,11 +382,10 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() Assert.Throws(() => new UnixDomainSocketEndPoint(invalidLengthString)); } - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress) { string serverAddress; @@ -450,10 +433,9 @@ public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstra Assert.False(File.Exists(clientAddress)); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Linux)] // Don't support abstract socket addresses. [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android | TestPlatforms.LinuxBionic)] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_UsingAbstractSocketAddressOnUnsupported_Throws() { // An abstract socket address starts with a zero byte. @@ -484,10 +466,9 @@ public void Socket_CreateUnixDomainSocket_Throws_OnWindows() [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void UnixDomainSocketEndPoint_RelativePathDeletesFile() { - if (!PlatformSupportsUnixDomainSockets) + if (!Socket.OSSupportsUnixDomainSockets) { return; } @@ -522,8 +503,7 @@ public void UnixDomainSocketEndPoint_RelativePathDeletesFile() }).Dispose(); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void AbstractPathEquality() { string abstractPath = '\0' + Guid.NewGuid().ToString(); @@ -538,8 +518,7 @@ public void AbstractPathEquality() Assert.NotEqual(endPoint2, endPoint3); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void FilePathEquality() { string path1 = "relative" + Path.DirectorySeparatorChar + "path"; @@ -570,26 +549,6 @@ private static string GetRandomNonExistingFilePath() return result; } - private static bool PlatformSupportsUnixDomainSockets - { - get - { - if (OperatingSystem.IsWindows()) - { - try - { - using var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Tcp); - } - catch (SocketException se) - { - return se.SocketErrorCode != SocketError.AddressFamilyNotSupported; - } - } - - return true; - } - } - private static bool IsSubWindows10 => PlatformDetection.IsWindows && PlatformDetection.WindowsVersion < 10; } } From d21e3cc1a848a8323bd9dd015231cbf347e8ef38 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 17:00:00 -0400 Subject: [PATCH 26/28] Clearer explanation on Bionic skips --- .../System/IO/StreamConformanceTests.cs | 50 +++++++++---------- .../FileStream/DevicesPipesAndSockets.cs | 4 +- .../NamedPipeTest.CreateServer.cs | 6 +-- .../NamedPipeTest.CrossProcess.cs | 6 +-- .../NamedPipeTests/NamedPipeTest.Specific.cs | 18 +++---- .../tests/PipeStreamConformanceTests.cs | 34 ++++++------- .../tests/StreamReader/StreamReaderTests.cs | 2 +- ...icStreamConnectedStreamConformanceTests.cs | 2 +- .../FunctionalTests/UnixDomainSocketTest.cs | 18 +++---- 9 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index a889bdf462319..bd702c278c6a6 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -1632,7 +1632,7 @@ protected static bool Bidirectional(StreamPair streams) => streams.Stream2.CanRead && streams.Stream2.CanWrite; [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ArgumentValidation_ThrowsExpectedException() { @@ -1645,7 +1645,7 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Disposed_ThrowsObjectDisposedException() { @@ -1659,7 +1659,7 @@ public virtual async Task Disposed_ThrowsObjectDisposedException() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException() { @@ -1674,7 +1674,7 @@ public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellatio [Theory] [InlineData(0)] [InlineData(100)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationException(int cancellationDelay) { @@ -1687,7 +1687,7 @@ public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationExceptio [Theory] [InlineData(0)] [InlineData(100)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationException(int cancellationDelay) { @@ -1698,7 +1698,7 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWriteByte_Success() { @@ -1772,7 +1772,7 @@ public virtual async Task ReadWrite_Success_Large(ReadWriteMode mode, int writeS [Theory] [MemberData(nameof(ReadWrite_Success_MemberData))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) { @@ -1830,7 +1830,7 @@ public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, b [Theory] [MemberData(nameof(ReadWrite_Modes))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWriteMode mode) { @@ -1880,7 +1880,7 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr [Theory] [MemberData(nameof(AllReadWriteModesAndValue), false)] [MemberData(nameof(AllReadWriteModesAndValue), true)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailableFirst) { @@ -1920,7 +1920,7 @@ public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailab [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) { @@ -1951,7 +1951,7 @@ public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode) [InlineData(ReadWriteMode.SyncArray)] [InlineData(ReadWriteMode.AsyncArray)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Write_DataReadFromDesiredOffset(ReadWriteMode mode) { @@ -2051,7 +2051,7 @@ public static IEnumerable ReadAsync_ContinuesOnCurrentContextIfDesired [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2135,7 +2135,7 @@ public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDe [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_ContinuesOnCurrentTaskSchedulerIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext) { @@ -2226,7 +2226,7 @@ await Task.Factory.StartNew(() => [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteMode mode) { @@ -2294,7 +2294,7 @@ public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteM [InlineData(ReadWriteMode.AsyncMemory)] [InlineData(ReadWriteMode.SyncAPM)] [InlineData(ReadWriteMode.AsyncAPM)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteMode mode) { @@ -2349,7 +2349,7 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM [Theory] [InlineData(false)] [InlineData(true)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWrite_CustomMemoryManager_Success(bool useAsync) { @@ -2415,7 +2415,7 @@ await readable.ReadAsync(readBuffer.Memory.Slice(bytesRead)) : } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ConcurrentBidirectionalReadsWrites_Success() { @@ -2473,7 +2473,7 @@ public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => [Theory] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) { @@ -2503,7 +2503,7 @@ public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync [OuterLoop("May take several seconds")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Parallel_ReadWriteMultipleStreamsConcurrently() { @@ -2514,7 +2514,7 @@ await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Timeout_Roundtrips() { @@ -2550,7 +2550,7 @@ public virtual async Task Timeout_Roundtrips() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadTimeout_Expires_Throws() { @@ -2666,7 +2666,7 @@ public virtual async Task ClosedConnection_WritesFailImmediately_ThrowException( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() { @@ -2688,7 +2688,7 @@ public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() { @@ -2704,7 +2704,7 @@ public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Flush_ValidOnReadableStream_Success() { @@ -2723,7 +2723,7 @@ public virtual async Task Flush_ValidOnReadableStream_Success() [InlineData(0)] [InlineData(1)] [InlineData(2)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Dispose_ClosesStream(int disposeMode) { diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs index 9c9b6ae697fcd..2a792a8f4e4fb 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs @@ -63,7 +63,7 @@ public async Task CharacterDevice_WriteAllTextAsync(string devicePath) [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task NamedPipe_ReadWrite() { @@ -85,7 +85,7 @@ await Task.WhenAll( [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task NamedPipe_ReadWrite_Async() { diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index c6de0d3748419..d8afc8094a3de 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs @@ -55,7 +55,7 @@ public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirec AssertExtensions.Throws("pipeName", () => new NamedPipeServerStream(reservedName, direction, 1, PipeTransmissionMode.Byte, PipeOptions.None, 0, 0));} [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Create_PipeName() { @@ -63,7 +63,7 @@ public static void Create_PipeName() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Create_PipeName_Direction_MaxInstances() { @@ -209,7 +209,7 @@ public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedE [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // accessing SafePipeHandle on Unix fails for a non-connected stream - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException() { diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs index 858c7a77fff6f..b94f6771f07d4 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs @@ -14,7 +14,7 @@ namespace System.IO.Pipes.Tests public sealed class NamedPipeTest_CrossProcess { [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void InheritHandles_AvailableInChildProcess() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -46,7 +46,7 @@ void ChildFunc(string handle) } [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void PingPong_Sync() { // Create names for two pipes @@ -73,7 +73,7 @@ public void PingPong_Sync() } [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task PingPong_Async() { // Create names for two pipes diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 03f1fffb35df5..50398fd55501f 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -87,7 +87,7 @@ public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException( [Theory] [InlineData(1)] [InlineData(3)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients) { @@ -124,7 +124,7 @@ async Task ConnectClientAndReadAsync() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void MaxNumberOfServerInstances_TooManyServers_Throws() { @@ -163,7 +163,7 @@ public void MaxNumberOfServerInstances_TooManyServers_Throws() [Theory] [InlineData(1)] [InlineData(4)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers) { @@ -361,7 +361,7 @@ public async Task Windows_GetImpersonationUserName_Succeed(TokenImpersonationLev [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invoke to verify the user name - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Unix_GetImpersonationUserName_Succeed() { @@ -393,7 +393,7 @@ public void Unix_MessagePipeTransmissionMode() [InlineData(PipeDirection.Out)] [InlineData(PipeDirection.InOut)] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implementation uses bidirectional sockets - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public static void Unix_BufferSizeRoundtripping(PipeDirection direction) { @@ -458,7 +458,7 @@ public static void Windows_BufferSizeRoundtripping() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task PipeTransmissionMode_Returns_Byte() { @@ -515,7 +515,7 @@ public void Windows_SetReadModeTo__PipeTransmissionModeByte() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Unix doesn't currently support message mode - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void Unix_SetReadModeTo__PipeTransmissionModeByte() { @@ -557,7 +557,7 @@ public void Unix_SetReadModeTo__PipeTransmissionModeByte() [Theory] [InlineData(PipeDirection.Out, PipeDirection.In)] [InlineData(PipeDirection.In, PipeDirection.Out)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection serverDirection, PipeDirection clientDirection) { @@ -576,7 +576,7 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void NameTooLong_MaxLengthPerPlatform() { diff --git a/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs index 4ad323702d0fe..918303b019a0a 100644 --- a/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs +++ b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs @@ -119,7 +119,7 @@ public static IEnumerable OneWayReadWritesMemberData() => select new object[] { serverOption, clientOption, asyncServerOps, asyncClientOps }; [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ClonedServer_ActsAsOriginalServer() { @@ -159,7 +159,7 @@ public async Task ClonedServer_ActsAsOriginalServer() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ClonedClient_ActsAsOriginalClient() { @@ -198,7 +198,7 @@ public async Task ClonedClient_ActsAsOriginalClient() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationException() { @@ -210,7 +210,7 @@ public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationExcepti } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperationException() { @@ -224,7 +224,7 @@ public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperat [Theory] [InlineData(0)] [InlineData(100)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task CancelTokenOn_ServerWaitForConnectionAsync_Throws_OperationCanceledException(int cancellationDelay) { @@ -282,7 +282,7 @@ public async Task CancelTokenOn_ServerWaitForConnectionAsyncWithOuterCancellatio } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task OperationsOnDisconnectedServer() { @@ -320,7 +320,7 @@ public async Task OperationsOnDisconnectedServer() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task OperationsOnDisconnectedClient() { @@ -366,7 +366,7 @@ public virtual async Task OperationsOnDisconnectedClient() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Windows_OperationsOnNamedServerWithDisposedClient() { @@ -391,7 +391,7 @@ public async Task Windows_OperationsOnNamedServerWithDisposedClient() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void OperationsOnUnconnectedServer() { @@ -428,7 +428,7 @@ public void OperationsOnUnconnectedServer() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public void OperationsOnUnconnectedClient() { @@ -461,7 +461,7 @@ public void OperationsOnUnconnectedClient() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task DisposedServerPipe_Throws_ObjectDisposedException() { @@ -475,7 +475,7 @@ public async Task DisposedServerPipe_Throws_ObjectDisposedException() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task DisposedClientPipe_Throws_ObjectDisposedException() { @@ -489,7 +489,7 @@ public async Task DisposedClientPipe_Throws_ObjectDisposedException() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ReadAsync_DisconnectDuringRead_Returns0() { @@ -502,7 +502,7 @@ public async Task ReadAsync_DisconnectDuringRead_Returns0() } [PlatformSpecific(TestPlatforms.Windows)] // Unix named pipes are on sockets, where small writes with an empty buffer will succeed immediately - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] [Fact] public async Task WriteAsync_DisconnectDuringWrite_Throws() @@ -516,7 +516,7 @@ public async Task WriteAsync_DisconnectDuringWrite_Throws() } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Server_ReadWriteCancelledToken_Throws_OperationCanceledException() { @@ -619,7 +619,7 @@ public async Task CancelTokenOn_Server_ReadWriteCancelledToken_Throws_OperationC } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task Client_ReadWriteCancelledToken_Throws_OperationCanceledException() { @@ -722,7 +722,7 @@ public async Task CancelTokenOn_Client_ReadWriteCancelledToken_Throws_OperationC } [Fact] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task TwoServerInstances_OnceDisposed_Throws() { diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 59b483a47ba79..b8098fdd3ac0a 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -555,7 +555,7 @@ public async Task ReadBlockAsync_RepeatsReadsUntilReadDesiredAmount() [InlineData(1, false)] [InlineData(1, true)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled) { diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs index cf19c41fb4dca..5dafe8f6266a3 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs @@ -156,7 +156,7 @@ public override void Dispose() [OuterLoop("May take several seconds")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [ActiveIssue("https://github.com/dotnet/runtime/issues/73377")] public override Task Parallel_ReadWriteMultipleStreamsConcurrently() { diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 74fb51596f992..967e8da250fda 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -24,7 +24,7 @@ public UnixDomainSocketTest(ITestOutputHelper output) } [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { string path = null; @@ -117,7 +117,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() } [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void Socket_SendReceive_Success() { string path = GetRandomNonExistingFilePath(); @@ -149,7 +149,7 @@ public void Socket_SendReceive_Success() } [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void Socket_SendReceive_Clone_Success() { string path = GetRandomNonExistingFilePath(); @@ -194,7 +194,7 @@ public void Socket_SendReceive_Clone_Success() } [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task Socket_SendReceiveAsync_Success() { string path = GetRandomNonExistingFilePath(); @@ -231,7 +231,7 @@ public async Task Socket_SendReceiveAsync_Success() [InlineData(500, 18, 21)] [InlineData(500, 21, 18)] [InlineData(5, 128000, 64000)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iterations, int writeBufferSize, int readBufferSize) { var writeBuffer = new byte[writeBufferSize * iterations]; @@ -287,7 +287,7 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] [InlineData(false)] [InlineData(true)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task ConcurrentSendReceive(bool forceNonBlocking) { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -330,7 +330,7 @@ public async Task ConcurrentSendReceive(bool forceNonBlocking) } [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task ConcurrentSendReceiveAsync() { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) @@ -385,7 +385,7 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(false)] [InlineData(true)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress) { string serverAddress; @@ -465,7 +465,7 @@ public void Socket_CreateUnixDomainSocket_Throws_OnWindows() } [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void UnixDomainSocketEndPoint_RelativePathDeletesFile() { if (!Socket.OSSupportsUnixDomainSockets) From 6ba57a2bab8bab823a18ba4eadafa2909527ddcf Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 8 Aug 2022 17:08:21 -0400 Subject: [PATCH 27/28] Replace accidental Theory->Fact swaps back to Theory --- .../tests/FunctionalTests/UnixDomainSocketTest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 967e8da250fda..ba0fbd7c13edb 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -226,7 +226,7 @@ public async Task Socket_SendReceiveAsync_Success() } [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] - [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(5000, 1, 1)] [InlineData(500, 18, 21)] [InlineData(500, 21, 18)] @@ -283,7 +283,7 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio Assert.False(File.Exists(path)); } - [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] [InlineData(false)] [InlineData(true)] @@ -382,7 +382,7 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() Assert.Throws(() => new UnixDomainSocketEndPoint(invalidLengthString)); } - [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] From e46997e705d4a213ede539f10aca36c233d3779a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 9 Aug 2022 09:25:00 -0400 Subject: [PATCH 28/28] I strongly disagree with this, but we have tests explicitly looking for it --- .../src/System/Net/Sockets/UnixDomainSocketEndPoint.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs index 6a767ffbd2473..0a06e5d418fda 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs @@ -44,11 +44,6 @@ private UnixDomainSocketEndPoint(string path, string? boundFileName) bufferLength++; } - if (!Socket.OSSupportsUnixDomainSockets) - { - throw new PlatformNotSupportedException(); - } - if (path.Length == 0 || bufferLength > s_nativePathLength) { throw new ArgumentOutOfRangeException( @@ -60,6 +55,11 @@ private UnixDomainSocketEndPoint(string path, string? boundFileName) _encodedPath = new byte[bufferLength]; int bytesEncoded = Encoding.UTF8.GetBytes(path, 0, path.Length, _encodedPath, 0); Debug.Assert(bufferLength - (isAbstract ? 0 : 1) == bytesEncoded); + + if (!Socket.OSSupportsUnixDomainSockets) + { + throw new PlatformNotSupportedException(); + } } internal static int MaxAddressSize => s_nativeAddressSize;