diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index c5c4dfb85484a99f210bf1222d1e70f9cc5646db..610cbba5c17db01f726814f25af5efeafe352cd9 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 ff1a47eb2ce62baac47f2ba78fef1815c383345f..dd9f49dd12df81a2a83b79a46021a560da75c552 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -55,7 +55,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 153ad346db756e80c7e3253178241999dc205fc5..42fa1f1b9f4c432067d7004da4c74d6aff274972 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); } diff --git a/tests/nettest/fqdn.sh b/tests/nettest/fqdn.sh new file mode 100755 index 0000000000000000000000000000000000000000..f4ee5d56bce9842537ea9cea224c22dee28e2a7e --- /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 0000000000000000000000000000000000000000..f0f924584b3948f2a3fc2bbd184c6dd083855013 --- /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 1073741824 1073741825 + 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