From 99fcb71903cca8458bcd6c0d5b676619a9710dab Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Wed, 15 Mar 2023 16:51:58 +0800
Subject: [PATCH] tests/CMakeLists.txt: do not search ssh/sshd commands on host

It will search ssh/sshd commands on host when configure. Since they are
not required by unittests, we can skip the search.

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 tests/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 89b95d08..e481534c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -96,6 +96,7 @@ set(TEST_TARGET_LIBRARIES
 
 add_subdirectory(unittests)
 
+if (CLIENT_TESTING OR SERVER_TESTING)
 # OpenSSH Capabilities are required for all unit tests
 find_program(SSH_EXECUTABLE NAMES ssh)
 if (SSH_EXECUTABLE)
@@ -345,6 +346,7 @@ endif (WITH_PKCS11_URI)
 file(COPY gss/kdcsetup.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/gss FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
 
 message(STATUS "TORTURE_ENVIRONMENT=${TORTURE_ENVIRONMENT}")
+endif ()
 
 configure_file(tests_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/tests_config.h)
 
-- 
2.25.1

