tests: Added test server

The server can be configured through command line options or by
providing a state structure with the desired values set.

Currently supports only password based authentication.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
Anderson Toshiyuki Sasaki
2018-11-07 17:11:04 +01:00
committed by Andreas Schneider
parent e91e221d02
commit 37262b98ef
9 changed files with 2440 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
project(test_server C)
if (WITH_SERVER AND UNIX AND NOT WIN32)
find_package(socket_wrapper)
set(server_SRCS
main.c
)
add_library(testserver STATIC
test_server.c
default_cb.c)
set(LIBSSH_SERVER_TESTS
# torture_server_kbdint
)
include_directories(
${LIBSSH_PUBLIC_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
)
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
endif ()
if (UNIX AND NOT WIN32)
add_executable(test_server ${server_SRCS})
target_compile_options(test_server PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
target_link_libraries(test_server
${LIBSSH_SHARED_LIBRARY}
${ARGP_LIBRARY}
util
testserver)
endif ()
endif (WITH_SERVER AND UNIX AND NOT WIN32)