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

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