From 1089948346640061e3a723737cfdd8515d4986d5 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 20 Oct 2019 00:52:47 +0200 Subject: [PATCH] tests: use detected sshd path The static sshd directory wasn't matching the detected sshd and prevented the testcases to be run against local OpenSSH builts Signed-off-by: Aris Adamantiadis Reviewed-by: Andreas Schneider --- tests/CMakeLists.txt | 16 ++++++++-------- tests/tests_config.h.cmake | 1 + tests/torture.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 20e42f1a..68b045bd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -104,23 +104,23 @@ if (SSH_EXECUTABLE) endif() +find_program(SSHD_EXECUTABLE + NAME + sshd + PATHS + /sbin + /usr/sbin + /usr/local/sbin) + if (CLIENT_TESTING OR SERVER_TESTING) find_package(socket_wrapper 1.1.5 REQUIRED) find_package(nss_wrapper 1.1.2 REQUIRED) find_package(uid_wrapper 1.2.0 REQUIRED) find_package(pam_wrapper 1.0.1 REQUIRED) - find_program(SSHD_EXECUTABLE - NAME - sshd - PATHS - /sbin - /usr/sbin - /usr/local/sbin) if (NOT SSHD_EXECUTABLE) message(SEND_ERROR "Could not find sshd which is required for client testing") endif() - find_program(NC_EXECUTABLE NAME nc diff --git a/tests/tests_config.h.cmake b/tests/tests_config.h.cmake index ffaff946..c2c548be 100644 --- a/tests/tests_config.h.cmake +++ b/tests/tests_config.h.cmake @@ -65,3 +65,4 @@ /* Available programs */ #cmakedefine NC_EXECUTABLE "${NC_EXECUTABLE}" +#cmakedefine SSHD_EXECUTABLE "${SSHD_EXECUTABLE}" \ No newline at end of file diff --git a/tests/torture.c b/tests/torture.c index 943486c2..4783d9cf 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -841,7 +841,7 @@ void torture_setup_sshd_server(void **state, bool pam) s = *state; snprintf(sshd_start_cmd, sizeof(sshd_start_cmd), - "/usr/sbin/sshd -r -f %s -E %s/sshd/daemon.log 2> %s/sshd/cwrap.log", + SSHD_EXECUTABLE " -r -f %s -E %s/sshd/daemon.log 2> %s/sshd/cwrap.log", s->srv_config, s->socket_dir, s->socket_dir); rc = system(sshd_start_cmd);