diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index 4cf06cc34b99f..7ed023adca957 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -466,34 +466,37 @@ public void DriveLetter_Windows() Assert.Equal(current.FullName, driveLetter.FullName); } - [Fact] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [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 - // on the file system underlying the current directory. Unix file systems typically allow these, but, - // for example, these names are not allowed if running on a file system mounted from a Windows machine. - DirectoryInfo driveLetter; - try - { - driveLetter = Create("C:"); - } - catch (IOException) - { - return; - } - var current = Create("."); - Assert.Equal("C:", driveLetter.Name); - Assert.Equal(Path.Combine(current.FullName, "C:"), driveLetter.FullName); - try + RemoteExecutor.Invoke(() => { - // If this test is inherited then it's possible this call will fail due to the "C:" directory - // being deleted in that other test before this call. What we care about testing (proper path - // handling) is unaffected by this race condition. - Directory.Delete("C:"); - } - catch (DirectoryNotFoundException) { } + Directory.SetCurrentDirectory(Path.GetTempPath()); + // On Unix, there's no special casing for drive letters. These may or may not be valid names, depending + // on the file system underlying the current directory. Unix file systems typically allow these, but, + // for example, these names are not allowed if running on a file system mounted from a Windows machine. + DirectoryInfo driveLetter; + try + { + driveLetter = Create("C:"); + } + catch (IOException) + { + return; + } + var current = Create("."); + Assert.Equal("C:", driveLetter.Name); + Assert.Equal(Path.Combine(current.FullName, "C:"), driveLetter.FullName); + try + { + // If this test is inherited then it's possible this call will fail due to the "C:" directory + // being deleted in that other test before this call. What we care about testing (proper path + // handling) is unaffected by this race condition. + Directory.Delete("C:"); + } + catch (DirectoryNotFoundException) { } + }).Dispose(); } [Fact] diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs index feef272704f48..f86cae23145af 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -3,6 +3,7 @@ using System.Text; using Xunit; +using Microsoft.DotNet.RemoteExecutor; using Microsoft.DotNet.XUnitExtensions; namespace System.IO.Tests @@ -13,6 +14,10 @@ public class Directory_Delete_str : FileSystemTest static bool IsBindMountSupportedAndOnUnixAndSuperUser => IsBindMountSupported && PlatformDetection.IsUnixAndSuperUser; + static bool IsRemoteExecutorSupportedAndUsingNewNormalization => RemoteExecutor.IsSupported && UsingNewNormalization; + + static bool IsRemoteExecutorSupportedAndLongPathsAreNotBlockedAndUsingNewNormalization => RemoteExecutor.IsSupported && LongPathsAreNotBlocked && UsingNewNormalization; + #region Utilities protected virtual void Delete(string path) @@ -121,23 +126,29 @@ public void DeletingSymLinkDoesntDeleteTarget() Assert.False(Directory.Exists(linkPath), "linkPath should no longer exist"); } - [ConditionalFact(nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] + [ConditionalFact(nameof(IsRemoteExecutorSupportedAndUsingNewNormalization))] public void ExtendedDirectoryWithSubdirectories() { - DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); - testDir.CreateSubdirectory(GetTestFileName()); - Assert.Throws(() => Delete(testDir.FullName)); - Assert.True(testDir.Exists); + RemoteExecutor.Invoke(() => + { + Directory.SetCurrentDirectory(Path.GetTempPath()); + DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); + testDir.CreateSubdirectory(GetTestFileName()); + Assert.Throws(() => Delete(testDir.FullName)); + Assert.True(testDir.Exists); + }).Dispose(); } - [ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] + [ConditionalFact(nameof(IsRemoteExecutorSupportedAndLongPathsAreNotBlockedAndUsingNewNormalization))] public void LongPathExtendedDirectory() { - DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500)); - Delete(testDir.FullName); - Assert.False(testDir.Exists); + RemoteExecutor.Invoke(() => + { + Directory.SetCurrentDirectory(Path.GetTempPath()); + DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500)); + Delete(testDir.FullName); + Assert.False(testDir.Exists); + }).Dispose(); } #endregion diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index 74b77fd2f3bcb..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) - [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 05b41aa991adc..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 - [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 2716c13b290d4..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 - [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 ce2699fcdf1f5..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)] - [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 47b8324f66c34..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)] - [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 782f0cc344562..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 - [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 80f1dc52c6fbb..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 - [ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TrueForNonRegularFile() { string fileName = GetTestFilePath();