mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 02:13:38 +09:00
handle UnauthorizedAccessException from mmap on OSX (#35619)
* handle UnauthorizedAccessException on OSX * update SkipTestException text * add comments Co-authored-by: Tomas Weinfurt <furt@Shining.local>
This commit is contained in:
parent
3735efbdb2
commit
ac544ffe30
2 changed files with 8 additions and 4 deletions
|
@ -91,9 +91,11 @@ namespace System.IO.MemoryMappedFiles.Tests
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException)
|
catch (UnauthorizedAccessException)
|
||||||
{
|
{
|
||||||
if (PlatformDetection.IsInContainer && (viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
|
if ((RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || PlatformDetection.IsInContainer) &&
|
||||||
|
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
|
||||||
{
|
{
|
||||||
throw new SkipTestException("Execute permission failing in container.");
|
// Containers and OSX with SIP enabled do not have execute permissions by default.
|
||||||
|
throw new SkipTestException("Insufficient execute permission.");
|
||||||
}
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
|
|
|
@ -91,9 +91,11 @@ namespace System.IO.MemoryMappedFiles.Tests
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException)
|
catch (UnauthorizedAccessException)
|
||||||
{
|
{
|
||||||
if (PlatformDetection.IsInContainer && (viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
|
if ((RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || PlatformDetection.IsInContainer) &&
|
||||||
|
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
|
||||||
{
|
{
|
||||||
throw new SkipTestException("Execute permission failing in container.");
|
// Containers and OSX with SIP enabled do not have execute permissions by default.
|
||||||
|
throw new SkipTestException("Insufficient execute permission.");
|
||||||
}
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue