Files
libssh/tests/server/CMakeLists.txt
Gauravsingh Sisodia c1aab9903f feat: add null hostkey for server
fix: skip gssapi tests in fips mode

fix: skip gssapi_key_exchange_null test on ubuntu and tumbleweed

fix: return early when rc != 0 to show error

tests: replace int asserts by ssh return code asserts

fix: add fatal error when hostkeys are not found and gssapi kex is not enabled

ci: add comment linking gssapi null kex bug in ubuntu and tumbleweed

fix: don't specify hostkeys in config instead of deleting files

tests: assert kex method was null

refactor: remove redundant include

refactor: better error message

fix: check null before accessing in gssapi.c

fix: allow setting no hostkeys
Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2026-01-05 12:24:13 +01:00

62 lines
1.7 KiB
CMake

project(servertests C)
if (WITH_SERVER AND UNIX AND NOT WIN32)
find_package(socket_wrapper)
add_subdirectory(test_server)
set(LIBSSH_SERVER_TESTS
torture_server_default
torture_server_auth_kbdint
torture_server_config
torture_server_algorithms
torture_sftpserver
)
if (WITH_GSSAPI AND GSSAPI_FOUND AND GSSAPI_TESTING)
set(LIBSSH_SERVER_TESTS
${LIBSSH_SERVER_TESTS}
torture_gssapi_server_auth
torture_gssapi_server_auth_cb
torture_gssapi_server_delegation
torture_gssapi_server_key_exchange
torture_gssapi_server_key_exchange_null)
endif()
include_directories(${libssh_SOURCE_DIR}/include
${libssh_BINARY_DIR}/include
${libssh_BINARY_DIR}
test_server)
set(TORTURE_SERVER_ENVIRONMENT ${TORTURE_ENVIRONMENT})
list(APPEND TORTURE_SERVER_ENVIRONMENT NSS_WRAPPER_HOSTS=${CMAKE_BINARY_DIR}/tests/etc/hosts)
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
endif ()
foreach(_SRV_TEST ${LIBSSH_SERVER_TESTS})
add_cmocka_test(${_SRV_TEST}
SOURCES ${_SRV_TEST}.c
COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS}
LINK_LIBRARIES ${TORTURE_LIBRARY} testserver util
)
if (OSX)
set_property(
TEST
${_SRV_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${SOCKET_WRAPPER_LIBRARY})
else ()
set_property(
TEST
${_SRV_TEST}
PROPERTY
ENVIRONMENT ${TORTURE_SERVER_ENVIRONMENT})
endif()
endforeach()
endif (WITH_SERVER AND UNIX AND NOT WIN32)