aboutsummaryrefslogtreecommitdiff
path: root/tests/pkd
diff options
context:
space:
mode:
authorJon Simons <jon@jonsimons.org>2019-04-24 09:26:54 -0700
committerAndreas Schneider <asn@cryptomilk.org>2019-04-29 14:00:34 +0200
commit03a1f1dd0c7dfaef3633af30a36e373c833e56d4 (patch)
treeca1a75d0f710853b770117de42800a1a4914153d /tests/pkd
parent410f10096828e84b26c79155b43244702293d52b (diff)
downloadlibssh-03a1f1dd0c7dfaef3633af30a36e373c833e56d4.tar.gz
libssh-03a1f1dd0c7dfaef3633af30a36e373c833e56d4.tar.xz
libssh-03a1f1dd0c7dfaef3633af30a36e373c833e56d4.zip
tests/pkd: support optional --buffer for test payload
Support an optional --buffer input for the pkd tests to enable testing with a larger payload than the default "hello\n". Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/pkd')
-rw-r--r--tests/pkd/pkd_hello.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pkd/pkd_hello.c b/tests/pkd/pkd_hello.c
index e7d36392..f5588bd6 100644
--- a/tests/pkd/pkd_hello.c
+++ b/tests/pkd/pkd_hello.c
@@ -50,6 +50,8 @@ static char doc[] = \
;
static struct argp_option options[] = {
+ { "buffer", 'b', "string", 0,
+ "Use the given string for test buffer payload contents", 0 },
{ "stderr", 'e', NULL, 0,
"Emit pkd stderr messages", 0 },
{ "list", 'l', NULL, 0,
@@ -75,6 +77,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
(void) state;
switch(key) {
+ case 'b':
+ pkd_dargs.payload.buf = (uint8_t *) arg;
+ pkd_dargs.payload.len = strlen(arg);
+ break;
case 'e':
pkd_dargs.opts.log_stderr = 1;
break;