mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
tests: Allow setting configuration file for test server
This allows testing the server with a configuration file. This also adds an option for the stand-alone test server to skip parsing the system-wide configuration file. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Andreas Schneider
parent
79f0c38fbd
commit
e7ef40c8f0
@ -55,6 +55,7 @@ void free_server_state(struct server_state_st *state)
|
||||
|
||||
SAFE_FREE(state->expected_username);
|
||||
SAFE_FREE(state->expected_password);
|
||||
SAFE_FREE(state->config_file);
|
||||
|
||||
end:
|
||||
return;
|
||||
@ -120,6 +121,22 @@ int run_server(struct server_state_st *state)
|
||||
}
|
||||
}
|
||||
|
||||
if (!state->parse_global_config) {
|
||||
rc = ssh_bind_options_set(sshbind,
|
||||
SSH_BIND_OPTIONS_PROCESS_CONFIG,
|
||||
&(state->parse_global_config));
|
||||
if (rc != 0) {
|
||||
goto free_sshbind;
|
||||
}
|
||||
}
|
||||
|
||||
if (state->config_file) {
|
||||
rc = ssh_bind_options_parse_config(sshbind, state->config_file);
|
||||
if (rc != 0) {
|
||||
goto free_sshbind;
|
||||
}
|
||||
}
|
||||
|
||||
rc = ssh_bind_options_set(sshbind,
|
||||
SSH_BIND_OPTIONS_BINDADDR,
|
||||
state->address);
|
||||
|
Reference in New Issue
Block a user