diff options
author | Theo Buehler <tb@openbsd.org> | 2025-02-03 21:59:49 +0100 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2025-02-03 22:03:13 +0100 |
commit | 5bbae88080d65f9e81ef31c28e356f202d3cb03a (patch) | |
tree | cf1f907def158f637926f95cfe22572c2e139d41 /tests | |
parent | 7e58cd8d51dbc517d562d11f256a8102fb04e748 (diff) | |
download | portable-5bbae88080d65f9e81ef31c28e356f202d3cb03a.tar.gz portable-5bbae88080d65f9e81ef31c28e356f202d3cb03a.tar.bz2 portable-5bbae88080d65f9e81ef31c28e356f202d3cb03a.zip |
Link renegotiation test to build
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 12 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/renegotiation_test.bat | 14 | ||||
-rwxr-xr-x | tests/renegotiation_test.sh | 15 |
4 files changed, 47 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f4fd85d..fde5406 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -662,6 +662,18 @@ add_executable(record_layer_test record_layer_test.c) | |||
662 | target_link_libraries(record_layer_test ${OPENSSL_TEST_LIBS}) | 662 | target_link_libraries(record_layer_test ${OPENSSL_TEST_LIBS}) |
663 | add_platform_test(record_layer_test record_layer_test) | 663 | add_platform_test(record_layer_test record_layer_test) |
664 | 664 | ||
665 | # renegotiation_test | ||
666 | set(RENEGOTIATION_TEST_SRC renegotiation_test.c) | ||
667 | add_executable(renegotiation_test ${RENEGOTIATION_TEST_SRC}) | ||
668 | target_link_libraries(renegotiation_test ${OPENSSL_TEST_LIBS}) | ||
669 | prepare_emscripten_test_target(renegotiation_test) | ||
670 | if(NOT MSVC) | ||
671 | add_test(NAME renegotiation_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/renegotiation_test.sh) | ||
672 | else() | ||
673 | add_test(NAME renegotiation_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/renegotiation_test.bat $<TARGET_FILE:renegotiation_test>) | ||
674 | endif() | ||
675 | set_tests_properties(renegotiation_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | ||
676 | |||
665 | # rfc3779 | 677 | # rfc3779 |
666 | add_executable(rfc3779 rfc3779.c) | 678 | add_executable(rfc3779 rfc3779.c) |
667 | target_link_libraries(rfc3779 ${OPENSSL_TEST_LIBS}) | 679 | target_link_libraries(rfc3779 ${OPENSSL_TEST_LIBS}) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index eeac7e1..f3414f6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -688,6 +688,12 @@ TESTS += record_layer_test | |||
688 | check_PROGRAMS += record_layer_test | 688 | check_PROGRAMS += record_layer_test |
689 | record_layer_test_SOURCES = record_layer_test.c | 689 | record_layer_test_SOURCES = record_layer_test.c |
690 | 690 | ||
691 | # renegotiation_test | ||
692 | TESTS += renegotiation_test.sh | ||
693 | check_PROGRAMS += renegotiation_test | ||
694 | renegotiation_test_SOURCES = renegotiation_test.c | ||
695 | EXTRA_DIST += renegotiation_test.sh renegotiation_test.bat | ||
696 | |||
691 | # rfc3779 | 697 | # rfc3779 |
692 | TESTS += rfc3779 | 698 | TESTS += rfc3779 |
693 | rfc3779_CPPFLAGS = $(AM_CPPFLAGS) | 699 | rfc3779_CPPFLAGS = $(AM_CPPFLAGS) |
diff --git a/tests/renegotiation_test.bat b/tests/renegotiation_test.bat new file mode 100644 index 0000000..0086046 --- /dev/null +++ b/tests/renegotiation_test.bat | |||
@@ -0,0 +1,14 @@ | |||
1 | @echo off | ||
2 | setlocal enabledelayedexpansion | ||
3 | REM renegotiation_test.bat | ||
4 | |||
5 | set renegotiation_test_bin=%1 | ||
6 | set renegotiation_test_bin=%renegotiation_test_bin:/=\% | ||
7 | if not exist %renegotiation_test_bin% exit /b 1 | ||
8 | |||
9 | %renegotiation_test_bin% %srcdir%\server1-rsa.pem %srcdir%\server1-rsa-chain.pem %srcdir%\ca-root-rsa.pem | ||
10 | if !errorlevel! neq 0 ( | ||
11 | exit /b 1 | ||
12 | ) | ||
13 | |||
14 | endlocal | ||
diff --git a/tests/renegotiation_test.sh b/tests/renegotiation_test.sh new file mode 100755 index 0000000..bbf27c8 --- /dev/null +++ b/tests/renegotiation_test.sh | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | renegotiation_test_bin=./renegotiation_test | ||
5 | if [ -e ./renegotiation_test.exe ]; then | ||
6 | renegotiation_test_bin=./renegotiation_test.exe | ||
7 | elif [ -e ./renegotiation_test.js ]; then | ||
8 | renegotiation_test_bin="node ./renegotiation_test.js" | ||
9 | fi | ||
10 | |||
11 | if [ -z $srcdir ]; then | ||
12 | srcdir=. | ||
13 | fi | ||
14 | |||
15 | $renegotiation_test_bin $srcdir/server1-rsa.pem $srcdir/server1-rsa-chain.pem $srcdir/ca-root-rsa.pem | ||