diff --git a/tests/margo-test-server.c b/tests/margo-test-server.c index 05d8ce3..222a41b 100644 --- a/tests/margo-test-server.c +++ b/tests/margo-test-server.c @@ -131,10 +131,11 @@ int main(int argc, char** argv) static void usage(int argc, char** argv) { (void)argc; - fprintf(stderr, "Usage: %s listen_address [-s] [-f filename]\n", argv[0]); + fprintf(stderr, "Usage: %s -a listen_address [-s] [-f filename]\n", argv[0]); fprintf( stderr, " listen_address is the address or protocol for the server to use\n"); + fprintf(stderr, " [-a address] address to pass to margo_init\n"); fprintf(stderr, " [-s] for single pool mode\n"); fprintf(stderr, " [-f filename] to write the server address to a file\n"); fprintf(stderr, " [-p pool kind] to specify kind of ABT pools to use\n"); @@ -147,8 +148,11 @@ static void parse_args(int argc, char** argv, struct options* opts) memset(opts, 0, sizeof(*opts)); - while ((opt = getopt(argc, argv, "f:sp:")) != -1) { + while ((opt = getopt(argc, argv, "a:f:sp:")) != -1) { switch (opt) { + case 'a': + opts->listen_addr = strdup(optarg); + break; case 's': opts->single_pool_mode = 1; break; @@ -164,14 +168,12 @@ static void parse_args(int argc, char** argv, struct options* opts) } } - if (optind >= argc) { + if (optind > argc) { usage(argc, argv); exit(EXIT_FAILURE); } if (!opts->pool_kind) opts->pool_kind = strdup("fifo_wait"); - opts->listen_addr = strdup(argv[optind]); - return; } diff --git a/tests/test-util-ded-pool.sh b/tests/test-util-ded-pool.sh index 1baed3a..0c94e60 100644 --- a/tests/test-util-ded-pool.sh +++ b/tests/test-util-ded-pool.sh @@ -26,7 +26,7 @@ function test_start_servers () for i in `seq 1 $nservers` do hostfile=`mktemp` - $TIMEOUT --signal=9 ${maxtime} tests/margo-test-server na+sm:// -f $hostfile -p $poolkind & + $TIMEOUT --signal=9 ${maxtime} tests/margo-test-server -a na+sm:// -f $hostfile -p $poolkind & if [ $? -ne 0 ]; then # TODO: this doesn't actually work; can't check return code of # something executing in background. We have to rely on the diff --git a/tests/test-util.sh b/tests/test-util.sh index 738ea18..6af3b41 100644 --- a/tests/test-util.sh +++ b/tests/test-util.sh @@ -26,7 +26,7 @@ function test_start_servers () for i in `seq 1 $nservers` do hostfile=`mktemp` - $TIMEOUT --signal=9 ${maxtime} tests/margo-test-server na+sm:// -s -f $hostfile -p $poolkind & + $TIMEOUT --signal=9 ${maxtime} tests/margo-test-server -a na+sm:// -s -f $hostfile -p $poolkind & if [ $? -ne 0 ]; then # TODO: this doesn't actually work; can't check return code of # something executing in background. We have to rely on the diff --git a/tests/timeout.sh b/tests/timeout.sh index 10366d5..def6fcf 100755 --- a/tests/timeout.sh +++ b/tests/timeout.sh @@ -12,7 +12,7 @@ fi source $srcdir/tests/test-util.sh -TMPOUT=$($MKTEMP --tmpdir test-XXXXXX) +TMPOUT=$($MKTEMP test-XXXXXX) # start 1 server with 2 second wait, 8s timeout test_start_servers 1 2 10