From 88eab6e357de8be65f94e71c2704cad6b38e8d6c Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 16 Aug 2021 15:38:31 +0800 Subject: [PATCH 1/3] [TD-5838] add description and split speed test and fqdn test --- src/kit/shell/src/shellLinux.c | 2 +- src/kit/shell/src/shellWindows.c | 2 +- src/util/src/tnettest.c | 15 +++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index fcba3a4426..50c68ac343 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -48,7 +48,7 @@ static struct argp_option options[] = { {"check", 'k', "CHECK", 0, "Check tables."}, {"database", 'd', "DATABASE", 0, "Database to use when connecting to the server."}, {"timezone", 't', "TIMEZONE", 0, "Time zone of the shell, default is local."}, - {"netrole", 'n', "NETROLE", 0, "Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync."}, + {"netrole", 'n', "NETROLE", 0, "Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync|speen|fqdn."}, {"pktlen", 'l', "PKTLEN", 0, "Packet length used for net test, default is 1000 bytes."}, {"pktnum", 'N', "PKTNUM", 0, "Packet numbers used for net test, default is 100."}, {"pkttype", 'S', "PKTTYPE", 0, "Packet type used for net test, default is TCP."}, diff --git a/src/kit/shell/src/shellWindows.c b/src/kit/shell/src/shellWindows.c index ce161d89b7..271f440fe9 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -52,7 +52,7 @@ void printHelp() { printf("%s%s\n", indent, "-t"); printf("%s%s%s\n", indent, indent, "Time zone of the shell, default is local."); printf("%s%s\n", indent, "-n"); - printf("%s%s%s\n", indent, indent, "Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync."); + printf("%s%s%s\n", indent, indent, "Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync|speed|fqdn."); printf("%s%s\n", indent, "-l"); printf("%s%s%s\n", indent, indent, "Packet length used for net test, default is 1000 bytes."); printf("%s%s\n", indent, "-N"); diff --git a/src/util/src/tnettest.c b/src/util/src/tnettest.c index 153ad346db..42fa1f1b9f 100644 --- a/src/util/src/tnettest.c +++ b/src/util/src/tnettest.c @@ -639,17 +639,6 @@ static void taosNetCheckSpeed(char *host, int32_t port, int32_t pkgLen, return; } -static void taosNetTestSpeed(char *host, int32_t port, int32_t pkgLen, - int32_t pkgNum, char *pkgType) { - if (0 == strcmp("fqdn", pkgType)){ - taosNetTestFqdn(host); - return; - } - - taosNetCheckSpeed(host, port, pkgLen, pkgNum, pkgType); - return; -} - void taosNetTest(char *role, char *host, int32_t port, int32_t pkgLen, int32_t pkgNum, char *pkgType) { tscEmbedded = 1; @@ -679,7 +668,9 @@ void taosNetTest(char *role, char *host, int32_t port, int32_t pkgLen, } else if (0 == strcmp("speed", role)) { tscEmbedded = 0; char type[10] = {0}; - taosNetTestSpeed(host, port, pkgLen, pkgNum, strtolower(type, pkgType)); + taosNetCheckSpeed(host, port, pkgLen, pkgNum, strtolower(type, pkgType)); + }else if (0 == strcmp("fqdn", role)) { + taosNetTestFqdn(host); }else { taosNetTestStartup(host, port); } From cd233bf9e88b9a1ede88a33b8ddb0b41f8e4734a Mon Sep 17 00:00:00 2001 From: bryanchang0603 Date: Mon, 16 Aug 2021 16:19:33 +0800 Subject: [PATCH 2/3] [TD-5838] for testing nettools --- tests/nettest/fqdn.sh | 3 +++ tests/nettest/tcpudp.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 tests/nettest/fqdn.sh create mode 100755 tests/nettest/tcpudp.sh diff --git a/tests/nettest/fqdn.sh b/tests/nettest/fqdn.sh new file mode 100755 index 0000000000..f4ee5d56bc --- /dev/null +++ b/tests/nettest/fqdn.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +taos -n fqdn diff --git a/tests/nettest/tcpudp.sh b/tests/nettest/tcpudp.sh new file mode 100755 index 0000000000..b7c3c00301 --- /dev/null +++ b/tests/nettest/tcpudp.sh @@ -0,0 +1,13 @@ +#!/bin/bash + + +for N in -1 0 1 10000 10001 +do + for l in 1023 1024 + do + for S in udp tcp + do + taos -n speed -h BCC-2 -P 6030 -N $N -l $l -S $S 2>&1 | tee -a result.txt + done + done +done From bf20f82a52acda8052dbc9f89a06eb15bf2ec414 Mon Sep 17 00:00:00 2001 From: jiacy-jcy Date: Mon, 16 Aug 2021 16:29:44 +0800 Subject: [PATCH 3/3] [TD-5838]:the case of nettest tool --- tests/nettest/tcpudp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nettest/tcpudp.sh b/tests/nettest/tcpudp.sh index b7c3c00301..f0f924584b 100755 --- a/tests/nettest/tcpudp.sh +++ b/tests/nettest/tcpudp.sh @@ -3,7 +3,7 @@ for N in -1 0 1 10000 10001 do - for l in 1023 1024 + for l in 1023 1024 1073741824 1073741825 do for S in udp tcp do