tests: Do not process config when reinitializing session

Do not process system-wide configuration when reinitializing a session
during testing.  This could lead to different settings set from the
expected one (which was initialized during test setup).

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit f97a8b4e3f)
This commit is contained in:
Anderson Toshiyuki Sasaki
2019-10-02 15:24:59 +02:00
committed by Andreas Schneider
parent f199bd4879
commit a47a291303

View File

@@ -103,6 +103,7 @@ static void torture_knownhosts_port(void **state) {
char *p;
FILE *file;
int rc;
bool process_config = false;
snprintf(tmp_file,
sizeof(tmp_file),
@@ -137,6 +138,7 @@ static void torture_knownhosts_port(void **state) {
/* Now, connect back to the ssh server and verify the known host line */
s->ssh.session = session = ssh_new();
ssh_options_set(session, SSH_OPTIONS_PROCESS_CONFIG, &process_config);
ssh_options_set(session, SSH_OPTIONS_HOST, TORTURE_SSH_SERVER);
ssh_options_set(session, SSH_OPTIONS_KNOWNHOSTS, known_hosts_file);
free(known_hosts_file);