Skip to content

Commit baba837

Browse files
committed
chore(deps): update TUnit and dimpl
1 parent 16be85b commit baba837

6 files changed

Lines changed: 38 additions & 24 deletions

File tree

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="TUnit" Version="1.37.36" />
6+
<PackageVersion Include="TUnit" Version="1.39.0" />
77
</ItemGroup>
8-
</Project>
8+
</Project>

native/Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/DTLS.Tests/InteropTestBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ namespace DTLS.Tests;
66

77
public abstract class InteropTestBase : DtlsTestBase
88
{
9+
[Before(Test)]
10+
public virtual void SkipUnlessInteropDependencyAvailable()
11+
{
12+
}
13+
914
protected static (string certPath, string keyPath) ExportPem(X509Certificate2 cert, string dir)
1015
{
1116
string certPath = Path.Combine(dir, "cert.pem");

tests/DTLS.Tests/OpenSslInteropTests.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace DTLS.Tests;
99

1010
public class OpenSslInteropTests : InteropTestBase
1111
{
12+
public override void SkipUnlessInteropDependencyAvailable()
13+
{
14+
Skip.Unless(IsOpensslAvailable, "openssl not found in PATH");
15+
}
16+
1217
private static readonly bool IsOpensslAvailable = CheckOpenSsl();
1318

1419
private static bool CheckOpenSsl()
@@ -30,8 +35,6 @@ private static bool CheckOpenSsl()
3035
[Test]
3136
public async Task Client_HandshakeAndData_WithOpenSslServer(CancellationToken cancellationToken)
3237
{
33-
Skip.Unless(IsOpensslAvailable, "openssl not found in PATH");
34-
3538
string tmpDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
3639
Directory.CreateDirectory(tmpDir);
3740

@@ -40,7 +43,7 @@ public async Task Client_HandshakeAndData_WithOpenSslServer(CancellationToken ca
4043
(string certPath, string keyPath) = ExportPem(Cert, tmpDir);
4144
int port = GetFreeUdpPort();
4245

43-
using Process server = Process.Start
46+
using Process? server = Process.Start
4447
(
4548
new ProcessStartInfo
4649
(
@@ -53,7 +56,8 @@ public async Task Client_HandshakeAndData_WithOpenSslServer(CancellationToken ca
5356
RedirectStandardOutput = true,
5457
CreateNoWindow = true
5558
}
56-
)!;
59+
);
60+
Assert.NotNull(server);
5761

5862
try
5963
{
@@ -109,8 +113,6 @@ public async Task Client_HandshakeAndData_WithOpenSslServer(CancellationToken ca
109113
[Test]
110114
public async Task Server_HandshakeAndData_WithOpenSslClient(CancellationToken cancellationToken)
111115
{
112-
Skip.Unless(IsOpensslAvailable, "openssl not found in PATH");
113-
114116
int port = GetFreeUdpPort();
115117
using UdpClient udp = new(new IPEndPoint(IPAddress.Loopback, port));
116118
UdpDatagramTransport transport = new(udp);
@@ -121,7 +123,7 @@ public async Task Server_HandshakeAndData_WithOpenSslClient(CancellationToken ca
121123
new DtlsServerOptions { Certificate = Cert }
122124
);
123125

124-
using Process opensslClient = Process.Start
126+
using Process? opensslClient = Process.Start
125127
(
126128
new ProcessStartInfo
127129
(
@@ -133,7 +135,8 @@ public async Task Server_HandshakeAndData_WithOpenSslClient(CancellationToken ca
133135
RedirectStandardOutput = true,
134136
CreateNoWindow = true
135137
}
136-
)!;
138+
);
139+
Assert.NotNull(opensslClient);
137140

138141
try
139142
{

tests/DTLS.Tests/StunServerInteropTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ public class StunServerInteropTests
99
{
1010
private const int StunPort = 5349;
1111

12+
[Before(Test)]
13+
public void SkipWhenRunningInCi()
14+
{
15+
Skip.When(bool.TryParse(Environment.GetEnvironmentVariable("CI"), out bool isCi) && isCi, "STUN interop tests are skipped when CI=true.");
16+
}
17+
1218
[Test]
1319
[Arguments("stun.wirecloud.de")]
1420
[Arguments("stun.hot-chilli.net")]
1521
public async Task Client_DtlsHandshake_WithStunServer(string stunHost, CancellationToken cancellationToken)
1622
{
17-
Skip.When(bool.TryParse(Environment.GetEnvironmentVariable("CI"), out bool isCi) && isCi, "STUN interop tests are skipped when CI=true.");
18-
1923
IPAddress[] addresses = await Dns.GetHostAddressesAsync(stunHost, AddressFamily.InterNetwork, cancellationToken);
2024

2125
using UdpClient udp = new();

tests/DTLS.Tests/WolfSslInteropTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task Client_Dtls13Handshake_WithWolfSslServer(CancellationToken can
6060
(string certPath, string keyPath) = ExportPem(Cert, tmpDir);
6161
int port = GetFreeUdpPort();
6262
// -u = DTLS, -v 4 = 1.3, -d = skip peer verify, -e = echo
63-
using Process server = Process.Start
63+
using Process? server = Process.Start
6464
(
6565
new ProcessStartInfo
6666
(
@@ -72,7 +72,8 @@ public async Task Client_Dtls13Handshake_WithWolfSslServer(CancellationToken can
7272
RedirectStandardOutput = true,
7373
CreateNoWindow = true
7474
}
75-
)!;
75+
);
76+
Assert.NotNull(server);
7677

7778
try
7879
{
@@ -134,7 +135,7 @@ public async Task Server_Dtls13Handshake_WithWolfSslClient(CancellationToken can
134135
);
135136

136137
// -u = DTLS, -v 4 = 1.3, -d = skip peer verify
137-
using Process wolfClient = Process.Start
138+
using Process? wolfClient = Process.Start
138139
(
139140
new ProcessStartInfo
140141
(
@@ -146,7 +147,8 @@ public async Task Server_Dtls13Handshake_WithWolfSslClient(CancellationToken can
146147
RedirectStandardOutput = true,
147148
CreateNoWindow = true
148149
}
149-
)!;
150+
);
151+
Assert.NotNull(wolfClient);
150152

151153
try
152154
{

0 commit comments

Comments
 (0)