Skip to content

Commit 9e1ee0a

Browse files
Bump alpine from 3.20 to 3.21 in /test/Renci.SshNet.IntegrationTests (#1567)
* Bump alpine from 3.20 to 3.21 in /test/Renci.SshNet.IntegrationTests Bumps alpine from 3.20 to 3.21. --- updated-dependencies: - dependency-name: alpine dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * merge #1553 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Robert Hague <[email protected]>
1 parent 6d94e97 commit 9e1ee0a

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

test/Renci.SshNet.IntegrationTests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.20
1+
FROM alpine:3.21
22

33
COPY --chown=root:root server/ssh /etc/ssh/
44
COPY --chown=root:root server/script /opt/sshnet

test/Renci.SshNet.IntegrationTests/KeyExchangeAlgorithmTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public void TearDown()
2323
}
2424

2525
[TestMethod]
26-
[Ignore]
2726
public void SNtruP761X25519Sha512()
2827
{
2928
_remoteSshdConfig.ClearKeyExchangeAlgorithms()

test/Renci.SshNet.IntegrationTests/SshConnectionDisruptor.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,24 @@ public SshConnectionRestorer BreakConnections()
2222

2323
private static void PauseSshd(SshClient client)
2424
{
25-
var command = client.CreateCommand("sudo echo 'DenyUsers sshnet' >> /etc/ssh/sshd_config");
26-
var output = command.Execute();
27-
if (command.ExitStatus != 0)
25+
using (var command = client.CreateCommand("sudo echo 'DenyUsers sshnet' >> /etc/ssh/sshd_config"))
2826
{
29-
throw new ApplicationException(
30-
$"Blocking user sshnet failed with exit code {command.ExitStatus}.\r\n{output}\r\n{command.Error}");
27+
var output = command.Execute();
28+
if (command.ExitStatus != 0)
29+
{
30+
throw new ApplicationException(
31+
$"Blocking user sshnet failed with exit code {command.ExitStatus}.\r\n{output}\r\n{command.Error}");
32+
}
3133
}
32-
command = client.CreateCommand("sudo pkill -9 -U sshnet -f sshd.pam");
33-
output = command.Execute();
34-
if (command.ExitStatus != 0)
34+
35+
using (var command = client.CreateCommand("sudo pkill -9 -U sshnet -f sshd-session.pam"))
3536
{
36-
throw new ApplicationException(
37-
$"Killing sshd.pam service failed with exit code {command.ExitStatus}.\r\n{output}\r\n{command.Error}");
37+
var output = command.Execute();
38+
if (command.ExitStatus != 0)
39+
{
40+
throw new ApplicationException(
41+
$"Killing sshd-session.pam service failed with exit code {command.ExitStatus}.\r\n{output}\r\n{command.Error}");
42+
}
3843
}
3944
}
4045
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,16 @@ public async Task DisposeAsync()
7575
{
7676
if (_sshServer != null)
7777
{
78+
#pragma warning disable S6966 // Awaitable method should be used
7879
//try
7980
//{
80-
// File.WriteAllBytes(@"C:\tmp\auth.log", await _sshServer.ReadFileAsync("/var/log/auth.log"));
81+
// File.WriteAllBytes(@"C:\tmp\auth.log", await _sshServer.ReadFileAsync("/var/log/auth.log").ConfigureAwait(false));
8182
//}
8283
//catch (Exception ex)
8384
//{
8485
// Console.Error.WriteLine(ex.ToString());
8586
//}
87+
#pragma warning restore S6966 // Awaitable method should be used
8688

8789
await _sshServer.DisposeAsync();
8890
}

0 commit comments

Comments
 (0)