-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QUIC] Cleaned up TlsSecret and added test. (#93119)
* Cleaned up TlsSecret and added test. * To be removed: test where the test actually runs * Update MsQuicRemoteExecutorTests.cs * Exclude the test in release * Feedback --------- Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
- Loading branch information
1 parent
b331f23
commit dae5947
Showing
5 changed files
with
147 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicRemoteExecutorTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Net.Security; | ||
using System.Threading.Tasks; | ||
using Microsoft.DotNet.RemoteExecutor; | ||
using Microsoft.DotNet.XUnitExtensions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace System.Net.Quic.Tests | ||
{ | ||
[Collection(nameof(DisableParallelization))] | ||
[ConditionalClass(typeof(QuicTestBase), nameof(QuicTestBase.IsSupported))] | ||
public class MsQuicRemoteExecutorTests : QuicTestBase | ||
{ | ||
public MsQuicRemoteExecutorTests() | ||
: base(null!) { } | ||
|
||
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] | ||
public void SslKeyLogFile_IsCreatedAndFilled() | ||
{ | ||
if (PlatformDetection.IsReleaseRuntime) | ||
{ | ||
throw new SkipTestException("Retrieving SSL secrets is not supported in Release mode."); | ||
} | ||
|
||
var psi = new ProcessStartInfo(); | ||
var tempFile = Path.GetTempFileName(); | ||
psi.Environment.Add("SSLKEYLOGFILE", tempFile); | ||
|
||
RemoteExecutor.Invoke(async () => | ||
{ | ||
(QuicConnection clientConnection, QuicConnection serverConnection) = await CreateConnectedQuicConnection(); | ||
await clientConnection.DisposeAsync(); | ||
await serverConnection.DisposeAsync(); | ||
}, new RemoteInvokeOptions { StartInfo = psi }).Dispose(); | ||
|
||
Assert.True(File.Exists(tempFile)); | ||
Assert.True(File.ReadAllText(tempFile).Length > 0); | ||
} | ||
} | ||
} |