Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformNotSupportedException for UNIX domain sockets on iOS/tvOS #73374

Merged
merged 29 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
87f7db3
PNSE for domain sockets on iOS/tvOS
directhex Aug 4, 2022
d17c748
Re-enable some tests which SHOULD now throw PNSE
directhex Aug 4, 2022
401a14d
Try handling Catalyst==iOS case better
directhex Aug 4, 2022
394cbfb
Move "sockets supported" check _before_ "socket path name too long" c…
directhex Aug 4, 2022
2f7ff83
Newer API, from Jan
directhex Aug 4, 2022
995cf18
Skip various tests on iOS/tvOS explicitly.
directhex Aug 4, 2022
f383463
Update src/libraries/Common/src/System/Net/SocketProtocolSupportPal.cs
directhex Aug 5, 2022
489e1d9
Try to mark up unrunnable #67853 tests, and reenable the rest to see
directhex Aug 5, 2022
437fd79
Maybe mkfifo works after all? Try it out
directhex Aug 5, 2022
99771fa
YOLO
directhex Aug 5, 2022
17e9b62
YOLO2
directhex Aug 5, 2022
41baae1
Actually run UDS tests on iOS derivs
directhex Aug 5, 2022
818b934
Shrink socket path, just for sanity testing
directhex Aug 5, 2022
855fe09
Make test not increase UDS path by 1-32 characters
directhex Aug 5, 2022
227bbe9
Better approach
directhex Aug 5, 2022
d814cc0
Limit last change to 32 chars of randomness
directhex Aug 5, 2022
0d38fb8
Annotate Assert, since just 'True != False' is unhelpful
directhex Aug 6, 2022
d79e293
Okay, CONFIRMED: PNSE on iOS/tvOS
directhex Aug 8, 2022
e7ab373
Try to fix up UDS-specific test failures on iOS/tvOS
directhex Aug 8, 2022
4e763c4
Revert change which only benefited tvOS/iOS UDS
directhex Aug 8, 2022
80c4b47
Mark more tests as unpassable due to PNSE
directhex Aug 8, 2022
24023e4
Re-ActiveIssue tests failing due to #67853 bugs, not UDS bugs
directhex Aug 8, 2022
b4c1c5b
Latest test results
directhex Aug 8, 2022
7514e6f
Merge branch 'main' into PNSE-domain-sockets-on-ios-tvos
directhex Aug 8, 2022
b3db23c
Move tvOS/iOS hardcode to SocketProtocolSupportPal.Unix.cs
directhex Aug 8, 2022
61ca917
Use Socket.OSSupportsUnixDomainSockets
directhex Aug 8, 2022
d21e3cc
Clearer explanation on Bionic skips
directhex Aug 8, 2022
6ba57a2
Replace accidental Theory->Fact swaps back to Theory
directhex Aug 8, 2022
e46997e
I strongly disagree with this, but we have tests explicitly looking f…
directhex Aug 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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"));
directhex marked this conversation as resolved.
Show resolved Hide resolved

private static bool IsIPv6Disabled()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<StreamReader, CancellationToken, Task<int>> func = method switch
Expand Down
5 changes: 0 additions & 5 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator') and '$(RunDisablediOSTests)' != 'true'">
<!-- https://github.com/dotnet/runtime/issues/51335 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(RunDisabledWasmTests)' != 'true' and '$(RunAOTCompilation)' != 'true'">
</ItemGroup>

Expand Down