Skip to content

Commit

Permalink
Avoid being stopped after previous tests that do not finish authentic…
Browse files Browse the repository at this point in the history
…ation.

Override the per-source penalties in OpenSSH 9.8.

Addressing
Run docker exec python-libssh bash -c 'cp -rp tests /tmp/tests && cd /tmp/tests && for i in *.py ; do python3 -Werror $i ; done'
.
----------------------------------------------------------------------
Ran 1 test in 0.009s

OK
.......
----------------------------------------------------------------------
Ran 7 tests in 0.359s

OK
.E
======================================================================
ERROR: test2_command (__main__.CommandTest.test2_command)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tests/t3_command.py", line 52, in test2_command
    session.connect()
    ~~~~~~~~~~~~~~~^^
  File "libssh.pyx", line 107, in libssh.Session.connect
libssh.libsshException: Socket error: Connection reset by peer

----------------------------------------------------------------------
Ran 2 tests in 0.005s

FAILED (errors=1)
E
======================================================================
ERROR: test1_shell (__main__.ShellTest.test1_shell)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tests/t4_shell.py", line 15, in test1_shell
    session.connect()
    ~~~~~~~~~~~~~~~^^
  File "libssh.pyx", line 107, in libssh.Session.connect
libssh.libsshException: Socket error: Connection reset by peer

----------------------------------------------------------------------
Ran 1 test in 0.002s

FAILED (errors=1)
EE
======================================================================
ERROR: test1_put (__main__.SFTPTest.test1_put)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tests/t8_sftp.py", line 12, in test1_put
    session.connect()
    ~~~~~~~~~~~~~~~^^
  File "libssh.pyx", line 107, in libssh.Session.connect
libssh.libsshException: Socket error: Connection reset by peer

======================================================================
ERROR: test1_put_filename_bytes (__main__.SFTPTest.test1_put_filename_bytes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tests/t8_sftp.py", line 35, in test1_put_filename_bytes
    session.connect()
    ~~~~~~~~~~~~~~~^^
  File "libssh.pyx", line 107, in libssh.Session.connect
libssh.libsshException: Socket error: Connection reset by peer

----------------------------------------------------------------------
Ran 2 tests in 0.002s

FAILED (errors=2)
  • Loading branch information
adelton committed Aug 5, 2024
1 parent 7d42590 commit a43e344
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ RUN dnf install -y --setopt=install_weak_deps=False python3-devel python3-setupt
RUN if test -f /etc/nsswitch.conf ; then grep hosts: /etc/nsswitch.conf && sed -i 's/^hosts:.*/hosts: files dns myhostname/' /etc/nsswitch.conf ; fi
RUN echo 'set enable-bracketed-paste off' >> ~root/.inputrc
RUN for i in rsa ecdsa ed25519 ; do /usr/libexec/openssh/sshd-keygen $i ; done
RUN mkdir -p /etc/ssh/sshd_config.d
RUN echo 'PerSourcePenaltyExemptList "0.0.0.0/0,::/0"' > /etc/ssh/sshd_config.d/99-no-per-source-penalty.conf
RUN /usr/sbin/sshd -t || rm -f /etc/ssh/sshd_config.d/99-no-per-source-penalty.conf
RUN mkdir -p ~/.ssh && echo localhost $( cat /etc/ssh/ssh_host_ecdsa_key.pub ) > ~/.ssh/known_hosts
RUN yes | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
RUN cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys && chmod 400 ~/.ssh/authorized_keys
Expand Down

0 comments on commit a43e344

Please sign in to comment.