mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
tests: Support libssh server logging into separate file
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
@@ -66,6 +66,7 @@ static int setup_default_server(void **state)
|
|||||||
//char trusted_ca_pubkey[1024];
|
//char trusted_ca_pubkey[1024];
|
||||||
|
|
||||||
char sshd_path[1024];
|
char sshd_path[1024];
|
||||||
|
char log_file[1024];
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
char pid_str[1024];
|
char pid_str[1024];
|
||||||
@@ -92,6 +93,11 @@ static int setup_default_server(void **state)
|
|||||||
rc = mkdir(sshd_path, 0755);
|
rc = mkdir(sshd_path, 0755);
|
||||||
assert_return_code(rc, errno);
|
assert_return_code(rc, errno);
|
||||||
|
|
||||||
|
snprintf(log_file,
|
||||||
|
sizeof(log_file),
|
||||||
|
"%s/sshd/log",
|
||||||
|
s->socket_dir);
|
||||||
|
|
||||||
snprintf(ed25519_hostkey,
|
snprintf(ed25519_hostkey,
|
||||||
sizeof(ed25519_hostkey),
|
sizeof(ed25519_hostkey),
|
||||||
"%s/sshd/ssh_host_ed25519_key",
|
"%s/sshd/ssh_host_ed25519_key",
|
||||||
@@ -136,7 +142,9 @@ static int setup_default_server(void **state)
|
|||||||
ss->expected_username = NULL;
|
ss->expected_username = NULL;
|
||||||
ss->expected_password = NULL;
|
ss->expected_password = NULL;
|
||||||
|
|
||||||
|
/* not to mix up the client and server messages */
|
||||||
ss->verbosity = torture_libssh_verbosity();
|
ss->verbosity = torture_libssh_verbosity();
|
||||||
|
ss->log_file = strdup(log_file);
|
||||||
|
|
||||||
ss->auth_methods = SSH_AUTH_METHOD_PASSWORD | SSH_AUTH_METHOD_PUBLICKEY;
|
ss->auth_methods = SSH_AUTH_METHOD_PASSWORD | SSH_AUTH_METHOD_PUBLICKEY;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user