* [LTP] [PATCH 1/2] network/netstress: fix -D option description
@ 2019-11-12 15:11 Alexey Kodanev
2019-11-12 15:11 ` [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing Alexey Kodanev
2019-11-13 1:01 ` [LTP] [PATCH 1/2] network/netstress: fix -D option description Petr Vorel
0 siblings, 2 replies; 5+ messages in thread
From: Alexey Kodanev @ 2019-11-12 15:11 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/netstress/netstress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index 413f20a9d..a5cc9a532 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -999,7 +999,7 @@ static struct tst_option options[] = {
{"T:", &type, "-T x tcp (default), udp, udp_lite, dccp, sctp"},
{"z", &zcopy, "-z enable SO_ZEROCOPY"},
{"P:", &reuse_port, "-P enable SO_REUSEPORT"},
- {"D:", &dev, "-d x bind to device x\n"},
+ {"D:", &dev, "-D x bind to device x\n"},
{"H:", &server_addr, "Client:\n-H x Server name or IP address"},
{"l", &client_mode, "-l Become client, default is server"},
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing
2019-11-12 15:11 [LTP] [PATCH 1/2] network/netstress: fix -D option description Alexey Kodanev
@ 2019-11-12 15:11 ` Alexey Kodanev
2019-11-13 1:02 ` Petr Vorel
2019-11-13 1:01 ` [LTP] [PATCH 1/2] network/netstress: fix -D option description Petr Vorel
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Kodanev @ 2019-11-12 15:11 UTC (permalink / raw)
To: ltp
It fixes misleading warnings about multiple options being set:
$ netstress -H 127.0.0.1
tst_test.c:500: WARN: Option -H passed multiple times
tst_test.c:1217: INFO: Timeout per run is 0h 05m 00s
...
But for the result path 'rpath', don't create a file if the option
is not set.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/netstress/netstress.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index a5cc9a532..76d2fdb04 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -70,7 +70,7 @@ static int server_max_requests = 3;
static int client_max_requests = 10;
static int clients_num;
static char *tcp_port;
-static char *server_addr = "localhost";
+static char *server_addr;
static char *source_addr;
static char *server_bg;
static int busy_poll = -1;
@@ -101,7 +101,7 @@ static int sfd;
static int wait_timeout = 60000;
/* in the end test will save time result in this file */
-static char *rpath = "tfo_result";
+static char *rpath;
static char *port_path = "netstress_port";
static char *log_path = "netstress.log";
@@ -517,7 +517,8 @@ static void client_run(void)
SAFE_CLOSE(cfd);
}
/* the script tcp_fastopen_run.sh will remove it */
- SAFE_FILE_PRINTF(rpath, "%ld", clnt_time);
+ if (rpath)
+ SAFE_FILE_PRINTF(rpath, "%ld", clnt_time);
tst_res(TPASS, "test completed");
}
@@ -867,6 +868,9 @@ static void setup(void)
if (tst_parse_int(Aarg, &max_rand_msg_len, 10, max_msg_len))
tst_brk(TBROK, "Invalid max random payload size '%s'", Aarg);
+ if (!server_addr)
+ server_addr = "localhost";
+
if (max_rand_msg_len) {
max_rand_msg_len -= min_msg_len;
unsigned int seed = max_rand_msg_len ^ client_max_requests;
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing
2019-11-12 15:11 ` [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing Alexey Kodanev
@ 2019-11-13 1:02 ` Petr Vorel
2019-11-13 10:55 ` Alexey Kodanev
0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-11-13 1:02 UTC (permalink / raw)
To: ltp
Hi Alexey,
> It fixes misleading warnings about multiple options being set:
> $ netstress -H 127.0.0.1
> tst_test.c:500: WARN: Option -H passed multiple times
> tst_test.c:1217: INFO: Timeout per run is 0h 05m 00s
> ...
> But for the result path 'rpath', don't create a file if the option
> is not set.
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
Good catch :).
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing
2019-11-13 1:02 ` Petr Vorel
@ 2019-11-13 10:55 ` Alexey Kodanev
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Kodanev @ 2019-11-13 10:55 UTC (permalink / raw)
To: ltp
On 13.11.2019 04:02, Petr Vorel wrote:
> Hi Alexey,
>
>> It fixes misleading warnings about multiple options being set:
>
>> $ netstress -H 127.0.0.1
>> tst_test.c:500: WARN: Option -H passed multiple times
>> tst_test.c:1217: INFO: Timeout per run is 0h 05m 00s
>> ...
>
>> But for the result path 'rpath', don't create a file if the option
>> is not set.
>
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Tested-by: Petr Vorel <pvorel@suse.cz>
>
> Good catch :).
>
Thanks for review Petr, both patches applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 1/2] network/netstress: fix -D option description
2019-11-12 15:11 [LTP] [PATCH 1/2] network/netstress: fix -D option description Alexey Kodanev
2019-11-12 15:11 ` [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing Alexey Kodanev
@ 2019-11-13 1:01 ` Petr Vorel
1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2019-11-13 1:01 UTC (permalink / raw)
To: ltp
Hi Alexey,
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-13 10:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-12 15:11 [LTP] [PATCH 1/2] network/netstress: fix -D option description Alexey Kodanev
2019-11-12 15:11 ` [LTP] [PATCH 2/2] network/netstress: set default options value after arg parsing Alexey Kodanev
2019-11-13 1:02 ` Petr Vorel
2019-11-13 10:55 ` Alexey Kodanev
2019-11-13 1:01 ` [LTP] [PATCH 1/2] network/netstress: fix -D option description Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox