![Jon Simons](/assets/img/avatar_default.png)
Use the socket_wrapper preload shim when running the `pkd_hello` test with `make test`. The end goal here is to get this test running alongside normal tests in regular CI. Changes to do this: * Configure PKD_ENVIRONMENT for the `pkd_hello_i1` test in the CMakeLists.txt file. * Add a `--socket-wrapper-dir|-w` flag that is used to opt-in to initializing a SOCKET_WRAPPER_DIR as expected by the socket_wrapper library. A runtime flag is used here to make it easy to run `pkd_hello` with the socket_wrapper library while avoiding a hard dependency. Testing done: observed socker_wrapper in effect with `strace`; running `make test` uses the wrapper correctly on my local machine. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
50 строки
849 B
C
50 строки
849 B
C
/*
|
|
* pkd_daemon.h -- tests use this interface to start, stop pkd
|
|
* instances and get results
|
|
*
|
|
* (c) 2014 Jon Simons
|
|
*/
|
|
|
|
#ifndef __PKD_DAEMON_H__
|
|
#define __PKD_DAEMON_H__
|
|
|
|
#include "config.h"
|
|
|
|
enum pkd_hostkey_type_e {
|
|
PKD_RSA,
|
|
#ifdef HAVE_DSA
|
|
PKD_DSA,
|
|
#endif
|
|
PKD_ECDSA
|
|
};
|
|
|
|
struct pkd_daemon_args {
|
|
enum pkd_hostkey_type_e type;
|
|
const char *hostkeypath;
|
|
|
|
struct {
|
|
int list;
|
|
|
|
int log_stdout;
|
|
int log_stderr;
|
|
int libssh_log_level;
|
|
|
|
const char *testname;
|
|
const char *testmatch;
|
|
unsigned int iterations;
|
|
|
|
struct {
|
|
const char *mkdtemp_str;
|
|
} socket_wrapper;
|
|
} opts;
|
|
};
|
|
|
|
struct pkd_result {
|
|
int ok;
|
|
};
|
|
|
|
int pkd_start(struct pkd_daemon_args *args);
|
|
void pkd_stop(struct pkd_result *out);
|
|
|
|
#endif /* __PKD_DAEMON_H__ */
|