Skip to content

Commit

Permalink
Use find to locate msquic lib; Use ActiveIssue to skip win test on si…
Browse files Browse the repository at this point in the history
…nglefile
  • Loading branch information
ManickaP committed Feb 3, 2023
1 parent a2f2b8a commit b1615d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly()
public static bool IsDebuggerTypeProxyAttributeSupported => !IsNativeAot;
public static bool HasAssemblyFiles => !string.IsNullOrEmpty(typeof(PlatformDetection).Assembly.Location);
public static bool HasHostExecutable => HasAssemblyFiles; // single-file don't have a host
public static bool IsSingleFile => !HasAssemblyFiles;

private static volatile Tuple<bool> s_lazyNonZeroLowerBoundArraySupported;
public static bool IsNonZeroLowerBoundArraySupported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,25 @@ public void UnsupportedPlatforms_ThrowsPlatformNotSupportedException()
Assert.ThrowsAsync<PlatformNotSupportedException>(async () => await CreateQuicConnection(new IPEndPoint(IPAddress.Loopback, 0)));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/73290", typeof(PlatformDetection), nameof(PlatformDetection.IsSingleFile))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.SupportsTls13))]
public void SupportedWindowsPlatforms_IsSupportedIsTrue()
{
if (PlatformDetection.HasAssemblyFiles)
{
Assert.True(QuicListener.IsSupported);
Assert.True(QuicConnection.IsSupported);
}
else
{
// The above if check can be deleted when https://github.com/dotnet/runtime/issues/73290
// gets fixed and this test starts failing.
Assert.False(QuicListener.IsSupported);
Assert.False(QuicConnection.IsSupported);
}
Assert.True(QuicListener.IsSupported);
Assert.True(QuicConnection.IsSupported);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsLinux))]
public async Task SupportedLinuxPlatforms_IsSupportedIsTrue()
{
using Process ldconfig = new Process();
ldconfig.StartInfo.FileName = "ldconfig";
ldconfig.StartInfo.Arguments = "-p";
ldconfig.StartInfo.RedirectStandardOutput = true;
ldconfig.Start();
string output = await ldconfig.StandardOutput.ReadToEndAsync();
await ldconfig.WaitForExitAsync();
using Process find = new Process();
find.StartInfo.FileName = "find";
find.StartInfo.Arguments = "/usr/ -iname libmsquic.so*";
find.StartInfo.RedirectStandardOutput = true;
find.Start();
string output = await find.StandardOutput.ReadToEndAsync();
_output.WriteLine(output);
await find.WaitForExitAsync();
if (output.Contains("libmsquic.so"))
{
Assert.True(QuicListener.IsSupported);
Expand Down

0 comments on commit b1615d8

Please sign in to comment.