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/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 1c21996128bf6..bd702c278c6a6 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,8 +1632,8 @@ 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.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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1648,8 +1645,8 @@ public virtual async Task ArgumentValidation_ThrowsExpectedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1662,8 +1659,8 @@ public virtual async Task Disposed_ThrowsObjectDisposedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1677,8 +1674,8 @@ public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellatio [Theory] [InlineData(0)] [InlineData(100)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1690,8 +1687,8 @@ public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationExceptio [Theory] [InlineData(0)] [InlineData(100)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1701,8 +1698,8 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1775,8 +1772,8 @@ 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.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) { foreach (CancellationToken nonCanceledToken in new[] { CancellationToken.None, new CancellationTokenSource().Token }) @@ -1833,8 +1830,8 @@ 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.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) { if (!FlushGuaranteesAllDataWritten) @@ -1883,8 +1880,8 @@ 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.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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1923,8 +1920,8 @@ 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.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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -1954,8 +1951,8 @@ 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.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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2054,8 +2051,8 @@ public static IEnumerable ReadAsync_ContinuesOnCurrentContextIfDesired [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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) { await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx @@ -2138,8 +2135,8 @@ public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDe [Theory] [MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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) { await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx @@ -2229,8 +2226,8 @@ 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.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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2297,8 +2294,8 @@ 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.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) { byte[][] buffers = new[] { Array.Empty(), "hello"u8.ToArray(), Array.Empty(), "world"u8.ToArray() }; @@ -2352,8 +2349,8 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM [Theory] [InlineData(false)] [InlineData(true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2418,7 +2415,8 @@ 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() { if (!SupportsConcurrentBidirectionalUse) @@ -2475,8 +2473,8 @@ 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.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) { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2505,7 +2503,8 @@ 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() { await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => @@ -2515,8 +2514,8 @@ await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () => } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2551,8 +2550,8 @@ public virtual async Task Timeout_Roundtrips() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2667,7 +2666,8 @@ 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() { if (UnsupportedConcurrentExceptionType is null) @@ -2688,8 +2688,8 @@ public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2704,8 +2704,8 @@ public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -2723,8 +2723,8 @@ 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.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) { if (!CansReturnFalseAfterDispose) diff --git a/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs b/src/libraries/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs index cbf6e8eadeea6..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,8 +80,7 @@ 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)] + [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 988914e56f00d..4cf06cc34b99f 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -468,7 +468,7 @@ public void DriveLetter_Windows() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // drive letters casing - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [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 fa6cc76cda47b..feef272704f48 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -122,7 +122,7 @@ public void DeletingSymLinkDoesntDeleteTarget() } [ConditionalFact(nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void ExtendedDirectoryWithSubdirectories() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -132,7 +132,7 @@ public void ExtendedDirectoryWithSubdirectories() } [ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] + [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 b5daf1323139b..74b77fd2f3bcb 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)] + [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/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..05b41aa991adc 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)] + [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 48d87fc2b7946..2716c13b290d4 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)] + [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 a3abe2311868e..ce2699fcdf1f5 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)] + [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 8ae63fe3c9e0a..47b8324f66c34 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)] + [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 04e13706db656..782f0cc344562 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)] + [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/FileStream/DevicesPipesAndSockets.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs index 86a4901b344ce..2a792a8f4e4fb 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs @@ -63,8 +63,8 @@ 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.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() { string fifoPath = GetTestFilePath(); @@ -85,8 +85,8 @@ await Task.WhenAll( [Fact] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)] - [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() { string fifoPath = 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 652d348b5c3f3..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,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)] + [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.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index 412010a0c9953..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,14 +55,16 @@ 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() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName()).Dispose(); } [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() { new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1).Dispose(); @@ -207,7 +209,8 @@ 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() { 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..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 6f653c836a880..50398fd55501f 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")) @@ -85,7 +87,8 @@ 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) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -121,7 +124,8 @@ 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() { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -159,7 +163,8 @@ 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) { string name = PipeStreamConformanceTests.GetUniquePipeName(); @@ -356,7 +361,8 @@ 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() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -387,7 +393,8 @@ 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) { int desiredBufferSize = 0; @@ -451,7 +458,8 @@ 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() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -507,7 +515,8 @@ 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() { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -548,7 +557,8 @@ 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) { string pipeName = PipeStreamConformanceTests.GetUniquePipeName(); @@ -566,7 +576,8 @@ 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() { // Increase a name's length until it fails @@ -611,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(); @@ -622,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.IO.Pipes/tests/PipeStreamConformanceTests.cs b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs index 3d03bdc1b2e06..918303b019a0a 100644 --- a/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs +++ b/src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs @@ -119,7 +119,8 @@ 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() { byte[] msg1 = new byte[] { 5, 7, 9, 10 }; @@ -158,7 +159,8 @@ 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() { byte[] msg1 = new byte[] { 5, 7, 9, 10 }; @@ -196,7 +198,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -207,7 +210,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -220,7 +224,8 @@ 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) { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -277,7 +282,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -314,7 +320,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -359,7 +366,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -383,7 +391,8 @@ 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() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -419,7 +428,8 @@ 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() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -451,7 +461,8 @@ 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() { (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams(); @@ -464,7 +475,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -477,7 +489,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -489,7 +502,8 @@ 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() { @@ -502,7 +516,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -604,7 +619,8 @@ 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() { using StreamPair streams = await CreateConnectedStreamsAsync(); @@ -706,7 +722,8 @@ 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() { if ((Options & PipeOptions.Asynchronous) == 0) diff --git a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs index 24cf85352ff2d..b8098fdd3ac0a 100644 --- a/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs +++ b/src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs @@ -555,8 +555,8 @@ 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")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51390", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [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) { Func> func = method switch 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/Accept.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs index 7098e93a1b2a2..f0fbcde1e82f5 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs @@ -303,6 +303,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, bool owning) { // Aborting sync operations for non-owning handles is not supported on Unix. diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs index de68b83498cfd..4fe44d9a2d7b7 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs @@ -238,6 +238,7 @@ public async Task SliceBuffers_Success() [Theory] [InlineData(true)] [InlineData(false)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73536", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task SendFileGetsCanceledByDispose(bool owning) { // Aborting sync operations for non-owning handles is not supported on Unix. diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 28432569547fe..ba0fbd7c13edb 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -23,15 +23,8 @@ public UnixDomainSocketTest(ITestOutputHelper output) _log = output; } - [Fact] - public void OSSupportsUnixDomainSockets_ReturnsCorrectValue() - { - Assert.Equal(PlatformSupportsUnixDomainSockets, Socket.OSSupportsUnixDomainSockets); - } - - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { string path = null; @@ -85,8 +78,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() { string path = GetRandomNonExistingFilePath(); @@ -124,9 +116,8 @@ 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")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void Socket_SendReceive_Success() { string path = GetRandomNonExistingFilePath(); @@ -157,9 +148,8 @@ public void Socket_SendReceive_Success() Assert.False(File.Exists(path)); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void Socket_SendReceive_Clone_Success() { string path = GetRandomNonExistingFilePath(); @@ -203,9 +193,8 @@ public void Socket_SendReceive_Clone_Success() Assert.False(File.Exists(path)); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public async Task Socket_SendReceiveAsync_Success() { string path = GetRandomNonExistingFilePath(); @@ -237,13 +226,12 @@ public async Task Socket_SendReceiveAsync_Success() } [ActiveIssue("https://github.com/dotnet/runtime/issues/26189", TestPlatforms.Windows)] - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [InlineData(5000, 1, 1)] [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")] + [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]; @@ -295,12 +283,11 @@ public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iteratio Assert.False(File.Exists(path)); } - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [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")] + [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)) @@ -342,9 +329,8 @@ 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")] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] + [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)) @@ -382,7 +368,7 @@ public async Task ConcurrentSendReceiveAsync() } } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void UnixDomainSocketEndPoint_InvalidPaths_Throws() { Assert.Throws(() => new UnixDomainSocketEndPoint(null)); @@ -396,11 +382,10 @@ public void UnixDomainSocketEndPoint_InvalidPaths_Throws() Assert.Throws(() => new UnixDomainSocketEndPoint(invalidLengthString)); } - [ConditionalTheory(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalTheory(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] [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")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress) { string serverAddress; @@ -448,7 +433,7 @@ 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)] public void UnixDomainSocketEndPoint_UsingAbstractSocketAddressOnUnsupported_Throws() @@ -480,10 +465,10 @@ 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 (!PlatformSupportsUnixDomainSockets) + if (!Socket.OSSupportsUnixDomainSockets) { return; } @@ -518,7 +503,7 @@ public void UnixDomainSocketEndPoint_RelativePathDeletesFile() }).Dispose(); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void AbstractPathEquality() { string abstractPath = '\0' + Guid.NewGuid().ToString(); @@ -533,8 +518,7 @@ public void AbstractPathEquality() Assert.NotEqual(endPoint2, endPoint3); } - [ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ConditionalFact(typeof(Socket), nameof(Socket.OSSupportsUnixDomainSockets))] public void FilePathEquality() { string path1 = "relative" + Path.DirectorySeparatorChar + "path"; @@ -565,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; } } diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 77e53d7c06e4d..c346b4a55b5d3 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -340,11 +340,6 @@ - - - - -