Blame SOURCES/libssh-0.9.4-do-not-parse-config-during-tests.patch

21fd01
From f10d80047c660e33f5c365bf3cf436a0c2a300f1 Mon Sep 17 00:00:00 2001
21fd01
From: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
21fd01
Date: Tue, 23 Jun 2020 18:31:47 +0200
21fd01
Subject: [PATCH] tests: Do not parse configuration file in torture_knownhosts
21fd01
21fd01
The test might fail if there is a local configuration file that changes
21fd01
the location of the known_hosts file.  The test should not be affected
21fd01
by configuration files present in the testing environment.
21fd01
21fd01
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
21fd01
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
21fd01
---
21fd01
 tests/client/torture_knownhosts.c | 8 ++++++++
21fd01
 1 file changed, 8 insertions(+)
21fd01
21fd01
diff --git a/tests/client/torture_knownhosts.c b/tests/client/torture_knownhosts.c
21fd01
index fcc54846..55aee217 100644
21fd01
--- a/tests/client/torture_knownhosts.c
21fd01
+++ b/tests/client/torture_knownhosts.c
21fd01
@@ -307,6 +307,7 @@ static void torture_knownhosts_other_auto(void **state) {
21fd01
     char tmp_file[1024] = {0};
21fd01
     char *known_hosts_file = NULL;
21fd01
     int rc;
21fd01
+    bool process_config = false;
21fd01
 
21fd01
     snprintf(tmp_file,
21fd01
              sizeof(tmp_file),
21fd01
@@ -344,6 +345,9 @@ static void torture_knownhosts_other_auto(void **state) {
21fd01
 
21fd01
     s->ssh.session = session;
21fd01
 
21fd01
+    rc = ssh_options_set(session, SSH_OPTIONS_PROCESS_CONFIG, &process_config);
21fd01
+    assert_ssh_return_code(session, rc);
21fd01
+
21fd01
     rc = ssh_options_set(session, SSH_OPTIONS_HOST, TORTURE_SSH_SERVER);
21fd01
     assert_ssh_return_code(session, rc);
21fd01
 
21fd01
@@ -368,6 +372,7 @@ static void torture_knownhosts_conflict(void **state) {
21fd01
     char *known_hosts_file = NULL;
21fd01
     FILE *file;
21fd01
     int rc;
21fd01
+    bool process_config = false;
21fd01
 
21fd01
     snprintf(tmp_file,
21fd01
              sizeof(tmp_file),
21fd01
@@ -411,6 +416,9 @@ static void torture_knownhosts_conflict(void **state) {
21fd01
 
21fd01
     s->ssh.session = session;
21fd01
 
21fd01
+    rc = ssh_options_set(session, SSH_OPTIONS_PROCESS_CONFIG, &process_config);
21fd01
+    assert_ssh_return_code(session, rc);
21fd01
+
21fd01
     ssh_options_set(session, SSH_OPTIONS_HOST, TORTURE_SSH_SERVER);
21fd01
     ssh_options_set(session, SSH_OPTIONS_KNOWNHOSTS, known_hosts_file);
21fd01
     rc = ssh_options_set(session, SSH_OPTIONS_HOSTKEYS, "rsa-sha2-256");
21fd01
-- 
21fd01
2.26.2
21fd01