Skip to content

Commit 084cb30

Browse files
committed
More specific tests
1 parent a1cfde4 commit 084cb30

File tree

2 files changed

+96
-7
lines changed

2 files changed

+96
-7
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
-p:CoverletOutput=../../coverlet/linux_unit_test_net_9_coverage.xml \
3636
test/Renci.SshNet.Tests/
3737
38-
- name: Run Integration Tests .NET
38+
- name: Run Integration Tests .NET 1
3939
run: |
4040
dotnet test \
4141
-f net9.0 \
@@ -44,7 +44,33 @@ jobs:
4444
--logger GitHubActions \
4545
-p:CollectCoverage=true \
4646
-p:CoverletOutputFormat=cobertura \
47-
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage.xml \
47+
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage_1.xml \
48+
test/Renci.SshNet.IntegrationTests/
49+
50+
- name: Run Integration Tests .NET 2
51+
run: |
52+
dotnet test \
53+
-f net9.0 \
54+
--logger "console;verbosity=normal" \
55+
--logger GitHubActions \
56+
--filter "Name=MLKem768X25519Sha256" \
57+
-p:DefineConstants=Test_BCL_MLKem \
58+
-p:CollectCoverage=true \
59+
-p:CoverletOutputFormat=cobertura \
60+
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage_2.xml \
61+
test/Renci.SshNet.IntegrationTests/
62+
63+
- name: Run Integration Tests .NET 3
64+
run: |
65+
dotnet test \
66+
-f net9.0 \
67+
--logger "console;verbosity=normal" \
68+
--logger GitHubActions \
69+
--filter "Name=MLKem768X25519Sha256" \
70+
-p:DefineConstants=Test_BouncyCastle_MLKem \
71+
-p:CollectCoverage=true \
72+
-p:CoverletOutputFormat=cobertura \
73+
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage_3.xml \
4874
test/Renci.SshNet.IntegrationTests/
4975
5076
- name: Archive Coverlet Results
@@ -128,15 +154,41 @@ jobs:
128154
podman build -t renci-ssh-tests-server-image -f test/Renci.SshNet.IntegrationTests/Dockerfile test/Renci.SshNet.IntegrationTests/
129155
podman run --rm -h renci-ssh-tests-server -d -p 2222:22 renci-ssh-tests-server-image
130156
131-
- name: Run Integration Tests .NET Framework
157+
- name: Run Integration Tests .NET Framework 1
158+
run:
159+
dotnet test `
160+
-f net48 `
161+
--logger "console;verbosity=normal" `
162+
--logger GitHubActions `
163+
-p:CollectCoverage=true `
164+
-p:CoverletOutputFormat=cobertura `
165+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage_1.xml `
166+
test\Renci.SshNet.IntegrationTests\
167+
168+
- name: Run Integration Tests .NET Framework 2
132169
run:
133170
dotnet test `
134171
-f net48 `
135172
--logger "console;verbosity=normal" `
136173
--logger GitHubActions `
174+
--filter "Name=MLKem768X25519Sha256" \
175+
-p:DefineConstants=Test_BCL_MLKem \
137176
-p:CollectCoverage=true `
138177
-p:CoverletOutputFormat=cobertura `
139-
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage.xml `
178+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage_2.xml `
179+
test\Renci.SshNet.IntegrationTests\
180+
181+
- name: Run Integration Tests .NET Framework 3
182+
run:
183+
dotnet test `
184+
-f net48 `
185+
--logger "console;verbosity=normal" `
186+
--logger GitHubActions `
187+
--filter "Name=MLKem768X25519Sha256" \
188+
-p:DefineConstants=Test_BouncyCastle_MLKem \
189+
-p:CollectCoverage=true `
190+
-p:CoverletOutputFormat=cobertura `
191+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage_3.xml `
140192
test\Renci.SshNet.IntegrationTests\
141193

142194
- name: Archive Coverlet Results
@@ -170,15 +222,41 @@ jobs:
170222
podman build -t renci-ssh-tests-server-image -f test/Renci.SshNet.IntegrationTests/Dockerfile test/Renci.SshNet.IntegrationTests/
171223
podman run --rm -h renci-ssh-tests-server -d -p 2222:22 renci-ssh-tests-server-image
172224
173-
- name: Run Integration Tests .NET
225+
- name: Run Integration Tests .NET 1
226+
run:
227+
dotnet test `
228+
-f net9.0 `
229+
--logger "console;verbosity=normal" `
230+
--logger GitHubActions `
231+
-p:CollectCoverage=true `
232+
-p:CoverletOutputFormat=cobertura `
233+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage_1.xml `
234+
test\Renci.SshNet.IntegrationTests\
235+
236+
- name: Run Integration Tests .NET 2
237+
run:
238+
dotnet test `
239+
-f net9.0 `
240+
--logger "console;verbosity=normal" `
241+
--logger GitHubActions `
242+
--filter "Name=MLKem768X25519Sha256" \
243+
-p:DefineConstants=Test_BCL_MLKem \
244+
-p:CollectCoverage=true `
245+
-p:CoverletOutputFormat=cobertura `
246+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage_2.xml `
247+
test\Renci.SshNet.IntegrationTests\
248+
249+
- name: Run Integration Tests .NET 3
174250
run:
175251
dotnet test `
176252
-f net9.0 `
177253
--logger "console;verbosity=normal" `
178254
--logger GitHubActions `
255+
--filter "Name=MLKem768X25519Sha256" \
256+
-p:DefineConstants=Test_BouncyCastle_MLKem \
179257
-p:CollectCoverage=true `
180258
-p:CoverletOutputFormat=cobertura `
181-
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage.xml `
259+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage_3.xml `
182260
test\Renci.SshNet.IntegrationTests\
183261

184262
- name: Archive Coverlet Results

src/Renci.SshNet/Security/KeyExchangeMLKem768X25519Sha256.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ namespace Renci.SshNet.Security
1111
{
1212
internal sealed partial class KeyExchangeMLKem768X25519Sha256 : KeyExchangeECCurve25519
1313
{
14+
#if Test_BCL_MLKem
15+
private MLKemBclImpl _mlkemImpl;
16+
#elif Test_BouncyCastle_MLKem
17+
private MLKemBouncyCastleImpl _mlkemImpl;
18+
#else
1419
private Impl _mlkemImpl;
20+
#endif
1521

1622
/// <summary>
1723
/// Gets algorithm name.
@@ -39,6 +45,11 @@ protected override void StartImpl()
3945

4046
Session.KeyExchangeHybridReplyMessageReceived += Session_KeyExchangeHybridReplyMessageReceived;
4147

48+
#if Test_BCL_MLKem
49+
_mlkemImpl = new MLKemBclImpl();
50+
#elif Test_BouncyCastle_MLKem
51+
_mlkemImpl = new MLKemBouncyCastleImpl();
52+
#else
4253
if (MLKem.IsSupported)
4354
{
4455
_mlkemImpl = new MLKemBclImpl();
@@ -47,7 +58,7 @@ protected override void StartImpl()
4758
{
4859
_mlkemImpl = new MLKemBouncyCastleImpl();
4960
}
50-
61+
#endif
5162
var mlkem768PublicKey = _mlkemImpl.GenerateClientPublicKey();
5263

5364
var x25519PublicKey = _impl.GenerateClientPublicKey();

0 commit comments

Comments
 (0)