From 9e6f3e5537690a64b47940180a7747dfb9a823ed Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 21 Oct 2023 22:11:52 +0200 Subject: [PATCH 1/8] what does this do? --- Renci.SshNet.sln | 1 - appveyor.yml | 16 ---------------- global.json | 6 ------ 3 files changed, 23 deletions(-) delete mode 100644 global.json diff --git a/Renci.SshNet.sln b/Renci.SshNet.sln index 0ca62c338..acffc8dc0 100644 --- a/Renci.SshNet.sln +++ b/Renci.SshNet.sln @@ -25,7 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution appveyor.yml = appveyor.yml CODEOWNERS = CODEOWNERS Directory.Build.props = Directory.Build.props - global.json = global.json LICENSE = LICENSE README.md = README.md stylecop.json = stylecop.json diff --git a/appveyor.yml b/appveyor.yml index 66f10858d..5c16d5856 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,17 +1 @@ os: Visual Studio 2022 - -before_build: - - nuget restore Renci.SshNet.sln - -install: - - cinst dotnet-sdk --version=7.0.402 --limit-output - -build: - project: Renci.SshNet.sln - verbosity: minimal - -test_script: -- cmd: >- - vstest.console /logger:Appveyor test\Renci.SshNet.Tests\bin\Debug\net462\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration" --blame - - vstest.console /logger:Appveyor test\Renci.SshNet.Tests\bin\Debug\net7.0\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration" --blame diff --git a/global.json b/global.json deleted file mode 100644 index 878faf6e3..000000000 --- a/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "sdk": { - "version": "7.0.402", - "rollForward": "disable" - } -} From b0fb8fde8a173abe9bd2cdfe99dcad7be5d1b875 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 21 Oct 2023 22:18:20 +0200 Subject: [PATCH 2/8] ok --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 5c16d5856..9350a0e9e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1 +1,4 @@ os: Visual Studio 2022 + +before_build: + - nuget restore Renci.SshNet.sln From 9ad5685b5c856aba916dea81d9a61e08eb09cd5a Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 21 Oct 2023 22:55:21 +0200 Subject: [PATCH 3/8] --no-build upsets docker? --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 9350a0e9e..f354c2d5d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,3 +2,6 @@ os: Visual Studio 2022 before_build: - nuget restore Renci.SshNet.sln + +test_script: + - dotnet test From 385863d81d759dd402cf2ec06b15205ff9708a1f Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 21 Oct 2023 23:31:34 +0200 Subject: [PATCH 4/8] split up the dockerfile command --- test/Renci.SshNet.IntegrationTests/Dockerfile | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/test/Renci.SshNet.IntegrationTests/Dockerfile b/test/Renci.SshNet.IntegrationTests/Dockerfile index 19ef6e19e..f24141d69 100644 --- a/test/Renci.SshNet.IntegrationTests/Dockerfile +++ b/test/Renci.SshNet.IntegrationTests/Dockerfile @@ -4,46 +4,46 @@ COPY --chown=root:root server/ssh /etc/ssh/ COPY --chown=root:root server/script /opt/sshnet COPY user/sshnet /home/sshnet/.ssh -RUN apk update && apk upgrade --no-cache && \ - apk add --no-cache syslog-ng && \ +RUN apk update && apk upgrade --no-cache +RUN apk add --no-cache syslog-ng # install and configure sshd - apk add --no-cache openssh && \ +RUN apk add --no-cache openssh # install openssh-server-pam to allow for keyboard-interactive authentication - apk add --no-cache openssh-server-pam && \ - dos2unix /etc/ssh/* && \ - chmod 400 /etc/ssh/ssh*key && \ - sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \ - sed -i 's/#LogLevel\s*INFO/LogLevel DEBUG3/' /etc/ssh/sshd_config && \ +RUN apk add --no-cache openssh-server-pam +RUN dos2unix /etc/ssh/* +RUN chmod 400 /etc/ssh/ssh*key +RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +RUN sed -i 's/#LogLevel\s*INFO/LogLevel DEBUG3/' /etc/ssh/sshd_config # Set the default RSA key - echo 'HostKey /etc/ssh/ssh_host_rsa_key' >> /etc/ssh/sshd_config && \ - chmod 646 /etc/ssh/sshd_config && \ +RUN echo 'HostKey /etc/ssh/ssh_host_rsa_key' >> /etc/ssh/sshd_config +RUN chmod 646 /etc/ssh/sshd_config # install and configure sudo - apk add --no-cache sudo && \ - addgroup sudo && \ +RUN apk add --no-cache sudo +RUN addgroup sudo # allow root to run any command - echo 'root ALL=(ALL) ALL' > /etc/sudoers && \ +RUN echo 'root ALL=(ALL) ALL' > /etc/sudoers # allow everyone in the 'sudo' group to run any command without a password - echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # add user to run most of the integration tests - adduser -D sshnet && \ - passwd -u sshnet && \ - echo 'sshnet:ssh4ever' | chpasswd && \ - dos2unix /home/sshnet/.ssh/* && \ - chown -R sshnet:sshnet /home/sshnet && \ - chmod -R 700 /home/sshnet/.ssh && \ - chmod -R 644 /home/sshnet/.ssh/authorized_keys && \ +RUN adduser -D sshnet +RUN passwd -u sshnet +RUN echo 'sshnet:ssh4ever' | chpasswd +RUN dos2unix /home/sshnet/.ssh/* +RUN chown -R sshnet:sshnet /home/sshnet +RUN chmod -R 700 /home/sshnet/.ssh +RUN chmod -R 644 /home/sshnet/.ssh/authorized_keys # add user to administer container (update configs, restart sshd) - adduser -D sshnetadm && \ - passwd -u sshnetadm && \ - echo 'sshnetadm:ssh4ever' | chpasswd && \ - addgroup sshnetadm sudo && \ - dos2unix /opt/sshnet/* && \ +RUN adduser -D sshnetadm +RUN passwd -u sshnetadm +RUN echo 'sshnetadm:ssh4ever' | chpasswd +RUN addgroup sshnetadm sudo +RUN dos2unix /opt/sshnet/* # install shadow package; we use chage command in this package to expire/unexpire password of the sshnet user - apk add --no-cache shadow && \ +RUN apk add --no-cache shadow # allow us to use telnet command; we use this in the remote port forwarding tests - apk --no-cache add busybox-extras && \ +RUN apk --no-cache add busybox-extras # install full-fledged ps command - apk add --no-cache procps +RUN apk add --no-cache procps EXPOSE 22 22 From 96bd792457ab1c5480ec2af333337e4a6f0a1600 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 21 Oct 2023 23:53:08 +0200 Subject: [PATCH 5/8] ubuntu image --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f354c2d5d..a0d444016 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ -os: Visual Studio 2022 +os: Ubuntu2004 -before_build: - - nuget restore Renci.SshNet.sln +build_script: + - dotnet build test_script: - dotnet test From ffae1779fa4d6b9da55413b66bcfdf85d1bba86a Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sun, 22 Oct 2023 16:32:36 +0200 Subject: [PATCH 6/8] just the integration tests --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a0d444016..d7a600f84 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ os: Ubuntu2004 build_script: - - dotnet build + - dotnet build test/Renci.SshNet.IntegrationTests/ test_script: - - dotnet test + - dotnet test test/Renci.SshNet.IntegrationTests/ From e780937e45b9a25a8a4ef21bf86d9a127f36a4b6 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sun, 22 Oct 2023 16:49:18 +0200 Subject: [PATCH 7/8] try to get the testcontainers stdout logs --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d7a600f84..70cffc94a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,4 +4,4 @@ build_script: - dotnet build test/Renci.SshNet.IntegrationTests/ test_script: - - dotnet test test/Renci.SshNet.IntegrationTests/ + - dotnet test test/Renci.SshNet.IntegrationTests/ --logger "console;verbosity=detailed" From 525cd8dd128fd6f9e7660713703aff0fa6d7ee7d Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sun, 22 Oct 2023 17:33:33 +0200 Subject: [PATCH 8/8] DoNotParallelize ? --- .../TestsFixtures/IntegrationTestBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Renci.SshNet.IntegrationTests/TestsFixtures/IntegrationTestBase.cs b/test/Renci.SshNet.IntegrationTests/TestsFixtures/IntegrationTestBase.cs index 1d6658fc2..e9ce5574b 100644 --- a/test/Renci.SshNet.IntegrationTests/TestsFixtures/IntegrationTestBase.cs +++ b/test/Renci.SshNet.IntegrationTests/TestsFixtures/IntegrationTestBase.cs @@ -1,4 +1,5 @@ -namespace Renci.SshNet.IntegrationTests.TestsFixtures +[assembly: DoNotParallelize] +namespace Renci.SshNet.IntegrationTests.TestsFixtures { /// /// The base class for integration tests