mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:03:40 +03:00
pytest: add tests using sshd
With either /usr/sbin/sshd found or configured via --with-test-sshd=path add tests for SCP down- and uploads, insecure, with known hosts or not, with authorized user key or unauthorized one. Working now with libssh and libssh2, using a hashed known_hosts file. Closes #19934
This commit is contained in:
parent
407d2f3d57
commit
eb39fee40b
12 changed files with 883 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ from testenv.env import EnvConfig
|
|||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
|
||||
|
||||
from testenv import Env, Nghttpx, Httpd, NghttpxQuic, NghttpxFwd
|
||||
from testenv import Env, Nghttpx, Httpd, NghttpxQuic, NghttpxFwd, Sshd
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -134,6 +134,17 @@ def nghttpx_fwd(env, httpd) -> Generator[Union[Nghttpx,bool], None, None]:
|
|||
yield False
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def sshd(env: Env) -> Generator[Union[Sshd,bool], None, None]:
|
||||
if env.has_sshd():
|
||||
sshd = Sshd(env=env)
|
||||
assert sshd.initial_start(), f'{sshd.dump_log()}'
|
||||
yield sshd
|
||||
sshd.stop()
|
||||
else:
|
||||
yield False
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def configures_httpd(env, httpd) -> Generator[bool, None, None]:
|
||||
# include this fixture as test parameter if the test configures httpd itself
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue