Skip to content

appveyor test #1220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Renci.SshNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 4 additions & 14 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
os: Visual Studio 2022
os: Ubuntu2004

before_build:
- nuget restore Renci.SshNet.sln

install:
- cinst dotnet-sdk --version=7.0.402 --limit-output

build:
project: Renci.SshNet.sln
verbosity: minimal
build_script:
- dotnet build test/Renci.SshNet.IntegrationTests/

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
- dotnet test test/Renci.SshNet.IntegrationTests/ --logger "console;verbosity=detailed"
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

58 changes: 29 additions & 29 deletions test/Renci.SshNet.IntegrationTests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Renci.SshNet.IntegrationTests.TestsFixtures
[assembly: DoNotParallelize]
namespace Renci.SshNet.IntegrationTests.TestsFixtures
{
/// <summary>
/// The base class for integration tests
Expand Down