From 88eab6e357de8be65f94e71c2704cad6b38e8d6c Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 16 Aug 2021 15:38:31 +0800 Subject: [PATCH] [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); } -- GitLab