Skip to content

Commit eae5215

Browse files
committed
debug
1 parent b480c1c commit eae5215

File tree

2 files changed

+122
-104
lines changed

2 files changed

+122
-104
lines changed

.github/workflows/build.yml

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -6,102 +6,102 @@ on:
66
- workflow_dispatch
77

88
jobs:
9-
Linux:
10-
runs-on: ubuntu-24.04
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v5
14-
with:
15-
fetch-depth: 0 # needed for Nerdbank.GitVersioning
16-
17-
- name: Setup .NET
18-
uses: actions/setup-dotnet@v4
19-
20-
- name: Build Unit Tests .NET
21-
run: dotnet build -f net9.0 test/Renci.SshNet.Tests/
22-
23-
- name: Build IntegrationTests .NET
24-
run: dotnet build -f net9.0 test/Renci.SshNet.IntegrationTests/
25-
26-
- name: Run Unit Tests .NET
27-
run: |
28-
dotnet test \
29-
-f net9.0 \
30-
--no-build \
31-
--logger "console;verbosity=normal" \
32-
--logger GitHubActions \
33-
-p:CollectCoverage=true \
34-
-p:CoverletOutputFormat=cobertura \
35-
-p:CoverletOutput=../../coverlet/linux_unit_test_net_9_coverage.xml \
36-
test/Renci.SshNet.Tests/
37-
38-
- name: Run Integration Tests .NET
39-
run: |
40-
dotnet test \
41-
-f net9.0 \
42-
--no-build \
43-
--logger "console;verbosity=normal" \
44-
--logger GitHubActions \
45-
-p:CollectCoverage=true \
46-
-p:CoverletOutputFormat=cobertura \
47-
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage.xml \
48-
test/Renci.SshNet.IntegrationTests/
49-
50-
- name: Archive Coverlet Results
51-
uses: actions/upload-artifact@v4
52-
with:
53-
name: Coverlet Results Linux
54-
path: coverlet
55-
56-
Windows:
57-
runs-on: windows-2025
58-
steps:
59-
- name: Checkout
60-
uses: actions/checkout@v5
61-
with:
62-
fetch-depth: 0 # needed for Nerdbank.GitVersioning
63-
64-
- name: Setup .NET
65-
uses: actions/setup-dotnet@v4
66-
67-
- name: Build Solution
68-
run: dotnet build Renci.SshNet.sln
69-
70-
- name: Publish AOT Compatibility Test App
71-
run: dotnet publish -r win-x64 /warnaserror test/Renci.SshNet.AotCompatibilityTestApp/
72-
73-
- name: Create NuGet Package
74-
run: dotnet pack
75-
76-
- name: Archive NuGet Package
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: NuGet Package
80-
path: src/Renci.SshNet/bin/Release/*.*nupkg
81-
82-
- name: Run Unit Tests .NET
83-
run: |
84-
dotnet test `
85-
-f net9.0 `
86-
--no-build `
87-
--logger "console;verbosity=normal" `
88-
--logger GitHubActions `
89-
-p:CollectCoverage=true `
90-
-p:CoverletOutputFormat=cobertura `
91-
-p:CoverletOutput=../../coverlet/windows_unit_test_net_9_coverage.xml `
92-
test/Renci.SshNet.Tests/
93-
94-
- name: Run Unit Tests .NET Framework
95-
run: |
96-
dotnet test `
97-
-f net462 `
98-
--no-build `
99-
--logger "console;verbosity=normal" `
100-
--logger GitHubActions `
101-
-p:CollectCoverage=true `
102-
-p:CoverletOutputFormat=cobertura `
103-
-p:CoverletOutput=../../coverlet/windows_unit_test_net_4_6_2_coverage.xml `
104-
test/Renci.SshNet.Tests/
9+
# Linux:
10+
# runs-on: ubuntu-24.04
11+
# steps:
12+
# - name: Checkout
13+
# uses: actions/checkout@v5
14+
# with:
15+
# fetch-depth: 0 # needed for Nerdbank.GitVersioning
16+
17+
# - name: Setup .NET
18+
# uses: actions/setup-dotnet@v4
19+
20+
# - name: Build Unit Tests .NET
21+
# run: dotnet build -f net9.0 test/Renci.SshNet.Tests/
22+
23+
# - name: Build IntegrationTests .NET
24+
# run: dotnet build -f net9.0 test/Renci.SshNet.IntegrationTests/
25+
26+
# - name: Run Unit Tests .NET
27+
# run: |
28+
# dotnet test \
29+
# -f net9.0 \
30+
# --no-build \
31+
# --logger "console;verbosity=normal" \
32+
# --logger GitHubActions \
33+
# -p:CollectCoverage=true \
34+
# -p:CoverletOutputFormat=cobertura \
35+
# -p:CoverletOutput=../../coverlet/linux_unit_test_net_9_coverage.xml \
36+
# test/Renci.SshNet.Tests/
37+
38+
# - name: Run Integration Tests .NET
39+
# run: |
40+
# dotnet test \
41+
# -f net9.0 \
42+
# --no-build \
43+
# --logger "console;verbosity=normal" \
44+
# --logger GitHubActions \
45+
# -p:CollectCoverage=true \
46+
# -p:CoverletOutputFormat=cobertura \
47+
# -p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage.xml \
48+
# test/Renci.SshNet.IntegrationTests/
49+
50+
# - name: Archive Coverlet Results
51+
# uses: actions/upload-artifact@v4
52+
# with:
53+
# name: Coverlet Results Linux
54+
# path: coverlet
55+
56+
# Windows:
57+
# runs-on: windows-2025
58+
# steps:
59+
# - name: Checkout
60+
# uses: actions/checkout@v5
61+
# with:
62+
# fetch-depth: 0 # needed for Nerdbank.GitVersioning
63+
64+
# - name: Setup .NET
65+
# uses: actions/setup-dotnet@v4
66+
67+
# - name: Build Solution
68+
# run: dotnet build Renci.SshNet.sln
69+
70+
# - name: Publish AOT Compatibility Test App
71+
# run: dotnet publish -r win-x64 /warnaserror test/Renci.SshNet.AotCompatibilityTestApp/
72+
73+
# - name: Create NuGet Package
74+
# run: dotnet pack
75+
76+
# - name: Archive NuGet Package
77+
# uses: actions/upload-artifact@v4
78+
# with:
79+
# name: NuGet Package
80+
# path: src/Renci.SshNet/bin/Release/*.*nupkg
81+
82+
# - name: Run Unit Tests .NET
83+
# run: |
84+
# dotnet test `
85+
# -f net9.0 `
86+
# --no-build `
87+
# --logger "console;verbosity=normal" `
88+
# --logger GitHubActions `
89+
# -p:CollectCoverage=true `
90+
# -p:CoverletOutputFormat=cobertura `
91+
# -p:CoverletOutput=../../coverlet/windows_unit_test_net_9_coverage.xml `
92+
# test/Renci.SshNet.Tests/
93+
94+
# - name: Run Unit Tests .NET Framework
95+
# run: |
96+
# dotnet test `
97+
# -f net462 `
98+
# --no-build `
99+
# --logger "console;verbosity=normal" `
100+
# --logger GitHubActions `
101+
# -p:CollectCoverage=true `
102+
# -p:CoverletOutputFormat=cobertura `
103+
# -p:CoverletOutput=../../coverlet/windows_unit_test_net_4_6_2_coverage.xml `
104+
# test/Renci.SshNet.Tests/
105105

106106
Windows-Integration-Tests:
107107
name: Windows Integration Tests
@@ -132,8 +132,9 @@ jobs:
132132
run:
133133
dotnet test `
134134
-f net48 `
135-
--logger "console;verbosity=normal" `
135+
--logger "console;verbosity=detailed" `
136136
--logger GitHubActions `
137+
--filter "Name~Common_CreateMoreChannelsThanMaxSessions" `
137138
-p:CollectCoverage=true `
138139
-p:CoverletOutputFormat=cobertura `
139140
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage.xml `
@@ -143,8 +144,9 @@ jobs:
143144
run:
144145
dotnet test `
145146
-f net9.0 `
146-
--logger "console;verbosity=normal" `
147+
--logger "console;verbosity=detailed" `
147148
--logger GitHubActions `
149+
--filter "Name~Common_CreateMoreChannelsThanMaxSessions" `
148150
-p:CollectCoverage=true `
149151
-p:CoverletOutputFormat=cobertura `
150152
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage.xml `

test/Renci.SshNet.IntegrationTests/TestsFixtures/InfrastructureFixture.cs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ private InfrastructureFixture()
3030

3131
private IFutureDockerImage _sshServerImage;
3232

33-
public string SshServerHostName { get; set; }
33+
public string SshServerHostName { get; private set; }
3434

35-
public ushort SshServerPort { get; set; }
35+
public ushort SshServerPort { get; private set; }
3636

37-
public SshUser AdminUser = new SshUser("sshnetadm", "ssh4ever");
37+
public SshUser AdminUser { get; } = new SshUser("sshnetadm", "ssh4ever");
3838

39-
public SshUser User = new SshUser("sshnet", "ssh4ever");
39+
public SshUser User { get; } = new SshUser("sshnet", "ssh4ever");
4040

4141
public async Task InitializeAsync()
4242
{
4343
#pragma warning disable MA0144 // use System.OperatingSystem to check the current OS
4444
// for the Windows Tests in CI, the Container is set up in WSL2 with Podman
45-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.GetEnvironmentVariable("CI") == "true")
45+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
46+
Environment.GetEnvironmentVariable("CI") == "true")
4647
#pragma warning restore MA0144 // use System.OperatingSystem to check the current OS
4748
{
4849
SshServerPort = 2222;
@@ -86,9 +87,24 @@ public async Task InitializeAsync()
8687

8788
public async Task DisposeAsync()
8889
{
90+
#pragma warning disable S6966 // Awaitable method should be used
91+
try
92+
{
93+
using SftpClient client = new(new LinuxAdminConnectionFactory(SshServerHostName, SshServerPort).Create());
94+
95+
client.Connect();
96+
97+
Console.WriteLine("=== start auth.log ===");
98+
Console.WriteLine(client.ReadAllText("/var/log/auth.log"));
99+
Console.WriteLine("=== end auth.log ===");
100+
}
101+
catch (Exception ex)
102+
{
103+
Console.Error.WriteLine(ex.ToString());
104+
}
105+
89106
if (_sshServer != null)
90107
{
91-
#pragma warning disable S6966 // Awaitable method should be used
92108
//try
93109
//{
94110
// File.WriteAllBytes(@"C:\tmp\auth.log", await _sshServer.ReadFileAsync("/var/log/auth.log").ConfigureAwait(false));

0 commit comments

Comments
 (0)