提交 7ba8ef92 编写于 作者: wmmhello's avatar wmmhello

Merge branch 'develop' into feature/TD-6129

......@@ -583,10 +583,15 @@ pipeline {
timeout(time: 55, unit: 'MINUTES'){
pre_test()
sh '''
cd ${WKC}/tests
./test-all.sh develop-test
'''
sh '''
date
cd ${WKC}/tests
./test-all.sh b6fq
date'''
}
}
}
......@@ -596,6 +601,10 @@ pipeline {
timeout(time: 55, unit: 'MINUTES'){
pre_test()
sh '''
cd ${WKC}/tests
./test-all.sh system-test
'''
sh '''
date
cd ${WKC}/tests
./test-all.sh b7fq
......
......@@ -145,7 +145,7 @@ taos>
| **CPU类型** | x64(64bit) | | | ARM64 | ARM32 |
| ------------ | ------------ | -------- | -------- | -------- | ---------- |
| **OS类型** | Linux | Win64 | Win32 | Linux | Linux |
| **支持与否** | **支持** | **支持** | **支持** | **支持** | **开发中** |
| **支持与否** | **支持** | **支持** | **支持** | **支持** | **支持** |
C/C++的API类似于MySQL的C API。应用程序使用时,需要包含TDengine头文件 *taos.h*,里面列出了提供的API的函数原型。安装后,taos.h位于:
......
......@@ -557,7 +557,7 @@ KILL STREAM <stream-id>;
TDengine启动后,会自动创建一个监测数据库log,并自动将服务器的CPU、内存、硬盘空间、带宽、请求数、磁盘读写速度、慢查询等信息定时写入该数据库。TDengine还将重要的系统操作(比如登录、创建、删除数据库等)日志以及各种错误报警信息记录下来存放在log库里。系统管理员可以从CLI直接查看这个数据库,也可以在WEB通过图形化界面查看这些监测信息。
这些监测信息的采集缺省是打开的,但可以修改配置文件里的选项enableMonitor将其关闭或打开。
这些监测信息的采集缺省是打开的,但可以修改配置文件里的选项monitor将其关闭或打开。
### TDinsight - 使用监控数据库 + Grafana 对 TDengine 进行监控的解决方案
......
......@@ -154,7 +154,7 @@ Under cmd, enter the c:\TDengine directory and directly execute taos.exe, and yo
| **CPU Type** | **x64****(****64bit****)** | | | **ARM64** | **ARM32** |
| -------------------- | ---------------------------- | ------- | ------- | --------- | ------------------ |
| **OS Type** | Linux | Win64 | Win32 | Linux | Linux |
| **Supported or Not** | Yes | **Yes** | **Yes** | **Yes** | **In development** |
| **Supported or Not** | Yes | **Yes** | **Yes** | **Yes** | **Yes** |
The C/C++ API is similar to MySQL's C API. When application use it, it needs to include the TDengine header file taos.h (after installed, it is located in/usr/local/taos/include):
......
......@@ -58,7 +58,6 @@ cp ${compile_dir}/../packaging/tools/startPre.sh ${pkg_dir}${install_home_pat
cp ${compile_dir}/../packaging/tools/set_core.sh ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/../packaging/tools/taosd-dump-cfg.gdb ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin
if [ -f "${compile_dir}/build/bin/taosadapter" ]; then
......
......@@ -518,7 +518,7 @@ if [ "$osType" != "Darwin" ]; then
cd ${top_dir}/src/kit/taos-tools/packaging/deb
[ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0"
taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g')
taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}')
${csudo} ./make-taos-tools-deb.sh ${top_dir} \
${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType}
fi
......@@ -541,7 +541,7 @@ if [ "$osType" != "Darwin" ]; then
cd ${top_dir}/src/kit/taos-tools/packaging/rpm
[ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0"
taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g'|sed -e 's/-/_/g')
taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}'|sed -e 's/-/_/g')
${csudo} ./make-taos-tools-rpm.sh ${top_dir} \
${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType}
fi
......
......@@ -71,7 +71,6 @@ cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin
if [ -f %{_compiledir}/build/bin/taosadapter ]; then
cp %{_compiledir}/build/bin/taosadapter %{buildroot}%{homepath}/bin ||:
fi
cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver
cp %{_compiledir}/../src/inc/taos.h %{buildroot}%{homepath}/include
cp %{_compiledir}/../src/inc/taosdef.h %{buildroot}%{homepath}/include
......@@ -196,7 +195,6 @@ if [ $1 -eq 0 ];then
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${cfg_link_dir}/* || :
${csudo} rm -f ${inc_link_dir}/taos.h || :
${csudo} rm -f ${inc_link_dir}/taosdef.h || :
......
......@@ -887,8 +887,8 @@ function update_TDengine() {
fi
tar -zxf taos.tar.gz
install_jemalloc
install_avro lib
install_avro lib64
#install_avro lib
#install_avro lib64
echo -e "${GREEN}Start to update TDengine...${NC}"
# Stop the service if running
......@@ -1001,8 +1001,8 @@ function install_TDengine() {
install_header
install_lib
install_jemalloc
install_avro lib
install_avro lib64
#install_avro lib
#install_avro lib64
if [ "$pagMode" != "lite" ]; then
install_connector
......
......@@ -45,8 +45,9 @@ if [ "$osType" != "Darwin" ]; then
strip ${build_dir}/bin/taos
bin_files="${build_dir}/bin/taos ${script_dir}/remove_client.sh"
else
bin_files="${build_dir}/bin/taos ${build_dir}/bin/taosdemo \
${script_dir}/remove_client.sh ${script_dir}/set_core.sh ${script_dir}/get_client.sh ${script_dir}/taosd-dump-cfg.gdb"
bin_files="${script_dir}/remove_client.sh \
${script_dir}/set_core.sh \
${script_dir}/get_client.sh ${script_dir}/taosd-dump-cfg.gdb"
fi
lib_files="${build_dir}/lib/libtaos.so.${version}"
else
......
......@@ -31,23 +31,37 @@ else
install_dir="${release_dir}/TDengine-server-${version}"
fi
if [ -d ${top_dir}/src/kit/taos-tools/packaging/deb ]; then
cd ${top_dir}/src/kit/taos-tools/packaging/deb
[ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0"
taostools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}')
taostools_install_dir="${release_dir}/taos-tools-${taostools_ver}"
cd ${curr_dir}
else
taostools_install_dir="${release_dir}/taos-tools-${version}"
fi
# Directories and files
if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taosd
strip ${build_dir}/bin/taos
# lite version doesn't include taosadapter, which will lead to no restful interface
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh"
taostools_bin_files=""
else
bin_files="${build_dir}/bin/taosd \
${build_dir}/bin/taos \
${build_dir}/bin/taosadapter \
${build_dir}/bin/taosdump \
${build_dir}/bin/taosdemo \
${build_dir}/bin/tarbitrator\
${script_dir}/remove.sh \
${script_dir}/set_core.sh \
${script_dir}/startPre.sh \
${script_dir}/taosd-dump-cfg.gdb"
taostools_bin_files=" ${build_dir}/bin/taosdump \
${build_dir}/bin/taosBenchmark"
fi
lib_files="${build_dir}/lib/libtaos.so.${version}"
......@@ -78,6 +92,7 @@ mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg
if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then
cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || :
fi
......@@ -102,10 +117,29 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taos
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || :
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || :
if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then
mkdir -p ${install_dir}/avro/{lib,lib/pkgconfig}
cp ${build_dir}/lib/libavro.* ${install_dir}/avro/lib
cp ${build_dir}/lib/pkgconfig/avro-c.pc ${install_dir}/avro/lib/pkgconfig
if [ -n "${taostools_bin_files}" ]; then
mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}"
mkdir -p ${taostools_install_dir}/bin \
&& cp ${taostools_bin_files} ${taostools_install_dir}/bin \
&& chmod a+x ${taostools_install_dir}/bin/* || :
[ -f ${taostools_install_dir}/bin/taosBenchmark ] && \
ln -sf ${taostools_install_dir}/bin/taosBenchmark \
${taostools_install_dir}/bin/taosdemo
if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh ]; then
cp ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh \
${taostools_install_dir}/ > /dev/null \
&& chmod a+x {taostools_install_dir}/install-taostools.sh \
|| echo -e "failed to copy install-taostools.sh"
else
echo -e "install-taostools.sh not found"
fi
if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then
mkdir -p ${taostools_install_dir}/avro/{lib,lib/pkgconfig} || echo -e "failed to create ${taostools_install_dir}/avro"
cp ${build_dir}/lib/libavro.* ${taostools_install_dir}/avro/lib
cp ${build_dir}/lib/pkgconfig/avro-c.pc ${taostools_install_dir}/avro/lib/pkgconfig
fi
fi
if [ -f ${build_dir}/bin/jemalloc-config ]; then
......@@ -235,6 +269,8 @@ cd ${release_dir}
# install_dir has been distinguishes cluster from edege, so comments this code
pkg_name=${install_dir}-${osType}-${cpuType}
taostools_pkg_name=${taostools_install_dir}-${osType}-${cpuType}
# if [ "$verMode" == "cluster" ]; then
# pkg_name=${install_dir}-${osType}-${cpuType}
# elif [ "$verMode" == "edge" ]; then
......@@ -246,8 +282,10 @@ pkg_name=${install_dir}-${osType}-${cpuType}
if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then
pkg_name=${install_dir}-${verType}-${osType}-${cpuType}
taostools_pkg_name=${taostools_install_dir}-${verType}-${osType}-${cpuType}
elif [ "$verType" == "stable" ]; then
pkg_name=${pkg_name}
taostools_pkg_name=${taostools_pkg_name}
else
echo "unknow verType, nor stabel or beta"
exit 1
......@@ -264,4 +302,13 @@ if [ "$exitcode" != "0" ]; then
exit $exitcode
fi
if [ -n "${taostools_bin_files}" ]; then
tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" $(basename ${taostools_install_dir}) --remove-files || :
exitcode=$?
if [ "$exitcode" != "0" ]; then
echo "tar ${taostools_pkg_name}.tar.gz error !!!"
exit $exitcode
fi
fi
cd ${curr_dir}
......@@ -7152,17 +7152,15 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN
// todo refactor
if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
if (!tscQueryTags(pQueryInfo)) { // local handle the super table tag query
if (tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
if (pQueryInfo->slimit.limit > 0 || pQueryInfo->slimit.offset > 0) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
if (tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
if (pQueryInfo->slimit.limit > 0 || pQueryInfo->slimit.offset > 0) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
// for projection query on super table, all queries are subqueries
if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0) &&
!TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_JOIN_QUERY)) {
pQueryInfo->type |= TSDB_QUERY_TYPE_SUBQUERY;
}
// for projection query on super table, all queries are subqueries
if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0) &&
!TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_JOIN_QUERY)) {
pQueryInfo->type |= TSDB_QUERY_TYPE_SUBQUERY;
}
}
......@@ -9515,7 +9513,8 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
SExprInfo* pExpr = tscExprGet(pQueryInfo, i);
int32_t f = pExpr->base.functionId;
if (f == TSDB_FUNC_DERIVATIVE || f == TSDB_FUNC_TWA || f == TSDB_FUNC_IRATE || f == TSDB_FUNC_RATE || f== TSDB_FUNC_DIFF) {
if (f == TSDB_FUNC_DERIVATIVE || f == TSDB_FUNC_TWA || f == TSDB_FUNC_IRATE ||
f == TSDB_FUNC_RATE || f == TSDB_FUNC_DIFF) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7);
}
}
......
......@@ -448,13 +448,14 @@ typedef struct {
#define kvRowSetNCols(r, n) kvRowNCols(r) = (n)
#define kvRowColIdx(r) (SColIdx *)POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE)
#define kvRowValues(r) POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * kvRowNCols(r))
#define kvRowKeys(r) POINTER_SHIFT(r, *(uint16_t *)POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE + sizeof(int16_t)))
#define kvRowCpy(dst, r) memcpy((dst), (r), kvRowLen(r))
#define kvRowColVal(r, colIdx) POINTER_SHIFT(kvRowValues(r), (colIdx)->offset)
#define kvRowColIdxAt(r, i) (kvRowColIdx(r) + (i))
#define kvRowFree(r) tfree(r)
#define kvRowEnd(r) POINTER_SHIFT(r, kvRowLen(r))
#define kvRowValLen(r) (kvRowLen(r) - TD_KV_ROW_HEAD_SIZE - sizeof(SColIdx) * kvRowNCols(r))
#define kvRowTKey(r) (*(TKEY *)(kvRowValues(r)))
#define kvRowTKey(r) (*(TKEY *)(kvRowKeys(r)))
#define kvRowKey(r) tdGetKey(kvRowTKey(r))
#define kvRowDeleted(r) TKEY_IS_DELETED(kvRowTKey(r))
......@@ -657,7 +658,7 @@ static FORCE_INLINE char *memRowEnd(SMemRow row) {
#define memRowKvVersion(r) (*(int16_t *)POINTER_SHIFT(r, TD_MEM_ROW_TYPE_SIZE))
#define memRowVersion(r) (isDataRow(r) ? memRowDataVersion(r) : memRowKvVersion(r)) // schema version
#define memRowSetKvVersion(r, v) (memRowKvVersion(r) = (v))
#define memRowTuple(r) (isDataRow(r) ? dataRowTuple(memRowDataBody(r)) : kvRowValues(memRowKvBody(r)))
#define memRowKeys(r) (isDataRow(r) ? dataRowTuple(memRowDataBody(r)) : kvRowKeys(memRowKvBody(r)))
#define memRowTKey(r) (isDataRow(r) ? dataRowTKey(memRowDataBody(r)) : kvRowTKey(memRowKvBody(r)))
#define memRowKey(r) (isDataRow(r) ? dataRowKey(memRowDataBody(r)) : kvRowKey(memRowKvBody(r)))
......
Subproject commit b76b5a76756a5c6530ba1d418de51fd336ae23b1
Subproject commit 446c03da6df8fe6675c6aba14b1d0766b56e1f08
......@@ -564,7 +564,7 @@ static void tsdbFreeTableData(STableData *pTableData) {
}
}
static char *tsdbGetTsTupleKey(const void *data) { return memRowTuple((SMemRow)data); }
static char *tsdbGetTsTupleKey(const void *data) { return memRowKeys((SMemRow)data); }
static int tsdbAdjustMemMaxTables(SMemTable *pMemTable, int maxTables) {
ASSERT(pMemTable->maxTables < maxTables);
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
ret = tdSql.execute('create table tb (ts timestamp, speed int)')
insertRows = 10
tdLog.info("insert %d rows" % (insertRows))
for i in range(0, insertRows):
ret = tdSql.execute(
'insert into tb values (now + %dm, %d)' %
(i, i))
tdLog.info("insert earlier data")
tdSql.execute('insert into tb values (now - 5m , 10)')
tdSql.execute('insert into tb values (now - 6m , 10)')
tdSql.execute('insert into tb values (now - 7m , 10)')
tdSql.execute('insert into tb values (now - 8m , 10)')
tdSql.query("select * from tb")
tdSql.checkRows(insertRows + 4)
# test case for https://jira.taosdata.com:18080/browse/TD-3716:
tdSql.error("insert into tb(now, 1)")
# test case for TD-10717
tdSql.error("insert into tb values(now,1),,(now+1s,1)")
tdSql.execute("insert into tb values(now+2s,1),(now+3s,1),(now+4s,1)")
tdSql.query("select * from tb")
tdSql.checkRows(insertRows + 4 +3)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
python3 test.py -f 1-insert/0-sql/basic.py
\ No newline at end of file
#!/usr/bin/python
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# install pip
# pip install src/connector/python/
# -*- coding: utf-8 -*-
import sys
import getopt
import subprocess
import time
from distutils.log import warn as printf
from fabric2 import Connection
sys.path.append("../pytest")
from util.log import *
from util.dnodes import *
from util.cases import *
import taos
if __name__ == "__main__":
fileName = "all"
deployPath = ""
masterIp = ""
testCluster = False
valgrind = 0
logSql = True
stop = 0
restart = False
windows = 0
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrw', [
'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help', 'windows'])
for key, value in opts:
if key in ['-h', '--help']:
tdLog.printNoPrefix(
'A collection of test cases written using Python')
tdLog.printNoPrefix('-f Name of test case file written by Python')
tdLog.printNoPrefix('-p Deploy Path for Simulator')
tdLog.printNoPrefix('-m Master Ip for Simulator')
tdLog.printNoPrefix('-l <True:False> logSql Flag')
tdLog.printNoPrefix('-s stop All dnodes')
tdLog.printNoPrefix('-c Test Cluster Flag')
tdLog.printNoPrefix('-g valgrind Test Flag')
tdLog.printNoPrefix('-r taosd restart test')
tdLog.printNoPrefix('-w taos on windows')
sys.exit(0)
if key in ['-r', '--restart']:
restart = True
if key in ['-f', '--file']:
fileName = value
if key in ['-p', '--path']:
deployPath = value
if key in ['-m', '--master']:
masterIp = value
if key in ['-l', '--logSql']:
if (value.upper() == "TRUE"):
logSql = True
elif (value.upper() == "FALSE"):
logSql = False
else:
tdLog.printNoPrefix("logSql value %s is invalid" % logSql)
sys.exit(0)
if key in ['-c', '--cluster']:
testCluster = True
if key in ['-g', '--valgrind']:
valgrind = 1
if key in ['-s', '--stop']:
stop = 1
if key in ['-w', '--windows']:
windows = 1
if (stop != 0):
if (valgrind == 0):
toBeKilled = "taosd"
else:
toBeKilled = "valgrind.bin"
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -TERM > /dev/null 2>&1" % toBeKilled
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
processID = subprocess.check_output(psCmd, shell=True)
while(processID):
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(psCmd, shell=True)
for port in range(6030, 6041):
usePortPID = "lsof -i tcp:%d | grep LISTEn | awk '{print $2}'" % port
processID = subprocess.check_output(usePortPID, shell=True)
if processID:
killCmd = "kill -TERM %s" % processID
os.system(killCmd)
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if valgrind:
time.sleep(2)
tdLog.info('stop All dnodes')
if masterIp == "":
host = '127.0.0.1'
else:
host = masterIp
tdLog.info("Procedures for tdengine deployed in %s" % (host))
if windows:
tdCases.logSql(logSql)
tdLog.info("Procedures for testing self-deployment")
td_clinet = TDSimClient("C:\\TDengine")
td_clinet.deploy()
remote_conn = Connection("root@%s"%host)
with remote_conn.cd('/var/lib/jenkins/workspace/TDinternal/community/tests/pytest'):
remote_conn.run("python3 ./test.py")
conn = taos.connect(
host="%s"%(host),
config=td_clinet.cfgDir)
tdCases.runOneWindows(conn, fileName)
else:
tdDnodes.init(deployPath)
tdDnodes.setTestCluster(testCluster)
tdDnodes.setValgrind(valgrind)
tdDnodes.stopAll()
is_test_framework = 0
key_word = 'tdCases.addLinux'
try:
if key_word in open(fileName).read():
is_test_framework = 1
except:
pass
if is_test_framework:
moduleName = fileName.replace(".py", "").replace("/", ".")
uModule = importlib.import_module(moduleName)
try:
ucase = uModule.TDTestCase()
tdDnodes.deploy(1,ucase.updatecfgDict)
except :
tdDnodes.deploy(1,{})
else:
pass
tdDnodes.deploy(1,{})
tdDnodes.start(1)
tdCases.logSql(logSql)
if testCluster:
tdLog.info("Procedures for testing cluster")
if fileName == "all":
tdCases.runAllCluster()
else:
tdCases.runOneCluster(fileName)
else:
tdLog.info("Procedures for testing self-deployment")
conn = taos.connect(
host,
config=tdDnodes.getSimCfgPath())
if fileName == "all":
tdCases.runAllLinux(conn)
else:
tdCases.runOneWindows(conn, fileName)
if restart:
if fileName == "all":
tdLog.info("not need to query ")
else:
sp = fileName.rsplit(".", 1)
if len(sp) == 2 and sp[1] == "py":
tdDnodes.stopAll()
tdDnodes.start(1)
time.sleep(1)
conn = taos.connect( host, config=tdDnodes.getSimCfgPath())
tdLog.info("Procedures for tdengine deployed in %s" % (host))
tdLog.info("query test after taosd restart")
tdCases.runOneLinux(conn, sp[0] + "_" + "restart.py")
else:
tdLog.info("not need to query")
conn.close()
......@@ -52,7 +52,7 @@ class TDTestCase:
#write 5M rows into db, then restart to force the data move into disk.
#create 500 tables
os.system("%staosdemo -f tools/taosdemoAllTest/insert_5M_rows.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert_5M_rows.json -y " % binPath)
tdDnodes.stop(1)
tdDnodes.start(1)
tdSql.execute('use db')
......
......@@ -42,7 +42,7 @@ class TDTestCase:
#11 data files should be generated
#vnode at TDinternal/community/sim/dnode1/data/vnode
try:
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
os.system(f"{binPath}taosBenchmark -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
except BaseException:
......@@ -59,7 +59,7 @@ class TDTestCase:
#leaving 7 data files.
try:
os.system ('timedatectl set-time 2020-10-25')
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json")
os.system(f"{binPath}taosBenchmark -f tools/taosdemoAllTest/manual_change_time_1_1_B.json")
except BaseException:
os.system('sudo timedatectl set-ntp on')
tdLog.sleep(10)
......
......@@ -41,7 +41,7 @@ class TDTestCase:
#11 data files should be generated
#vnode at TDinternal/community/sim/dnode1/data/vnode
try:
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
os.system(f"{binPath}taosBenchmark -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
except BaseException:
......
......@@ -51,9 +51,9 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# insert data to cluster'db
os.system("%staosdemo -f cluster/TD-3693/insert1Data.json -y " % binPath)
os.system("%staosBenchmark -f cluster/TD-3693/insert1Data.json -y " % binPath)
# multiple new and cloes connection with query data
os.system("%staosdemo -f cluster/TD-3693/insert2Data.json -y " % binPath)
os.system("%staosBenchmark -f cluster/TD-3693/insert2Data.json -y " % binPath)
os.system("nohup %staosdemoMul -f cluster/TD-3693/queryCount.json -y & " % binPath)
......
......@@ -66,7 +66,7 @@ class TwoClients:
# create backgroud db and tb
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f compress/insertDataDb1.json -y " % binPath)
os.system("%staosBenchmark -f compress/insertDataDb1.json -y " % binPath)
# create foreground db and tb
tdSql.execute("drop database if exists foredb")
tdSql.execute("create database foredb")
......
......@@ -35,11 +35,11 @@ class taosdemoWrapper:
def run(self):
if self.metadata is None:
os.system("taosdemo -h %s -d %s -t %d -T %d -c %s -a %d -b %s -n %d -t %d -O %d -R %d -w %d -x -y"
os.system("%staosBenchmark -h %s -d %s -t %d -T %d -c %s -a %d -b %s -n %d -t %d -O %d -R %d -w %d -x -y"
% (self.host, self.database, self.tables, self.threads, self.configDir, self.replica, self.columnType,
self.rowsPerTable, self.disorderRatio, self.disorderRange, self.charTypeLen))
else:
os.system("taosdemo -f %s" % self.metadata)
os.system("%staosBenchmark -f %s" % self.metadata)
parser = argparse.ArgumentParser()
......
......@@ -29,6 +29,7 @@ python3 ./test.py -f insert/in_function.py
python3 ./test.py -f insert/modify_column.py
#python3 ./test.py -f insert/line_insert.py
python3 ./test.py -f insert/specialSql.py
python3 ./test.py -f insert/timestamp.py
# timezone
......@@ -49,7 +50,7 @@ python3 ./test.py -f table/del_stable.py
#stable
python3 ./test.py -f stable/insert.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
# tag
python3 ./test.py -f tag_lite/filter.py
......@@ -164,13 +165,13 @@ python3 ./test.py -f update/merge_commit_data.py
python3 test.py -f tools/taosdumpTest.py
python3 test.py -f tools/taosdumpTest2.py
python3 test.py -f tools/taosdemoTest.py
python3 test.py -f tools/taosdemoTestWithoutMetric.py
python3 test.py -f tools/taosdemoTestWithJson.py
python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdemoTestTblAlt.py
python3 test.py -f tools/taosdemoTestSampleData.py
python3 test.py -f tools/taosdemoTestInterlace.py
#python3 test.py -f tools/taosdemoTest.py
#python3 test.py -f tools/taosdemoTestWithoutMetric.py
#python3 test.py -f tools/taosdemoTestWithJson.py
#python3 test.py -f tools/taosdemoTestLimitOffset.py
#python3 test.py -f tools/taosdemoTestTblAlt.py
#python3 test.py -f tools/taosdemoTestSampleData.py
#python3 test.py -f tools/taosdemoTestInterlace.py
# python3 test.py -f tools/taosdemoTestQuery.py
# restful test for python
......@@ -178,10 +179,10 @@ python3 test.py -f tools/taosdemoTestInterlace.py
# python3 test.py -f restful/restful_bind_db2.py
# nano support
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py
# python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py
#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py
#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py
python3 test.py -f tools/taosdumpTestNanoSupport.py
#
......@@ -215,12 +216,12 @@ python3 ./test.py -f stable/query_after_reset.py
# perfbenchmark
python3 ./test.py -f perfbenchmark/bug3433.py
#python3 ./test.py -f perfbenchmark/bug3589.py
python3 ./test.py -f perfbenchmark/taosdemoInsert.py
#python3 ./test.py -f perfbenchmark/taosdemoInsert.py
#taosdemo
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
#query
python3 test.py -f query/distinctOneColTb.py
......@@ -393,10 +394,10 @@ python3 ./test.py -f insert/insert_locking.py
python3 ./test.py -f alter/alter_debugFlag.py
python3 ./test.py -f query/queryBetweenAnd.py
python3 ./test.py -f tag_lite/alter_tag.py
python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
python3 test.py -f tools/taosdemoAllTest/TD-10539/create_taosdemo.py
#python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py
#python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
#python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
#python3 test.py -f tools/taosdemoAllTest/TD-10539/create_taosdemo.py
python3 ./test.py -f tag_lite/drop_auto_create.py
python3 test.py -f insert/insert_before_use_db.py
python3 test.py -f alter/alter_keep.py
......@@ -419,7 +420,7 @@ python3 ./test.py -f insert/verifyMemToDiskCrash.py
python3 ./test.py -f query/queryRegex.py
python3 ./test.py -f tools/taosdemoTestdatatype.py
#python3 ./test.py -f tools/taosdemoTestdatatype.py
#python3 ./test.py -f insert/schemalessInsert.py
#python3 ./test.py -f insert/openTsdbTelnetLinesInsert.py
#python3 ./test.py -f insert/openTsdbJsonInsert.py
......
......@@ -1055,7 +1055,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
os.system("%staosBenchmark -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
tdSql.execute('''insert into table_2 values( %d , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);''' %(self.ts - 200))
sql = '''select * from table_2 where ts = %d ;''' %(self.ts - 200)
......
......@@ -1055,7 +1055,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
os.system("%staosBenchmark -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
tdSql.execute('''insert into table_2 values( %d , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);''' %(self.ts - 200))
sql = '''select * from table_2 where ts = %d ;''' %(self.ts - 200)
......
......@@ -1181,7 +1181,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
os.system("%staosBenchmark -N -d taosdemo -t 100 -n 100 -l 1000 -y" % binPath)
tdLog.info("========== stable ==========")
tdSql.execute('''insert into table_2 values( %d , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);''' %(self.ts - 200))
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.ts = 1607281690000
def run(self):
tdSql.prepare()
# TS-806
tdLog.info("test case for TS-806")
# Case 1
tdSql.execute("create table t1(ts timestamp, c1 int)")
tdSql.execute("insert into t1(c1, ts) values(1, %d)" % self.ts)
tdSql.query("select * from t1")
tdSql.checkRows(1)
# Case 2
tdSql.execute("insert into t1(c1, ts) values(2, %d)(3, %d)" % (self.ts + 1000, self.ts + 2000))
tdSql.query("select * from t1")
tdSql.checkRows(3)
# Case 3
tdSql.execute("create table t2(ts timestamp, c1 timestamp)")
tdSql.execute(" insert into t2(c1, ts) values(%d, %d)" % (self.ts, self.ts + 5000))
tdSql.query("select * from t2")
tdSql.checkRows(1)
tdSql.execute(" insert into t2(c1, ts) values(%d, %d)(%d, %d)" % (self.ts, self.ts + 6000, self.ts + 3000, self.ts + 8000))
tdSql.query("select * from t2")
tdSql.checkRows(3)
# Case 4
tdSql.execute("create table stb(ts timestamp, c1 int, c2 binary(20)) tags(tstag timestamp, t1 int)")
tdSql.execute("insert into tb1(c2, ts, c1) using stb(t1, tstag) tags(1, now) values('test', %d, 1)" % self.ts)
tdSql.query("select * from stb")
tdSql.checkRows(1)
# Case 5
tdSql.execute("insert into tb1(c2, ts, c1) using stb(t1, tstag) tags(1, now) values('test', now, 1) tb2(c1, ts) using stb tags(now + 2m, 1000) values(1, now - 1h)")
tdSql.query("select * from stb")
tdSql.checkRows(3)
tdSql.execute(" insert into tb1(c2, ts, c1) using stb(t1, tstag) tags(1, now) values('test', now + 10s, 1) tb2(c1, ts) using stb(tstag) tags(now + 2m) values(1, now - 3h)(2, now - 2h)")
tdSql.query("select * from stb")
tdSql.checkRows(6)
# Case 6
tdSql.execute("create table stb2 (ts timestamp, c1 timestamp, c2 timestamp) tags(t1 timestamp, t2 timestamp)")
tdSql.execute(" insert into tb4(c1, c2, ts) using stb2(t2, t1) tags(now, now + 1h) values(now + 1s, now + 2s, now + 3s)(now -1s, now - 2s, now - 3s) tb5(c2, ts, c1) using stb2(t2) tags(now + 1h) values(now, now, now)")
tdSql.query("select * from stb2")
tdSql.checkRows(3)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
......@@ -44,7 +44,7 @@ class TwoClients:
# insert data with c connector
for i in range(10):
os.system("taosdemo -f manualTest/TD-5114/insertDataDb3Replica2.json -y ")
os.system("%staosBenchmark -f manualTest/TD-5114/insertDataDb3Replica2.json -y ")
# # check data correct
tdSql.execute("show databases")
tdSql.execute("use db3")
......
......@@ -55,7 +55,7 @@ class TDTestCase:
tdSql.checkData(0,9,3)
#run taosdemo to occupy all cache, need to manually check memory consumption
os.system("%staosdemo -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
input("please check memory usage for taosd. After checking, press enter")
#alter cache block to 8, then check alter
......@@ -64,7 +64,7 @@ class TDTestCase:
tdSql.checkData(0,9,8)
#run taosdemo to occupy all cache, need to manually check memory consumption
os.system("%staosdemo -f tools/taosdemoAllTest/manual_block2.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/manual_block2.json" % binPath)
input("please check memory usage for taosd. After checking, press enter")
##expected result the peak memory consumption should increase by around 80MB = 5 blocks of cache
......
......@@ -74,7 +74,7 @@ class TDTestCase:
tdSql.query('show databases')
tdSql.execute('alter database db blocks 3') # minimize the data in cache
tdSql.checkData(0,14,2)
os.system("%staosdemo -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
print("default location is at /home/bryan/Documents/Github/TDengine/sim/dnode1/data/vnode")
print('comp = 2')
input("please check disk usage for taosd. After checking, press enter")
......@@ -91,7 +91,7 @@ class TDTestCase:
tdSql.execute('alter database db comp 0')
tdSql.query('show databases')
tdSql.checkData(0,14,0)
os.system("%staosdemo -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
print("default location is at /home/bryan/Documents/Github/TDengine/sim/dnode1/data")
print('comp = 0')
input("please check disk usage for taosd. After checking, press enter")
......@@ -108,7 +108,7 @@ class TDTestCase:
tdSql.execute('alter database db comp 1')
tdSql.query('show databases')
tdSql.checkData(0,14,1)
os.system("%staosdemo -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath)
print("default location is at /home/bryan/Documents/Github/TDengine/sim/dnode1/data")
print('comp = 1')
input("please check disk usage for taosd. After checking, press enter")
......
......@@ -211,7 +211,7 @@ class TDTestCase:
tdLog.info(f"taosd found in {buildPath}")
binPath = buildPath + "/build/bin/"
create_table_cmd = f"{binPath}taosdemo -f {filepath} > /dev/null 2>&1"
create_table_cmd = f"{binPath}taosBenchmark -f {filepath} > /dev/null 2>&1"
_ = subprocess.check_output(create_table_cmd, shell=True).decode("utf-8")
def droptmpfile(self):
......
......@@ -89,7 +89,7 @@ class TDTestCase:
tdLog.info(f"taosd found in {buildPath}")
binPath = buildPath + "/debug/build/bin/"
query_table_cmd = f"yes | {binPath}taosdemo -f {filepath}"
query_table_cmd = f"yes | {binPath}taosBenchmark -f {filepath}"
_ = subprocess.check_output(query_table_cmd, shell=True).decode("utf-8")
def checkqueryresult(self, expectrows):
......
......@@ -2220,7 +2220,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# regualr-table
os.system("%staosdemo -N -d regular -t 2 -n 1000 -l 4095 -y" % binPath)
os.system("%staosBenchmark -N -d regular -t 2 -n 1000 -l 4095 -y" % binPath)
tdSql.execute("use regular")
tdSql.query("select * from d0;")
tdSql.checkCols(4096)
......@@ -2281,7 +2281,7 @@ class TDTestCase:
tdSql.checkRows(1000)
#stable
os.system("%staosdemo -d super -t 2 -n 1000 -l 4093 -y" % binPath)
os.system("%staosBenchmark -d super -t 2 -n 1000 -l 4093 -y" % binPath)
tdSql.execute("use super")
tdSql.query("select * from meters;")
tdSql.checkCols(4096)
......
......@@ -49,7 +49,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
os.system("%staosdemo -f query/nestedQuery/insertData.json -y " % binPath)
os.system("%staosBenchmark -f query/nestedQuery/insertData.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000)
......
......@@ -132,6 +132,25 @@ class TDTestCase:
tdSql.error("select top(tbcol1, 12) from st order by ts, tbcol1")
tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2")
fun_list = ['avg','count','twa','sum','stddev','leastsquares','min',
'max','first','last','top','bottom','percentile','apercentile',
'last_row','diff','spread','distinct']
key = ['tbol','tagcol']
for i in range(1,15):
for k in key:
for j in fun_list:
if j == 'leastsquares':
pick_func=j+'('+ k + str(i) +',1,1)'
elif j == 'top' or j == 'bottom' : continue
elif j == 'percentile' or j == 'apercentile':
pick_func=j+'('+ k + str(i) +',1)'
else:
pick_func=j+'('+ k + str(i) +')'
sql = 'select %s from st group by %s order by %s' % (pick_func , k+str(i), k+str(i))
tdSql.error(sql)
sql = 'select %s from st6 group by %s order by %s ' % (pick_func , k+str(i), k+str(i))
tdSql.error(sql)
tdSql.query("select top(tbcol1, 2) from st1 group by tbcol2 order by tbcol2")
tdSql.query("select top(tbcol1, 12) from st order by tbcol1, ts")
......
......@@ -51,7 +51,7 @@ class TDTestCase:
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# check the params of taosdemo about time_step is nano
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertNanoDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertNanoDB.json -y " % binPath)
tdSql.execute("use testdb1")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -68,7 +68,7 @@ class TDTestCase:
tdSql.checkData(0, 0,"2021-07-01 00:00:00.000099000")
# check the params of taosdemo about time_step is us
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertUSDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertUSDB.json -y " % binPath)
tdSql.execute("use testdb2")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -85,7 +85,7 @@ class TDTestCase:
tdSql.checkData(0, 0,"2021-07-01 00:00:00.099000")
# check the params of taosdemo about time_step is ms
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertMSDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoInsertMSDB.json -y " % binPath)
tdSql.execute("use testdb3")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......
......@@ -53,7 +53,7 @@ class TDTestCase:
# check stable stb0
os.system(
"%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabase.json -y " %
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabase.json -y " %
binPath)
tdSql.execute("use nsdb")
tdSql.query("show stables")
......@@ -88,7 +88,7 @@ class TDTestCase:
# check stable stb0
os.system(
"%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabaseNow.json -y " %
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabaseNow.json -y " %
binPath)
tdSql.execute("use nsdb2")
......@@ -108,7 +108,7 @@ class TDTestCase:
# cols
os.system(
"%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
binPath)
tdSql.execute("use nsdbcsv")
tdSql.query("show stables")
......@@ -130,7 +130,7 @@ class TDTestCase:
# taosdemo test insert with command and parameter , detals show
# taosdemo --help
os.system(
"%staosdemo -u root -ptaosdata -P 6030 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " %
"%staosBenchmark -u root -ptaosdata -P 6030 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " %
binPath)
tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600)
......@@ -152,7 +152,7 @@ class TDTestCase:
sleep(10)
os.system("%staosdemo -s taosdemoTestNanoCreateDB.sql -y " % binPath)
os.system("%staosBenchmark -s taosdemoTestNanoCreateDB.sql -y " % binPath)
tdSql.query("select count(*) from nsdbsql.meters")
tdSql.checkData(0, 0, 2)
......
###################################################################
''###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
......@@ -49,7 +49,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# query: query test for nanoSecond with where and max min groupby order
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabase.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabase.json -y " % binPath)
tdSql.execute("use nsdb")
......@@ -92,10 +92,10 @@ class TDTestCase:
# query : query above sqls by taosdemo and continuously
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.json -y " % binPath)
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " % binPath)
tdSql.execute("use nsdbcsv")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -140,7 +140,7 @@ class TDTestCase:
tdSql.checkRows(10)
# query : query above sqls by taosdemo and continuously
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuerycsv.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuerycsv.json -y " % binPath)
os.system("rm -rf ./query_res*.txt*")
os.system("rm -rf tools/taosdemoAllTest/NanoTestCase/*.py.sql")
......
......@@ -73,8 +73,8 @@ class TDTestCase:
# insert data
os.system("%staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabaseInsertForSub.json" % binPath)
os.system("nohup %staosdemo -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoSubscribe.json &" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabaseInsertForSub.json" % binPath)
os.system("nohup %staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoSubscribe.json &" % binPath)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoSubscribe.json" |grep -v "grep"|awk \'{print $2}\'')[1])
......
......@@ -56,7 +56,7 @@ class TDTestCase:
#print("==============taosdemo,#create stable,table; insert table; show table; select table; drop table")
self.tsdemo = "tsdemo~!.@#$%^*[]-_=+{,?.}"
#this escape character is not support in shell . include & () <> | /
os.system("%staosdemo -d test -E -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
os.system("%staosBenchmark -d test -E -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
tdSql.execute("use test ;" )
tdSql.query("select count(*) from meters")
tdSql.checkData(0, 0, 1000)
......@@ -91,14 +91,14 @@ class TDTestCase:
tdSql.error("select * from test.`%s2` ; " %self.tsdemo)
# Exception
os.system("%staosdemo -d test -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
os.system("%staosBenchmark -d test -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
tdSql.query("show test.tables ")
tdSql.checkRows(0)
#print("==============taosdemo,#create regular table; insert table; show table; select table; drop table")
self.tsdemo = "tsdemo~!.@#$%^*[]-_=+{,?.}"
#this escape character is not support in shell . include & () <> | /
os.system("%staosdemo -N -E -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
os.system("%staosBenchmark -N -E -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
tdSql.execute("use test ;" )
tdSql.query("select count(*) from `%s1`" %self.tsdemo)
tdSql.checkData(0, 0, 100)
......@@ -125,13 +125,13 @@ class TDTestCase:
tdSql.checkRows(9)
# Exception
os.system("%staosdemo -N -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
os.system("%staosBenchmark -N -m %s -t 10 -n 100 -l 10 -y " % (binPath,self.tsdemo))
tdSql.query("show test.tables ")
tdSql.checkRows(0)
#print("==============taosdemo——json_yes,#create stable,table; insert table; show table; select table; drop table")
os.system("%staosdemo -f tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json -y " % binPath)
tdSql.execute("use dbyes")
self.tsdemo_stable = "tsdemo_stable~!.@#$%^*[]-_=+{,?.}"
......@@ -171,7 +171,7 @@ class TDTestCase:
#print("==============taosdemo——json_no,#create stable,table; insert table; show table; select table; drop table")
os.system("%staosdemo -f tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json -y " % binPath)
tdSql.query("show dbno.tables;")
tdSql.checkRows(0)
......
......@@ -52,13 +52,13 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# # insert 1000w rows in stb0
os.system("%staosdemo -f tools/taosdemoAllTest/TD-3453/query-interrupt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/TD-3453/query-interrupt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0,60)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 6000000)
os.system('%staosdemo -f tools/taosdemoAllTest/TD-3453/queryall.json -y & ' % binPath)
os.system('%staosBenchmark -f tools/taosdemoAllTest/TD-3453/queryall.json -y & ' % binPath)
time.sleep(2)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "TD-3453/queryall.json" |grep -v "grep"|awk \'{print $2}\'')[1])
taosd_cpu_load_1 = float(subprocess.getstatusoutput('top -n 1 -b -p $(ps aux|grep "bin/taosd -c"|grep -v "grep" |awk \'{print $2}\')|awk \'END{print}\' |awk \'{print $9}\'')[1])
......
......@@ -55,7 +55,7 @@ class TDTestCase:
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# test case for https://jira.taosdata.com:18080/browse/TD-4985
os.system("rm -rf tools/taosdemoAllTest/TD-4985/query-limit-offset.py.sql")
os.system("%staosdemo -f tools/taosdemoAllTest/TD-4985/query-limit-offset.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/TD-4985/query-limit-offset.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10000)
......
......@@ -52,7 +52,7 @@ class TDTestCase:
#-N:regular table -d:database name -t:table num -n:rows num per table -l:col num -y:force
#regular old && new
startTime = time.time()
os.system("%staosdemo -N -d regular_old -t 1 -n 10 -l 1023 -y" % binPath)
os.system("%staosBenchmark -N -d regular_old -t 1 -n 10 -l 1023 -y" % binPath)
tdSql.execute("use regular_old")
tdSql.query("show tables;")
tdSql.checkRows(1)
......@@ -61,7 +61,7 @@ class TDTestCase:
tdSql.query("describe d0;")
tdSql.checkRows(1024)
os.system("%staosdemo -N -d regular_new -t 1 -n 10 -l 4095 -y" % binPath)
os.system("%staosBenchmark -N -d regular_new -t 1 -n 10 -l 4095 -y" % binPath)
tdSql.execute("use regular_new")
tdSql.query("show tables;")
tdSql.checkRows(1)
......@@ -71,7 +71,7 @@ class TDTestCase:
tdSql.checkRows(4096)
#super table -d:database name -t:table num -n:rows num per table -l:col num -y:force
os.system("%staosdemo -d super_old -t 1 -n 10 -l 1021 -y" % binPath)
os.system("%staosBenchmark -d super_old -t 1 -n 10 -l 1021 -y" % binPath)
tdSql.execute("use super_old")
tdSql.query("show tables;")
tdSql.checkRows(1)
......@@ -84,7 +84,7 @@ class TDTestCase:
tdSql.query("describe d0;")
tdSql.checkRows(1024)
os.system("%staosdemo -d super_new -t 1 -n 10 -l 4093 -y" % binPath)
os.system("%staosBenchmark -d super_new -t 1 -n 10 -l 4093 -y" % binPath)
tdSql.execute("use super_new")
tdSql.query("show tables;")
tdSql.checkRows(1)
......@@ -104,7 +104,7 @@ class TDTestCase:
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# test case for https://jira.taosdata.com:18080/browse/TD-5213
os.system("%staosdemo -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.json -y " % binPath)
tdSql.execute("use json")
tdSql.query("select count (tbname) from stb_old")
tdSql.checkData(0, 0, 1)
......
......@@ -50,10 +50,10 @@ class TDTestCase:
# insert: drop and child_table_exists combination test
# insert: using parament "childtable_offset and childtable_limit" to control table'offset point and offset
os.system("%staosdemo -f tools/taosdemoAllTest/moredemo-offset-newdb.json" % binPath)
os.system("%staosdemo -f tools/taosdemoAllTest/moredemo-offset-limit1.json & " % binPath)
os.system("%staosdemo -f tools/taosdemoAllTest/moredemo-offset-limit94.json & " % binPath)
os.system("%staosdemo -f tools/taosdemoAllTest/moredemo-offset-limit5.json & " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/moredemo-offset-newdb.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/moredemo-offset-limit1.json & " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/moredemo-offset-limit94.json & " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/moredemo-offset-limit5.json & " % binPath)
sleep(15)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
......
......@@ -52,13 +52,13 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# # insert 1000w rows in stb0
os.system("%staosdemo -f tools/taosdemoAllTest/query-interrupt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/query-interrupt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0,60)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 6000000)
os.system('%staosdemo -f tools/taosdemoAllTest/queryall.json -y & ' % binPath)
os.system('%staosBenchmark -f tools/taosdemoAllTest/queryall.json -y & ' % binPath)
time.sleep(2)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "taosdemoAllTest/queryall.json" |grep -v "grep"|awk \'{print $2}\'')[1])
taosd_cpu_load_1 = float(subprocess.getstatusoutput('top -n 1 -b -p $(ps aux|grep "bin/taosd -c"|grep -v "grep" |awk \'{print $2}\')|awk \'END{print}\' |awk \'{print $9}\'')[1])
......
......@@ -68,7 +68,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -f tools/taosdemoAllTest/sub_no_result.json -g 2>&1 | tee sub_no_result.log" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sub_no_result.json -g 2>&1 | tee sub_no_result.log" % binPath)
test_line = int(self.execCmdAndGetOutput("cat sub_no_result.log | wc -l"))
if(test_line < 1100024):
tdLog.exit("failed test subscribeNoResult: %d != expected(1100024)" % test_line)
......
......@@ -49,7 +49,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
os.system("%staosdemo -f tools/taosdemoAllTest/insert-allDataType.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-allDataType.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000)
......@@ -65,7 +65,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 200000)
# stmt interface
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-allDataType-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-allDataType-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000)
......@@ -81,7 +81,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 200000)
# taosdemo command line
os.system("%staosdemo -t 1000 -n 100 -T 10 -b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,NCHAR,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY -y " % binPath)
os.system("%staosBenchmark -t 1000 -n 100 -T 10 -b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,NCHAR,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY -y " % binPath)
tdSql.execute("use test")
tdSql.query("select count (tbname) from meters")
tdSql.checkData(0, 0, 1000)
......
......@@ -51,7 +51,7 @@ class TDTestCase:
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# check the params of taosdemo about time_step is nano
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoInsertNanoDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/taosdemoInsertNanoDB.json -y " % binPath)
tdSql.execute("use testdb1")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -68,7 +68,7 @@ class TDTestCase:
tdSql.checkData(0, 0,"2021-07-01 00:00:00.000099000")
# check the params of taosdemo about time_step is us
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoInsertUSDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/taosdemoInsertUSDB.json -y " % binPath)
tdSql.execute("use testdb2")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -85,7 +85,7 @@ class TDTestCase:
tdSql.checkData(0, 0,"2021-07-01 00:00:00.099000")
# check the params of taosdemo about time_step is ms
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoInsertMSDB.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/taosdemoInsertMSDB.json -y " % binPath)
tdSql.execute("use testdb3")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......
......@@ -53,7 +53,7 @@ class TDTestCase:
os.system("rm -rf tools/taosdemoAllTest/%s.sql" % testcaseFilename )
# insert: create one or mutiple tables per sql and insert multiple rows per sql
os.system("%staosdemo -f tools/taosdemoAllTest/insert-1s1tnt1r.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tnt1r.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 11)
......@@ -69,7 +69,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 2000)
# restful connector insert data
os.system("%staosdemo -f tools/taosdemoAllTest/insertRestful.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertRestful.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -86,7 +86,7 @@ class TDTestCase:
# default values json files
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insert-default.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-default.json -y " % binPath)
tdSql.query("show databases;")
for i in range(tdSql.queryRows):
if tdSql.queryResult[i][0] == 'db':
......@@ -96,7 +96,7 @@ class TDTestCase:
tdSql.checkData(i, 16, 'ms')
# insert: create mutiple tables per sql and insert one rows per sql .
os.system("%staosdemo -f tools/taosdemoAllTest/insert-1s1tntmr.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tntmr.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -113,7 +113,7 @@ class TDTestCase:
# insert: using parament "insert_interval to controls spped of insert.
# but We need to have accurate methods to control the speed, such as getting the speed value, checking the count and so on。
os.system("%staosdemo -f tools/taosdemoAllTest/insert-interval-speed.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interval-speed.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -131,9 +131,9 @@ class TDTestCase:
# spend 2min30s for 3 testcases.
# insert: drop and child_table_exists combination test
# insert: using parament "childtable_offset and childtable_limit" to control table'offset point and offset
os.system("%staosdemo -f tools/taosdemoAllTest/insert-nodbnodrop.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-nodbnodrop.json -y" % binPath)
tdSql.error("show dbno.stables")
os.system("%staosdemo -f tools/taosdemoAllTest/insert-newdb.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newdb.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 5)
......@@ -145,7 +145,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 8)
tdSql.query("select count (tbname) from stb4")
tdSql.checkData(0, 0, 8)
os.system("%staosdemo -f tools/taosdemoAllTest/insert-offset.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-offset.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 50)
......@@ -157,7 +157,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 180)
tdSql.query("select count(*) from stb4")
tdSql.checkData(0, 0, 160)
os.system("%staosdemo -f tools/taosdemoAllTest/insert-newtable.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newtable.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 150)
......@@ -169,7 +169,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 340)
tdSql.query("select count(*) from stb4")
tdSql.checkData(0, 0, 400)
os.system("%staosdemo -f tools/taosdemoAllTest/insert-renewdb.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-renewdb.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 50)
......@@ -185,30 +185,30 @@ class TDTestCase:
# insert: let parament in json file is illegal, it'll expect error.
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertColumnsAndTagNumLarge4096.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNumLarge4096.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertSigcolumnsNum4096.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertSigcolumnsNum4096.json -y " % binPath)
tdSql.error("select * from db.stb0")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertColumnsAndTagNum4096.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNum4096.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkData(0, 0, 10000)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertInterlaceRowsLarge1M.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertInterlaceRowsLarge1M.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(0)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertColumnsNum0.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsNum0.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("show stables like 'stb0%' ")
tdSql.checkData(0, 2, 11)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertTagsNumLarge128.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTagsNumLarge128.json -y " % binPath)
tdSql.error("use db1")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(1)
tdSql.query("select count(*) from db.stb1")
......@@ -218,19 +218,19 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb3")
tdSql.checkRows(1)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertNumOfrecordPerReq0.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReq0.json -y " % binPath)
tdSql.error("select count(*) from db.stb0")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertNumOfrecordPerReqless0.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReqless0.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertChildTab0.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTab0.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/insertChildTabLess0.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTabLess0.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists blf")
os.system("%staosdemo -f tools/taosdemoAllTest/insertTimestepMulRowsLargeint16.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTimestepMulRowsLargeint16.json -y " % binPath)
tdSql.execute("use blf")
tdSql.query("select ts from blf.p_0_topics_7 limit 262800,1")
tdSql.checkData(0, 0, "2020-03-31 12:00:00.000")
......@@ -238,7 +238,7 @@ class TDTestCase:
tdSql.checkData(0, 0, "2019-10-01 00:00:00")
tdSql.query("select last(ts) from blf.p_0_topics_6 ")
tdSql.checkData(0, 0, "2020-09-29 23:59:00")
os.system("%staosdemo -f tools/taosdemoAllTest/insertMaxNumPerReq.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insertMaxNumPerReq.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 5000000)
......@@ -248,7 +248,7 @@ class TDTestCase:
# insert: timestamp and step
os.system("%staosdemo -f tools/taosdemoAllTest/insert-timestep.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-timestep.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("show stables")
tdSql.query("select count (tbname) from stb0")
......@@ -265,7 +265,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 400)
# # insert: disorder_ratio
os.system("%staosdemo -f tools/taosdemoAllTest/insert-disorder.json -g 2>&1 -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-disorder.json -g 2>&1 -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1)
......@@ -277,7 +277,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
os.system("%staosdemo -f tools/taosdemoAllTest/insert-sample-ts.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample-ts.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
......@@ -296,7 +296,7 @@ class TDTestCase:
tdSql.checkRows(10)
# insert: sample json
os.system("%staosdemo -f tools/taosdemoAllTest/insert-sample.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
......@@ -309,7 +309,7 @@ class TDTestCase:
# insert: test interlace parament
os.system("%staosdemo -f tools/taosdemoAllTest/insert-interlace-row.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interlace-row.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 100)
......@@ -322,7 +322,7 @@ class TDTestCase:
tdSql.execute('drop database if exists db')
tdSql.execute('create database db')
tdSql.execute('use db')
os.system("%staosdemo -y -f tools/taosdemoAllTest/insert-drop-exist-auto-N00.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-N00.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
tdSql.execute('use db')
tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
tdSql.checkRows(20)
......@@ -338,7 +338,7 @@ class TDTestCase:
tdSql.checkRows(0)
tdSql.execute('drop database if exists db')
os.system("%staosdemo -y -f tools/taosdemoAllTest/insert-drop-exist-auto-Y00.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-Y00.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
tdSql.execute('use db')
tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
tdSql.checkRows(20)
......
......@@ -50,7 +50,7 @@ class TDTestCase:
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# line_protocol——telnet and json
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -67,7 +67,7 @@ class TDTestCase:
# insert: create mutiple tables per sql and insert one rows per sql .
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-1s1tntmr-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-1s1tntmr-sml.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -84,7 +84,7 @@ class TDTestCase:
# insert: using parament "insert_interval to controls spped of insert.
# but We need to have accurate methods to control the speed, such as getting the speed value, checking the count and so on。
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-interval-speed-sml.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-interval-speed-sml.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select tbname from stb0")
tdSql.checkRows(100 )
......@@ -103,9 +103,9 @@ class TDTestCase:
# insert: drop and child_table_exists combination test
# insert: sml can't support parament "childtable_offset and childtable_limit" \ drop=no or child_table_exists = yes
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-nodbnodrop-sml.json -y" % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-nodbnodrop-sml.json -y" % binPath)
# tdSql.error("show dbno.stables")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-newdb-sml.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-newdb-sml.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 5)
......@@ -117,7 +117,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 8)
tdSql.query("select count (tbname) from stb4")
tdSql.checkData(0, 0, 8)
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-renewdb-sml.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-renewdb-sml.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 50)
......@@ -133,29 +133,29 @@ class TDTestCase:
# insert: let parament in json file is illegal, it'll expect error.
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertColumnsAndTagNumLarge4096-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertColumnsAndTagNumLarge4096-sml.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertSigcolumnsNum4096-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertSigcolumnsNum4096-sml.json -y " % binPath)
tdSql.error("select * from db.stb0")
# tdSql.execute("drop database if exists db")
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertColumnsAndTagNum4096-sml.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertColumnsAndTagNum4096-sml.json -y " % binPath)
# tdSql.query("select count(*) from db.stb0")
# tdSql.checkData(0, 0, 10000)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertInterlaceRowsLarge1M-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertInterlaceRowsLarge1M-sml.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(0)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertColumnsNum0-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertColumnsNum0-sml.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("show stables like 'stb0%' ")
tdSql.checkData(0, 2, 11)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertTagsNumLarge128-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertTagsNumLarge128-sml.json -y " % binPath)
tdSql.error("use db1")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertBinaryLenLarge16374AllcolLar49151-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertBinaryLenLarge16374AllcolLar49151-sml.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(1)
tdSql.query("select count(*) from db.stb1")
......@@ -165,19 +165,19 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb3")
tdSql.checkRows(1)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertNumOfrecordPerReq0-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertNumOfrecordPerReq0-sml.json -y " % binPath)
tdSql.error("select count(*) from db.stb0")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertNumOfrecordPerReqless0-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertNumOfrecordPerReqless0-sml.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertChildTab0-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertChildTab0-sml.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertChildTabLess0-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertChildTabLess0-sml.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists blf")
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertTimestepMulRowsLargeint16-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertTimestepMulRowsLargeint16-sml.json -y " % binPath)
tdSql.execute("use blf")
tdSql.query("select ts from blf.p_0_topics_7 limit 262800,1")
tdSql.checkData(0, 0, "2020-03-31 12:00:00.000")
......@@ -186,13 +186,13 @@ class TDTestCase:
tdSql.query("select last(ts) from blf.p_0_topics_6 ")
tdSql.checkData(0, 0, "2020-09-29 23:59:00")
# it will be commented in ci because it spend too much time to insert data, but when you can excute it when you want to test this case.
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y " % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 5000000)
# tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 5000000)
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml-telnet.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml-telnet.json -y " % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 5000000)
......@@ -201,7 +201,7 @@ class TDTestCase:
# insert: timestamp and step
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-timestep-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-timestep-sml.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -217,7 +217,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 400)
# # insert: disorder_ratio
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-disorder-sml.json 2>&1 -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-disorder-sml.json 2>&1 -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1)
......@@ -229,7 +229,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-sample-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-sample-sml.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
......@@ -241,7 +241,7 @@ class TDTestCase:
tdSql.checkRows(10)
# insert: test interlace parament
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-interlace-row-sml.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/sml/insert-interlace-row-sml.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 100)
......
......@@ -49,7 +49,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-1s1tnt1r-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-1s1tnt1r-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000)
......@@ -66,7 +66,7 @@ class TDTestCase:
# insert: create mutiple tables per sql and insert one rows per sql .
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-1s1tntmr-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-1s1tntmr-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10)
......@@ -83,7 +83,7 @@ class TDTestCase:
# insert: using parament "insert_interval to controls spped of insert.
# but We need to have accurate methods to control the speed, such as getting the speed value, checking the count and so on。
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-interval-speed-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interval-speed-stmt.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
......@@ -101,9 +101,9 @@ class TDTestCase:
# spend 2min30s for 3 testcases.
# insert: drop and child_table_exists combination test
# insert: using parament "childtable_offset and childtable_limit" to control table'offset point and offset
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-nodbnodrop-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-nodbnodrop-stmt.json -y" % binPath)
tdSql.error("show dbno.stables")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-newdb-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-newdb-stmt.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 5)
......@@ -115,7 +115,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 8)
tdSql.query("select count (tbname) from stb4")
tdSql.checkData(0, 0, 8)
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-offset-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-offset-stmt.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 50)
......@@ -127,7 +127,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 180)
tdSql.query("select count(*) from stb4")
tdSql.checkData(0, 0, 160)
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-newtable-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-newtable-stmt.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 150)
......@@ -139,7 +139,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 340)
tdSql.query("select count(*) from stb4")
tdSql.checkData(0, 0, 400)
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-renewdb-stmt.json -y" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-renewdb-stmt.json -y" % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 50)
......@@ -155,29 +155,29 @@ class TDTestCase:
# insert: let parament in json file is illegal, it'll expect error.
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertColumnsAndTagNumLarge4096-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertColumnsAndTagNumLarge4096-stmt.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertSigcolumnsNum4096-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertSigcolumnsNum4096-stmt.json -y " % binPath)
tdSql.error("select * from db.stb0")
# tdSql.execute("drop database if exists db")
# os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertColumnsAndTagNum4096-stmt.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertColumnsAndTagNum4096-stmt.json -y " % binPath)
# tdSql.query("select count(*) from db.stb0")
# tdSql.checkData(0, 0, 10000)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertInterlaceRowsLarge1M-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertInterlaceRowsLarge1M-stmt.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(0)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertColumnsNum0-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertColumnsNum0-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("show stables like 'stb0%' ")
tdSql.checkData(0, 2, 11)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertTagsNumLarge128-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertTagsNumLarge128-stmt.json -y " % binPath)
tdSql.error("use db1")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-stmt.json -y " % binPath)
tdSql.query("select count(*) from db.stb0")
tdSql.checkRows(1)
tdSql.query("select count(*) from db.stb1")
......@@ -187,19 +187,19 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb3")
tdSql.checkRows(1)
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertNumOfrecordPerReq0-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertNumOfrecordPerReq0-stmt.json -y " % binPath)
tdSql.error("select count(*) from db.stb0")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertNumOfrecordPerReqless0-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertNumOfrecordPerReqless0-stmt.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertChildTab0-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertChildTab0-stmt.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists db")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertChildTabLess0-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertChildTabLess0-stmt.json -y " % binPath)
tdSql.error("use db")
tdSql.execute("drop database if exists blf")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertTimestepMulRowsLargeint16-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertTimestepMulRowsLargeint16-stmt.json -y " % binPath)
tdSql.execute("use blf")
tdSql.query("select ts from blf.p_0_topics_7 limit 262800,1")
tdSql.checkData(0, 0, "2020-03-31 12:00:00.000")
......@@ -207,7 +207,7 @@ class TDTestCase:
tdSql.checkData(0, 0, "2019-10-01 00:00:00")
tdSql.query("select last(ts) from blf.p_0_topics_6 ")
tdSql.checkData(0, 0, "2020-09-29 23:59:00")
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insertMaxNumPerReq-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insertMaxNumPerReq-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 5000000)
......@@ -216,7 +216,7 @@ class TDTestCase:
# insert: sample json
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-sample-ts-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-ts-stmt.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
......@@ -235,7 +235,7 @@ class TDTestCase:
tdSql.checkRows(10)
# insert: timestamp and step
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-timestep-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-timestep-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("show stables")
tdSql.query("select count (tbname) from stb0")
......@@ -252,7 +252,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 400)
# # insert: disorder_ratio
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-disorder-stmt.json 2>&1 -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-disorder-stmt.json 2>&1 -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1)
......@@ -264,7 +264,7 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
......@@ -276,7 +276,7 @@ class TDTestCase:
tdSql.checkRows(10)
# insert: test interlace parament
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 100)
......@@ -289,7 +289,7 @@ class TDTestCase:
tdSql.execute('drop database if exists db')
tdSql.execute('create database db')
tdSql.execute('use db')
os.system("%staosdemo -y -f tools/taosdemoAllTest/stmt/insert-drop-exist-auto-N00-stmt.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
os.system("%staosBenchmark -y -f tools/taosdemoAllTest/stmt/insert-drop-exist-auto-N00-stmt.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
tdSql.execute('use db')
tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
tdSql.checkRows(20)
......@@ -305,7 +305,7 @@ class TDTestCase:
tdSql.checkRows(0)
tdSql.execute('drop database if exists db')
os.system("%staosdemo -y -f tools/taosdemoAllTest/stmt/insert-drop-exist-auto-Y00-stmt.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
os.system("%staosBenchmark -y -f tools/taosdemoAllTest/stmt/insert-drop-exist-auto-Y00-stmt.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
tdSql.execute('use db')
tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
tdSql.checkRows(20)
......
......@@ -49,16 +49,16 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
os.system("%staosdemo -f tools/taosdemoAllTest/stmt/1174-small-stmt-random.json -y " % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/1174-small-stmt-random.json -y " % binPath)
# sleep(60)
# os.system("%staosdemo -f tools/taosdemoAllTest/stmt/1174-small-taosc.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/1174-small-taosc.json -y " % binPath)
# sleep(60)
# os.system("%staosdemo -f tools/taosdemoAllTest/stmt/1174-small-stmt.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/1174-small-stmt.json -y " % binPath)
# sleep(60)
# os.system("%staosdemo -f tools/taosdemoAllTest/stmt/1174-large-taosc.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/1174-large-taosc.json -y " % binPath)
# sleep(60)
# os.system("%staosdemo -f tools/taosdemoAllTest/stmt/1174-large-stmt.json -y " % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/1174-large-stmt.json -y " % binPath)
# tdSql.execute("use db")
# tdSql.query("select count (tbname) from stb0")
......
......@@ -108,10 +108,10 @@ class TDTestCase:
# taosc query: query specified table and query super table
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryInsertdata.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryInsertdata.json" %
binPath)
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryTaosc.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryTaosc.json" %
binPath)
os.system("cat query_res0.txt* > all_query_res0_taosc.txt")
os.system("cat query_res1.txt* > all_query_res1_taosc.txt")
......@@ -138,10 +138,10 @@ class TDTestCase:
# use restful api to query
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryInsertrestdata.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryInsertrestdata.json" %
binPath)
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryRestful.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryRestful.json" %
binPath)
os.system("cat query_res0.txt* > all_query_res0_rest.txt")
os.system("cat query_res1.txt* > all_query_res1_rest.txt")
......@@ -175,55 +175,55 @@ class TDTestCase:
# query times less than or equal to 100
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryInsertdata.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryInsertdata.json" %
binPath)
os.system(
"%staosdemo -f tools/taosdemoAllTest/querySpeciMutisql100.json" %
"%staosBenchmark -f tools/taosdemoAllTest/querySpeciMutisql100.json" %
binPath)
os.system(
"%staosdemo -f tools/taosdemoAllTest/querySuperMutisql100.json" %
"%staosBenchmark -f tools/taosdemoAllTest/querySuperMutisql100.json" %
binPath)
# query result print QPS
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryInsertdata.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryInsertdata.json" %
binPath)
exceptcode = os.system(
"%staosdemo -f tools/taosdemoAllTest/queryQps.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryQps.json" %
binPath)
assert exceptcode == 0
# use illegal or out of range parameters query json file
os.system(
"%staosdemo -f tools/taosdemoAllTest/queryInsertdata.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryInsertdata.json" %
binPath)
exceptcode = os.system(
"%staosdemo -f tools/taosdemoAllTest/queryTimes0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryTimes0.json" %
binPath)
assert exceptcode != 0
exceptcode0 = os.system(
"%staosdemo -f tools/taosdemoAllTest/queryTimesless0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryTimesless0.json" %
binPath)
assert exceptcode0 != 0
exceptcode1 = os.system(
"%staosdemo -f tools/taosdemoAllTest/queryConcurrentless0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryConcurrentless0.json" %
binPath)
assert exceptcode1 != 0
exceptcode2 = os.system(
"%staosdemo -f tools/taosdemoAllTest/queryConcurrent0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/queryConcurrent0.json" %
binPath)
assert exceptcode2 != 0
exceptcode3 = os.system(
"%staosdemo -f tools/taosdemoAllTest/querrThreadsless0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/querrThreadsless0.json" %
binPath)
assert exceptcode3 != 0
exceptcode4 = os.system(
"%staosdemo -f tools/taosdemoAllTest/querrThreads0.json" %
"%staosBenchmark -f tools/taosdemoAllTest/querrThreads0.json" %
binPath)
assert exceptcode4 != 0
......
......@@ -74,8 +74,8 @@ class TDTestCase:
os.system("rm -rf ./all_subscribe_res*")
sleep(2)
# subscribe: sync
os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdata.json" % binPath)
os.system("nohup %staosdemo -f tools/taosdemoAllTest/subSync.json &" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdata.json" % binPath)
os.system("nohup %staosBenchmark -f tools/taosdemoAllTest/subSync.json &" % binPath)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "taosdemoAllTest/subSync.json" |grep -v "grep"|awk \'{print $2}\'')[1])
# insert extral data
......@@ -112,21 +112,21 @@ class TDTestCase:
os.system("rm -rf ./all_subscribe*")
# # sql number lager 100
os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSpecMaxsql100.json" % binPath) != 0
assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSuperMaxsql100.json" % binPath) != 0
os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
assert os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncSpecMaxsql100.json" % binPath) != 0
assert os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncSuperMaxsql100.json" % binPath) != 0
# # result files is null
# os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
# os.system("%staosdemo -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath)
# # assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath) != 0
# os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath)
# # assert os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath) != 0
# resubAfterConsume= -1 endAfter=-1 ;
os.system('kill -9 `ps aux|grep "subSyncResubACMinus1.json" |grep -v "grep"|awk \'{print $2}\'` ')
os.system("nohup %staosdemo -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1.json & " % binPath)
os.system("nohup %staosBenchmark -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1.json & " % binPath)
sleep(2)
query_pid1 = int(subprocess.getstatusoutput('ps aux|grep "subSyncResubACMinus1.json" |grep -v "grep"|awk \'{print $2}\'')[1])
print("get sub1 process'pid")
......@@ -144,9 +144,9 @@ class TDTestCase:
os.system("rm -rf ./subscribe_res*")
# # resubAfterConsume= -1 endAfter=0 ;
# os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
# os.system('kill -9 `ps aux|grep "subSyncResubACMinus1endAfter0.json" |grep -v "grep"|awk \'{print $2}\'` ')
# os.system("nohup %staosdemo -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfter0.json & " % binPath)
# os.system("nohup %staosBenchmark -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfter0.json & " % binPath)
# sleep(2)
# query_pid1 = int(subprocess.getstatusoutput('ps aux|grep "subSyncResubACMinus1endAfter0.json" |grep -v "grep"|awk \'{print $2}\'')[1])
# print("get sub2 process'pid")
......@@ -185,8 +185,8 @@ class TDTestCase:
# self.assertCheck("all_subscribe_res2.txt",subTimes2 ,1900)
# os.system("%staosdemo -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath)
# os.system("%staosdemo -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath)
# os.system("%staosBenchmark -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath)
......
......@@ -72,8 +72,8 @@ class TDTestCase:
os.system("rm -rf ./all_subscribe_res*")
# subscribe: resultfile
os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdata.json" % binPath)
os.system("nohup %staosdemo -f tools/taosdemoAllTest/subAsync.json &" % binPath)
os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdata.json" % binPath)
os.system("nohup %staosBenchmark -f tools/taosdemoAllTest/subAsync.json &" % binPath)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "taosdemoAllTest/subAsync.json" |grep -v "grep"|awk \'{print $2}\'')[1])
# insert extral data
......@@ -106,9 +106,9 @@ class TDTestCase:
os.system("kill -9 %d" % query_pid)
# # query times less than or equal to 100
os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSpecMaxsql100.json" % binPath) != 0
assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSuperMaxsql100.json" % binPath) != 0
os.system("%staosBenchmark -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath)
assert os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncSpecMaxsql100.json" % binPath) != 0
assert os.system("%staosBenchmark -f tools/taosdemoAllTest/subSyncSuperMaxsql100.json" % binPath) != 0
# delete useless files
os.system("rm -rf ./insert_res.txt")
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import os
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root) - len("/build/bin")]
break
return buildPath
def run(self):
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# insert data from a special timestamp
# check stable stb0
os.system(
"%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabase.json -y " %
binPath)
tdSql.execute("use nsdb")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb0_0")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(9, 1, "TIMESTAMP")
tdSql.query("select last(ts) from stb0")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.990000000")
# check stable stb1 which is insert with disord
tdSql.query("select count (tbname) from stb1")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb1_0")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb1")
tdSql.checkData(0, 0, 10000)
# check c8 is an nano timestamp
tdSql.query("describe stb1")
tdSql.checkDataType(9, 1, "TIMESTAMP")
# check insert timestamp_step is nano_second
tdSql.query("select last(ts) from stb1")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.990000000")
# insert data from now time
# check stable stb0
os.system(
"%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabaseNow.json -y " %
binPath)
tdSql.execute("use nsdb2")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb0_0")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 10000)
# check c8 is an nano timestamp
tdSql.query("describe stb0")
tdSql.checkDataType(9, 1, "TIMESTAMP")
# insert by csv files and timetamp is long int , strings in ts and
# cols
os.system(
"%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabasecsv.json -y " %
binPath)
tdSql.execute("use nsdbcsv")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP")
tdSql.query(
"select count(*) from stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000)
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000)
os.system("rm -rf ./insert_res.txt")
os.system("rm -rf tools/taosdemoAllTest/taosdemoTestSupportNano*.py.sql")
# taosdemo test insert with command and parameter , detals show
# taosdemo --help
os.system(
"%staosdemo -u root -ptaosdata -P 6030 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " %
binPath)
tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600)
# check taosdemo -s
sqls_ls = [
'drop database if exists nsdbsql;',
'create database nsdbsql precision "ns" keep 36500 days 6 update 1;',
'use nsdbsql;',
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);',
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 85, 32, 0.76);']
with open("./taosdemoTestNanoCreateDB.sql", mode="a") as sql_files:
for sql in sqls_ls:
sql_files.write(sql + "\n")
sql_files.close()
sleep(10)
os.system("%staosdemo -s taosdemoTestNanoCreateDB.sql -y " % binPath)
tdSql.query("select count(*) from nsdbsql.meters")
tdSql.checkData(0, 0, 2)
os.system("rm -rf ./res.txt")
os.system("rm -rf ./*.py.sql")
os.system("rm -rf ./taosdemoTestNanoCreateDB.sql")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
{
"filetype": "query",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"confirm_parameter_prompt": "no",
"databases": "nsdb",
"query_times": 10,
"query_mode": "taosc",
"specified_table_query": {
"query_interval": 1,
"concurrent": 2,
"sqls": [
{
"sql": "select count(*) from stb0 where ts>\"2021-07-01 00:01:00.000000000 \" ;",
"result": "./query_res0.txt"
},
{
"sql": "select count(*) from stb0 where ts>\"2021-07-01 00:01:00.000000000\" and ts <=\"2021-07-01 00:01:10.000000000\" ;",
"result": "./query_res1.txt"
},
{
"sql": "select count(*) from stb0 where ts>now-20d ;",
"result": "./query_res2.txt"
},
{
"sql": "select max(c10) from stb0;",
"result": "./query_res3.txt"
},
{
"sql": "select min(c1) from stb0;",
"result": "./query_res4.txt"
},
{
"sql": "select avg(c1) from stb0;",
"result": "./query_res5.txt"
},
{
"sql":"select count(*) from stb0 group by tbname;",
"result":"./query_res6.txt"
}
]
},
"super_table_query": {
"stblname": "stb0",
"query_interval": 0,
"threads": 4,
"sqls": [
{
"sql": "select count(*) from xxxx where ts>\"2021-07-01 00:01:00.000000000 \" ;",
"result": "./query_res_tb0.txt"
},
{
"sql":"select count(*) from xxxx where ts>\"2021-07-01 00:01:00.000000000\" and ts <=\"2021-07-01 00:01:10.000000000\" ;",
"result": "./query_res_tb1.txt"
},
{
"sql":"select first(*) from xxxx ;",
"result": "./query_res_tb2.txt"
},
{
"sql":"select last(*) from xxxx;",
"result": "./query_res_tb3.txt"
},
{
"sql":"select last_row(*) from xxxx ;",
"result": "./query_res_tb4.txt"
},
{
"sql":"select max(c10) from xxxx ;",
"result": "./query_res_tb5.txt"
},
{
"sql":"select min(c1) from xxxx ;",
"result": "./query_res_tb6.txt"
},
{
"sql":"select avg(c10) from xxxx ;",
"result": "./query_res_tb7.txt"
}
]
}
}
\ No newline at end of file
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import os
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
break
return buildPath
def run(self):
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
# query: query test for nanoSecond with where and max min groupby order
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabase.json -y " % binPath)
tdSql.execute("use nsdb")
# use where to filter
tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:00:00.590000000 \" ")
tdSql.checkData(0, 0, 4000)
tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:00:00.000000000\" and ts <=\"2021-07-01 00:00:00.590000000\" ")
tdSql.checkData(0, 0, 5900)
tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:00:00.590000000 \" ;")
tdSql.checkData(0, 0, 40)
tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:00:00.000000000\" and ts <=\"2021-07-01 00:00:00.590000000\" ")
tdSql.checkData(0, 0, 59)
# select max min avg from special col
tdSql.query("select max(c10) from stb0;")
print("select max(c10) from stb0 : " , tdSql.getData(0, 0))
tdSql.query("select max(c10) from tb0_0;")
print("select max(c10) from tb0_0 : " , tdSql.getData(0, 0))
tdSql.query("select min(c1) from stb0;")
print( "select min(c1) from stb0 : " , tdSql.getData(0, 0))
tdSql.query("select min(c1) from tb0_0;")
print( "select min(c1) from tb0_0 : " , tdSql.getData(0, 0))
tdSql.query("select avg(c1) from stb0;")
print( "select avg(c1) from stb0 : " , tdSql.getData(0, 0))
tdSql.query("select avg(c1) from tb0_0;")
print( "select avg(c1) from tb0_0 : " , tdSql.getData(0, 0))
tdSql.query("select count(*) from stb0 group by tbname;")
tdSql.checkData(0, 0, 100)
tdSql.checkData(10, 0, 100)
# query : query above sqls by taosdemo and continuously
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestSupportNanoQuery.json -y " % binPath)
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabasecsv.json -y " % binPath)
tdSql.execute("use nsdbcsv")
tdSql.query("show stables")
tdSql.checkData(0, 4, 100)
tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP")
tdSql.query("select count(*) from stb0 where ts >\"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000)
tdSql.query("select count(*) from stb0 where ts <now -1d-1h-3s")
tdSql.checkData(0, 0, 10000)
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000)
tdSql.execute('select count(*) from stb0 where c2 > 162687012800000000')
tdSql.execute('select count(*) from stb0 where c2 < 162687012800000000')
tdSql.execute('select count(*) from stb0 where c2 = 162687012800000000')
tdSql.execute('select count(*) from stb0 where c2 != 162687012800000000')
tdSql.execute('select count(*) from stb0 where c2 <> 162687012800000000')
tdSql.execute('select count(*) from stb0 where c2 > "2021-07-21 20:22:08.248246976"')
tdSql.execute('select count(*) from stb0 where c2 < "2021-07-21 20:22:08.248246976"')
tdSql.execute('select count(*) from stb0 where c2 = "2021-07-21 20:22:08.248246976"')
tdSql.execute('select count(*) from stb0 where c2 != "2021-07-21 20:22:08.248246976"')
tdSql.execute('select count(*) from stb0 where c2 <> "2021-07-21 20:22:08.248246976"')
tdSql.execute('select count(*) from stb0 where ts between "2021-07-01 00:00:00.000000000" and "2021-07-01 00:00:00.990000000"')
tdSql.execute('select count(*) from stb0 where ts between 1625068800000000000 and 1625068801000000000')
tdSql.query('select avg(c0) from stb0 interval(5000000000b)')
tdSql.checkRows(1)
tdSql.query('select avg(c0) from stb0 interval(100000000b)')
tdSql.checkRows(10)
tdSql.error('select avg(c0) from stb0 interval(1b)')
tdSql.error('select avg(c0) from stb0 interval(999b)')
tdSql.query('select avg(c0) from stb0 interval(1000b)')
tdSql.checkRows(100)
tdSql.query('select avg(c0) from stb0 interval(1u)')
tdSql.checkRows(100)
tdSql.query('select avg(c0) from stb0 interval(100000000b) sliding (100000000b)')
tdSql.checkRows(10)
# query : query above sqls by taosdemo and continuously
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestSupportNanoQuerycsv.json -y " % binPath)
os.system("rm -rf ./query_res*.txt*")
os.system("rm -rf tools/taosdemoAllTest/*.py.sql")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
{
"filetype": "query",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"confirm_parameter_prompt": "no",
"databases": "nsdbcsv",
"query_times": 10,
"query_mode": "taosc",
"specified_table_query": {
"query_interval": 1,
"concurrent": 2,
"sqls": [
{
"sql": "select count(*) from stb0 where ts> \"2021-07-01 00:00:00.490000000\" ;",
"result": "./query_res0.txt"
},
{
"sql": "select count(*) from stb0 where ts < now -22d-1h-3s ;",
"result": "./query_res1.txt"
},
{
"sql": "select count(*) from stb0 where ts < 1626918583000000000 ;",
"result": "./query_res2.txt"
},
{
"sql": "select count(*) from stb0 where c2 <> 162687012800000000';",
"result": "./query_res3.txt"
},
{
"sql": "select count(*) from stb0 where c2 != \"2021-07-21 20:22:08.248246976\";",
"result": "./query_res4.txt"
},
{
"sql": "select count(*) from stb0 where ts between \"2021-07-01 00:00:00.000000000\" and \"2021-07-01 00:00:00.990000000\";",
"result": "./query_res5.txt"
},
{
"sql":"select count(*) from stb0 group by tbname;",
"result":"./query_res6.txt"
},
{
"sql":"select count(*) from stb0 where ts between 1625068800000000000 and 1625068801000000000;",
"result":"./query_res7.txt"
},
{
"sql":"select avg(c0) from stb0 interval(5000000000b);",
"result":"./query_res8.txt"
},
{
"sql":"select avg(c0) from stb0 interval(100000000b) sliding (100000000b);",
"result":"./query_res9.txt"
}
]
},
"super_table_query": {
"stblname": "stb0",
"query_interval": 0,
"threads": 4,
"sqls": [
{
"sql": "select count(*) from xxxx where ts > \"2021-07-01 00:00:00.490000000\" ;",
"result": "./query_res_tb0.txt"
},
{
"sql":"select count(*) from xxxx where ts between \"2021-07-01 00:00:00.000000000\" and \"2021-07-01 00:00:00.990000000\" ;",
"result": "./query_res_tb1.txt"
},
{
"sql":"select first(*) from xxxx ;",
"result": "./query_res_tb2.txt"
},
{
"sql":"select last(*) from xxxx;",
"result": "./query_res_tb3.txt"
},
{
"sql":"select last_row(*) from xxxx ;",
"result": "./query_res_tb4.txt"
},
{
"sql":"select max(c0) from xxxx ;",
"result": "./query_res_tb5.txt"
},
{
"sql":"select min(c0) from xxxx ;",
"result": "./query_res_tb6.txt"
},
{
"sql":"select avg(c0) from xxxx ;",
"result": "./query_res_tb7.txt"
},
{
"sql":"select avg(c0) from xxxx interval(100000000b) sliding (100000000b) ;",
"result": "./query_res_tb8.txt"
}
]
}
}
\ No newline at end of file
{
"filetype":"subscribe",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"databases": "subnsdb",
"confirm_parameter_prompt": "no",
"specified_table_query":
{
"concurrent":2,
"mode":"sync",
"interval":10000,
"restart":"yes",
"keepProgress":"yes",
"sqls": [
{
"sql": "select * from stb0 where ts>= \"2021-07-01 00:00:00.000000000\" ;",
"result": "./subscribe_res0.txt"
},
{
"sql": "select * from stb0 where ts < now -2d-1h-3s ;",
"result": "./subscribe_res1.txt"
},
{
"sql": "select * from stb0 where ts < 1626918583000000000 ;",
"result": "./subscribe_res2.txt"
}]
}
}
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import os
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
import time
from datetime import datetime
import subprocess
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
break
return buildPath
# get the number of subscriptions
def subTimes(self,filename):
self.filename = filename
command = 'cat %s |wc -l'% filename
times = int(subprocess.getstatusoutput(command)[1])
return times
# assert results
def assertCheck(self,filename,subResult,expectResult):
self.filename = filename
self.subResult = subResult
self.expectResult = expectResult
args0 = (filename, subResult, expectResult)
assert subResult == expectResult , "Queryfile:%s ,result is %s != expect: %s" % args0
def run(self):
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
# clear env
os.system("ps -ef |grep 'taosdemoAllTest/taosdemoTestSupportNanoSubscribe.json' |grep -v 'grep' |awk '{print $2}'|xargs kill -9")
os.system("rm -rf ./subscribe_res*")
os.system("rm -rf ./all_subscribe_res*")
# insert data
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabaseInsertForSub.json" % binPath)
os.system("nohup %staosdemo -f tools/taosdemoAllTest/taosdemoTestSupportNanoSubscribe.json &" % binPath)
query_pid = int(subprocess.getstatusoutput('ps aux|grep "taosdemoAllTest/taosdemoTestSupportNanoSubscribe.json" |grep -v "grep"|awk \'{print $2}\'')[1])
# merge result files
sleep(5)
os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt")
os.system("cat subscribe_res1.txt* > all_subscribe_res1.txt")
os.system("cat subscribe_res2.txt* > all_subscribe_res2.txt")
# correct subscribeTimes testcase
subTimes0 = self.subTimes("all_subscribe_res0.txt")
self.assertCheck("all_subscribe_res0.txt",subTimes0 ,200)
subTimes1 = self.subTimes("all_subscribe_res1.txt")
self.assertCheck("all_subscribe_res1.txt",subTimes1 ,200)
subTimes2 = self.subTimes("all_subscribe_res2.txt")
self.assertCheck("all_subscribe_res2.txt",subTimes2 ,200)
# insert extral data
tdSql.execute("use subnsdb")
tdSql.execute("insert into tb0_0 values(now,100.1000,'subtest1',now-1s)")
sleep(15)
os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt")
subTimes0 = self.subTimes("all_subscribe_res0.txt")
self.assertCheck("all_subscribe_res0.txt",subTimes0 ,202)
# correct data testcase
os.system("kill -9 %d" % query_pid)
sleep(3)
os.system("rm -rf ./subscribe_res*")
os.system("rm -rf ./all_subscribe*")
os.system("rm -rf ./*.py.sql")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
......@@ -51,7 +51,7 @@ class TDTestCase:
else:
tdLog.info("taosdemo found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
os.system("%staosBenchmark -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute("use test")
......
......@@ -49,7 +49,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
taosdemoCmd = "%staosdemo -f tools/insert-interlace.json -PP 2>&1 | grep sleep | wc -l" % binPath
taosdemoCmd = "%staosBenchmark -f tools/insert-interlace.json -PP 2>&1 | grep sleep | wc -l" % binPath
sleepTimes = subprocess.check_output(
taosdemoCmd, shell=True).decode("utf-8")
print("sleep times: %d" % int(sleepTimes))
......
......@@ -51,8 +51,8 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosdemo -f tools/insert-tblimit-tboffset-insertrec.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit-tboffset-insertrec.json" % binPath)
tdSql.execute("use db")
tdSql.query("select count(tbname) from db.stb")
......@@ -60,8 +60,8 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 33000)
os.system("%staosdemo -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosdemo -f tools/insert-tblimit-tboffset0.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit-tboffset0.json" % binPath)
tdSql.execute("reset query cache")
tdSql.execute("use db")
......@@ -70,8 +70,8 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 20000)
os.system("%staosdemo -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosdemo -f tools/insert-tblimit1-tboffset.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit-tboffset-createdb.json" % binPath)
os.system("%staosBenchmark -f tools/insert-tblimit1-tboffset.json" % binPath)
tdSql.execute("reset query cache")
tdSql.execute("use db")
......
......@@ -53,12 +53,12 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -t %d -n %d" %
os.system("%staosBenchmark -y -t %d -n %d" %
(binPath, self.numberOfTables, self.numberOfRecords))
print("Sleep 2 seconds..")
time.sleep(2)
os.system('%staosdemo -f tools/query.json ' % binPath)
# taosdemoCmd = '%staosdemo -f tools/query.json ' % binPath
os.system('%staosBenchmark -f tools/query.json ' % binPath)
# taosdemoCmd = '%staosBenchmark -f tools/query.json ' % binPath
# threads = subprocess.check_output(
# taosdemoCmd, shell=True).decode("utf-8")
# print("threads: %d" % int(threads))
......
......@@ -51,7 +51,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -f tools/taosdemo-sampledata.json" % binPath)
os.system("%staosBenchmark -f tools/taosdemo-sampledata.json" % binPath)
tdSql.execute("use db")
tdSql.query("select count(tbname) from db.stb")
......
......@@ -54,9 +54,9 @@ class TDTestCase:
binPath = buildPath + "/build/bin/"
if(threadID == 0):
print("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
print("%staosBenchmark -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords))
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
os.system("%staosBenchmark -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords))
if(threadID == 1):
time.sleep(2)
......
......@@ -48,7 +48,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -f tools/insert.json -y" % binPath)
os.system("%staosBenchmark -f tools/insert.json -y" % binPath)
tdSql.execute("use db01")
tdSql.query("select count(*) from stb01")
......
......@@ -50,7 +50,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -N -y -t %d -n %d" %
os.system("%staosBenchmark -N -y -t %d -n %d" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.query("show databases")
......
......@@ -50,7 +50,7 @@ class TDTestCase:
tdLog.info("taosdemo found in %s" % buildPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -d test002 -y -t %d -n %d -b INT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
os.system("%staosBenchmark -d test002 -y -t %d -n %d -b INT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute('use test002')
......@@ -68,7 +68,7 @@ class TDTestCase:
tdSql.error('insert into d1 values(now,100,"abcd","abcd"')
tdSql.error('insert into d1 values(now,100,100,100)')
os.system("%staosdemo -d test002 -y -t %d -n %d --data-type INT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
os.system("%staosBenchmark -d test002 -y -t %d -n %d --data-type INT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute('use test002')
......@@ -76,7 +76,7 @@ class TDTestCase:
tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords)
os.system("%staosdemo -d test002 -y -t %d -n %d -bINT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
os.system("%staosBenchmark -d test002 -y -t %d -n %d -bINT,nchar\\(8\\),binary\\(16\\),binary,nchar -w 8" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute('use test002')
......
......@@ -59,11 +59,11 @@ class TDTestCase:
#new db and insert data
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f tsdb/insertDataDb1.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb1.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f tsdb/insertDataDb2.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f tsdb/insertDataDb2Newstab.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2Newstab.json -y " % binPath)
tdSql.execute("use db2")
tdSql.execute("drop table if exists stb1_0")
......
......@@ -66,11 +66,11 @@ class TwoClients:
# new db ,new super tables , child tables, and insert data
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f tsdb/insertDataDb1.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb1.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f tsdb/insertDataDb2.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f tsdb/insertDataDb2Newstab.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2Newstab.json -y " % binPath)
# new general tables and modify general tables;
tdSql.execute("use db2")
......
......@@ -65,11 +65,11 @@ class TwoClients:
# new db ,new super tables , child tables, and insert data
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f tsdb/insertDataDb1Replica2.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb1Replica2.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f tsdb/insertDataDb2Replica2.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2Replica2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f tsdb/insertDataDb2NewstabReplica2.json -y " % binPath)
os.system("%staosBenchmark -f tsdb/insertDataDb2NewstabReplica2.json -y " % binPath)
# new general tables and modify general tables;
tdSql.execute("use db2")
......
......@@ -61,11 +61,11 @@ class TDTestCase:
os.system("rm -rf %s/sim/dnode1/data/mnode_tmp/" % testPath)
os.system("rm -rf %s/sim/dnode1/data/mnode_bak/" % testPath)
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f wal/insertDataDb1.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb1.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f wal/insertDataDb2.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f wal/insertDataDb2Newstab.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2Newstab.json -y " % binPath)
query_pid1 = int(subprocess.getstatusoutput('ps aux|grep taosd |grep -v "grep"|awk \'{print $2}\'')[1])
print(query_pid1)
tdSql.execute("use db2")
......
......@@ -66,11 +66,11 @@ class TwoClients:
os.system("rm -rf /var/lib/taos/mnode_bak/")
os.system("rm -rf /var/lib/taos/mnode_temp/")
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f wal/insertDataDb1.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb1.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f wal/insertDataDb2.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f wal/insertDataDb2Newstab.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2Newstab.json -y " % binPath)
query_pid1 = int(subprocess.getstatusoutput('ps aux|grep taosd |grep -v "grep"|awk \'{print $2}\'')[1])
print(query_pid1)
tdSql.execute("use db2")
......
......@@ -66,11 +66,11 @@ class TwoClients:
os.system("rm -rf /var/lib/taos/mnode_bak/")
os.system("rm -rf /var/lib/taos/mnode_temp/")
tdSql.execute("drop database if exists db2")
os.system("%staosdemo -f wal/insertDataDb1Replica2.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb1Replica2.json -y " % binPath)
tdSql.execute("drop database if exists db1")
os.system("%staosdemo -f wal/insertDataDb2Replica2.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2Replica2.json -y " % binPath)
tdSql.execute("drop table if exists db2.stb0")
os.system("%staosdemo -f wal/insertDataDb2NewstabReplica2.json -y " % binPath)
os.system("%staosBenchmark -f wal/insertDataDb2NewstabReplica2.json -y " % binPath)
query_pid1 = int(subprocess.getstatusoutput('ps aux|grep taosd |grep -v "grep"|awk \'{print $2}\'')[1])
print(query_pid1)
tdSql.execute("use db2")
......
......@@ -419,12 +419,14 @@ if $data03 != @20-09-15 00:00:00.000@ then
return -1
endi
sql_error select diff(val) from (select c1 val from nest_tb0);
sql select diff(val) from (select ts,c1 val from nest_tb0);
if $rows != 9999 then
return -1
endi
if $data00 != @70-01-01 08:00:00.000@ then
if $data00 != @20-09-15 00:01:00.000@ then
return -1
endi
......
......@@ -31,6 +31,8 @@ $tsu = $tsu + $ts0
#sql_error select top(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
#sql_error select bottom(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
sql_error select t1 from $stb slimit 5 offset 1;
### select from stb + group by + slimit offset
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 slimit 5 soffset 0
if $rows != 5 then
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
ret = tdSql.execute('create table tb (ts timestamp, speed int)')
insertRows = 10
tdLog.info("insert %d rows" % (insertRows))
for i in range(0, insertRows):
ret = tdSql.execute(
'insert into tb values (now + %dm, %d)' %
(i, i))
tdLog.info("insert earlier data")
tdSql.execute('insert into tb values (now - 5m , 10)')
tdSql.execute('insert into tb values (now - 6m , 10)')
tdSql.execute('insert into tb values (now - 7m , 10)')
tdSql.execute('insert into tb values (now - 8m , 10)')
tdSql.query("select * from tb")
tdSql.checkRows(insertRows + 4)
# test case for https://jira.taosdata.com:18080/browse/TD-3716:
tdSql.error("insert into tb(now, 1)")
# test case for TD-10717
tdSql.error("insert into tb values(now,1),,(now+1s,1)")
tdSql.execute("insert into tb values(now+2s,1),(now+3s,1),(now+4s,1)")
tdSql.query("select * from tb")
tdSql.checkRows(insertRows + 4 +3)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
python3 test.py -f 1-insert/0-sql/basic.py
\ No newline at end of file
#!/usr/bin/python
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# install pip
# pip install src/connector/python/
# -*- coding: utf-8 -*-
import sys
import getopt
import subprocess
import time
from distutils.log import warn as printf
from fabric2 import Connection
sys.path.append("../pytest")
from util.log import *
from util.dnodes import *
from util.cases import *
import taos
if __name__ == "__main__":
fileName = "all"
deployPath = ""
masterIp = ""
testCluster = False
valgrind = 0
logSql = True
stop = 0
restart = False
windows = 0
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrw', [
'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help', 'windows'])
for key, value in opts:
if key in ['-h', '--help']:
tdLog.printNoPrefix(
'A collection of test cases written using Python')
tdLog.printNoPrefix('-f Name of test case file written by Python')
tdLog.printNoPrefix('-p Deploy Path for Simulator')
tdLog.printNoPrefix('-m Master Ip for Simulator')
tdLog.printNoPrefix('-l <True:False> logSql Flag')
tdLog.printNoPrefix('-s stop All dnodes')
tdLog.printNoPrefix('-c Test Cluster Flag')
tdLog.printNoPrefix('-g valgrind Test Flag')
tdLog.printNoPrefix('-r taosd restart test')
tdLog.printNoPrefix('-w taos on windows')
sys.exit(0)
if key in ['-r', '--restart']:
restart = True
if key in ['-f', '--file']:
fileName = value
if key in ['-p', '--path']:
deployPath = value
if key in ['-m', '--master']:
masterIp = value
if key in ['-l', '--logSql']:
if (value.upper() == "TRUE"):
logSql = True
elif (value.upper() == "FALSE"):
logSql = False
else:
tdLog.printNoPrefix("logSql value %s is invalid" % logSql)
sys.exit(0)
if key in ['-c', '--cluster']:
testCluster = True
if key in ['-g', '--valgrind']:
valgrind = 1
if key in ['-s', '--stop']:
stop = 1
if key in ['-w', '--windows']:
windows = 1
if (stop != 0):
if (valgrind == 0):
toBeKilled = "taosd"
else:
toBeKilled = "valgrind.bin"
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -TERM > /dev/null 2>&1" % toBeKilled
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
processID = subprocess.check_output(psCmd, shell=True)
while(processID):
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(psCmd, shell=True)
for port in range(6030, 6041):
usePortPID = "lsof -i tcp:%d | grep LISTEn | awk '{print $2}'" % port
processID = subprocess.check_output(usePortPID, shell=True)
if processID:
killCmd = "kill -TERM %s" % processID
os.system(killCmd)
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if valgrind:
time.sleep(2)
tdLog.info('stop All dnodes')
if masterIp == "":
host = '127.0.0.1'
else:
host = masterIp
tdLog.info("Procedures for tdengine deployed in %s" % (host))
if windows:
tdCases.logSql(logSql)
tdLog.info("Procedures for testing self-deployment")
td_clinet = TDSimClient("C:\\TDengine")
td_clinet.deploy()
remote_conn = Connection("root@%s"%host)
with remote_conn.cd('/var/lib/jenkins/workspace/TDinternal/community/tests/pytest'):
remote_conn.run("python3 ./test.py")
conn = taos.connect(
host="%s"%(host),
config=td_clinet.cfgDir)
tdCases.runOneWindows(conn, fileName)
else:
tdDnodes.init(deployPath)
tdDnodes.setTestCluster(testCluster)
tdDnodes.setValgrind(valgrind)
tdDnodes.stopAll()
is_test_framework = 0
key_word = 'tdCases.addLinux'
try:
if key_word in open(fileName).read():
is_test_framework = 1
except:
pass
if is_test_framework:
moduleName = fileName.replace(".py", "").replace("/", ".")
uModule = importlib.import_module(moduleName)
try:
ucase = uModule.TDTestCase()
tdDnodes.deploy(1,ucase.updatecfgDict)
except :
tdDnodes.deploy(1,{})
else:
pass
tdDnodes.deploy(1,{})
tdDnodes.start(1)
tdCases.logSql(logSql)
if testCluster:
tdLog.info("Procedures for testing cluster")
if fileName == "all":
tdCases.runAllCluster()
else:
tdCases.runOneCluster(fileName)
else:
tdLog.info("Procedures for testing self-deployment")
conn = taos.connect(
host,
config=tdDnodes.getSimCfgPath())
if fileName == "all":
tdCases.runAllLinux(conn)
else:
tdCases.runOneWindows(conn, fileName)
if restart:
if fileName == "all":
tdLog.info("not need to query ")
else:
sp = fileName.rsplit(".", 1)
if len(sp) == 2 and sp[1] == "py":
tdDnodes.stopAll()
tdDnodes.start(1)
time.sleep(1)
conn = taos.connect( host, config=tdDnodes.getSimCfgPath())
tdLog.info("Procedures for tdengine deployed in %s" % (host))
tdLog.info("query test after taosd restart")
tdCases.runOneLinux(conn, sp[0] + "_" + "restart.py")
else:
tdLog.info("not need to query")
conn.close()
......@@ -158,7 +158,13 @@ function runPyCaseOneByOne {
}
function runPyCaseOneByOnefq() {
cd $tests_dir/pytest
if [[ $3 =~ system ]] ; then
cd $tests_dir/system-test
elif [[ $3 =~ develop ]] ; then
cd $tests_dir/develop-test
else
cd $tests_dir/pytest
fi
if [[ $1 =~ full ]] ; then
start=1
end=`sed -n '$=' fulltest.sh`
......@@ -361,6 +367,12 @@ if [ "$2" != "sim" ] && [ "$2" != "jdbc" ] && [ "$2" != "unit" ] && [ "$2" != "
elif [ "$1" == "p4" ]; then
echo "### run Python_4 test ###"
runPyCaseOneByOnefq p4 1
elif [ "$1" == "system-test" ]; then
echo "### run system-test test ###"
runPyCaseOneByOnefq full 1 system
elif [ "$1" == "develop-test" ]; then
echo "### run develop-test test ###"
runPyCaseOneByOnefq full 1 develop
elif [ "$1" == "b2" ] || [ "$1" == "b3" ]; then
exit $(($totalFailed + $totalPyFailed))
elif [ "$1" == "smoke" ] || [ -z "$1" ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册