tests/external_override: Add override test for internal implementations

This adds a test to check if the internal implementation is not used
when it is not supposed to be used.

To be able to override functions using LD_PRELOAD, a shared version of
the torture library was added, as well as a shared library for each
of the algorithms implemented internally (ChaCha20, Poly1305,
curve25519, and ed25519).

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Anderson Toshiyuki Sasaki
2020-12-15 13:35:06 +01:00
parent d4258d1461
commit 8e56585c72
13 changed files with 931 additions and 0 deletions

View File

@@ -144,7 +144,11 @@ void torture_setup_libssh_server(void **state, const char *server_path);
/*
* This function must be defined in every unit test file.
*/
#if ((defined _WIN32) || (defined _WIN64)) && (defined USE_ATTRIBUTE_WEAK)
__attribute__((weak)) int torture_run_tests(void);
#else
int torture_run_tests(void);
#endif
char *torture_make_temp_dir(const char *template);
char *torture_create_temp_file(const char *template);