From 29ad26db2646389cd896f12bfd54773b626bbd5c Mon Sep 17 00:00:00 2001 From: Jon Simons Date: Sat, 12 Nov 2022 17:18:00 -0500 Subject: [PATCH] tests/pkd: use -L in CMakeLists.txt Use the new `-L` flag for the pkd tests so that they use a unique temporary directory for scratch space while running. Note the choice of `pkd_scratch_XXXXXX` in contrast to a path living under `/tmp`: by using a relative path, one can gather the full set of log artifacts from the GitLab CI jobs in the event that there is a test failure. The logs contain lots of information to help pinpoint what went wrong. Resolves https://gitlab.com/libssh/libssh-mirror/-/issues/143. Testing notes: - In the GitLab CI jobs I can see the flag being used, and can observe that I am able to gather the full set of detailed `pkd` logs in the event of a legitimate test failure. Signed-off-by: Jon Simons Reviewed-by: Jakub Jelen (cherry picked from commit 4f6aa53b16f9b5ad220006fc966e7829f360f97e) --- tests/pkd/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pkd/CMakeLists.txt b/tests/pkd/CMakeLists.txt index 0a13da85..3dc72c75 100644 --- a/tests/pkd/CMakeLists.txt +++ b/tests/pkd/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(pkd_hello ${pkd_libs}) # specified with `-i` and may be helpful for chasing down bugs that # are not 100% reproducible. # -add_test(pkd_hello_i1 ${CMAKE_CURRENT_BINARY_DIR}/pkd_hello -e -o -i1 -w /tmp/pkd_socket_wrapper_XXXXXX) +add_test(pkd_hello_i1 ${CMAKE_CURRENT_BINARY_DIR}/pkd_hello -e -o -i1 -w /tmp/pkd_socket_wrapper_XXXXXX -L pkd_scratch_XXXXXX) # # Configure environment for cwrap socket wrapper. # @@ -49,7 +49,7 @@ set_property(TEST pkd_hello_i1 PROPERTY ENVIRONMENT ${PKD_ENVIRONMENT}) # # pkd_hello_rekey is used to test server-side implementation of rekeying. # -add_test(pkd_hello_rekey ${CMAKE_CURRENT_BINARY_DIR}/pkd_hello -t torture_pkd_openssh_rsa_rsa_default -i1 --rekey=16 -v -v -v -w /tmp/pkd_socket_wrapper_XXXXXX) +add_test(pkd_hello_rekey ${CMAKE_CURRENT_BINARY_DIR}/pkd_hello -t torture_pkd_openssh_rsa_rsa_default -i1 --rekey=16 -v -v -v -w /tmp/pkd_socket_wrapper_XXXXXX -L pkd_scratch_XXXXXX) set_property(TEST pkd_hello_rekey PROPERTY ENVIRONMENT OPENSSL_ENABLE_SHA1_SIGNATURES=1) endif (WITH_SERVER AND UNIX AND NOT WIN32)