From 977529e4ac7b5a5e99cc6d080347f84eb5291720 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 3 Apr 2013 11:36:53 -0500 Subject: [PATCH] tests: Make test-netflow, test-sflow accept all logging options. An upcoming patch will start using the --log-file option with these test programs, so they need to support it. Signed-off-by: Ben Pfaff --- tests/test-netflow.c | 12 +++++------- tests/test-sflow.c | 13 ++++++------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/test-netflow.c b/tests/test-netflow.c index 5147a20cd..6e5b0be62 100644 --- a/tests/test-netflow.c +++ b/tests/test-netflow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -234,12 +234,13 @@ static void parse_options(int argc, char *argv[]) { enum { - DAEMON_OPTION_ENUMS + DAEMON_OPTION_ENUMS, + VLOG_OPTION_ENUMS }; static struct option long_options[] = { - {"verbose", optional_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, DAEMON_LONG_OPTIONS, + VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -254,11 +255,8 @@ parse_options(int argc, char *argv[]) case 'h': usage(); - case 'v': - vlog_set_verbosity(optarg); - break; - DAEMON_OPTION_HANDLERS + VLOG_OPTION_HANDLERS case '?': exit(EXIT_FAILURE); diff --git a/tests/test-sflow.c b/tests/test-sflow.c index 3eb93c5b0..838fa62a6 100644 --- a/tests/test-sflow.c +++ b/tests/test-sflow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013 Nicira, Inc. * Copyright (c) 2013 InMon Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -556,12 +556,14 @@ static void parse_options(int argc, char *argv[]) { enum { - DAEMON_OPTION_ENUMS + DAEMON_OPTION_ENUMS, + VLOG_OPTION_ENUMS }; static struct option long_options[] = { {"verbose", optional_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, DAEMON_LONG_OPTIONS, + VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -576,11 +578,8 @@ parse_options(int argc, char *argv[]) case 'h': usage(); - case 'v': - vlog_set_verbosity(optarg); - break; - - DAEMON_OPTION_HANDLERS + DAEMON_OPTION_HANDLERS + VLOG_OPTION_HANDLERS case '?': exit(EXIT_FAILURE); -- 2.20.1