fix: replace getPath with etools function

This commit is contained in:
Alex Duan 2024-12-23 20:50:24 +08:00
parent 7a961f1d1f
commit 5cb8a5de3c
127 changed files with 1100 additions and 3836 deletions

View File

@ -23,12 +23,23 @@ import frame.epath
import frame.eos import frame.eos
from frame.log import * from frame.log import *
# run taosBenchmark with command or json file mode def taosDumpFile():
def benchMark(command = "", json = "") : bmFile = frame.epath.binFile("taosdump")
# get taosBenchmark path if frame.eos.isWin():
bmFile += ".exe"
return bmFile
def benchMarkFile():
bmFile = frame.epath.binFile("taosBenchmark") bmFile = frame.epath.binFile("taosBenchmark")
if frame.eos.isWin(): if frame.eos.isWin():
bmFile += ".exe" bmFile += ".exe"
return bmFile
# run taosBenchmark with command or json file mode
def benchMark(command = "", json = "") :
# get taosBenchmark path
bmFile = benchMarkFile()
# run # run
if command != "": if command != "":

View File

@ -12,10 +12,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import json import json
from util.log import *
from util.cases import * import frame
from util.sql import * import frame.etool
from util.dnodes import * from frame.log import *
from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
# reomve single and double quotation # reomve single and double quotation
@ -27,42 +31,12 @@ def removeQuotation(origin):
return value return value
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def testBenchmarkJson(self, benchmark, jsonFile, options="", checkStep=False): def testBenchmarkJson(self, benchmark, jsonFile, options="", checkStep=False):
# exe insert # exe insert
cmd = f"{benchmark} {options} -f {jsonFile}" cmd = f"{benchmark} {options} -f {jsonFile}"
@ -132,33 +106,33 @@ class TDTestCase:
# bugs ts # bugs ts
def bugsTS(self, benchmark): def bugsTS(self, benchmark):
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TS-5002.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TS-5002.json")
# TS-5234 # TS-5234
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TS-5234-1.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TS-5234-1.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TS-5234-2.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TS-5234-2.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TS-5234-3.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TS-5234-3.json")
# bugs td # bugs td
def bugsTD(self, benchmark): def bugsTD(self, benchmark):
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-31490.json", checkStep = False) self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-31490.json", checkStep = False)
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-31575.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-31575.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-32846.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-32846.json")
# no drop # no drop
db = "td32913db" db = "td32913db"
vgroups = 4 vgroups = 4
tdSql.execute(f"create database {db} vgroups {vgroups}") tdSql.execute(f"create database {db} vgroups {vgroups}")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-32913.json", options="-Q") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-32913.json", options="-Q")
tdSql.query(f"select `vgroups` from information_schema.ins_databases where name='{db}';") tdSql.query(f"select `vgroups` from information_schema.ins_databases where name='{db}';")
tdSql.checkData(0, 0, vgroups) tdSql.checkData(0, 0, vgroups)
# other # other
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-32913-1.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-32913-1.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-32913-2.json", options="-T 6") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-32913-2.json", options="-T 6")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/TD-32913-3.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/TD-32913-3.json")
def run(self): def run(self):
benchmark = self.getPath() benchmark = etool.benchMarkFile()
# ts # ts
self.bugsTS(benchmark) self.bugsTS(benchmark)

View File

@ -12,50 +12,23 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19387] taosBenchmark support partial columns num [TD-19387] taosBenchmark support partial columns num
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 1 -n 1 -y -L 2 " % binPath cmd = "%s -t 1 -n 1 -y -L 2 " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -13,50 +13,25 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19985] taosBenchmark retry test cases [TD-19985] taosBenchmark retry test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -t 1 -n 10 -i 1000 -r 1 -k 10 -z 1000 -y &" "%s -t 1 -n 10 -i 1000 -r 1 -k 10 -z 1000 -y &"
# "%s -t 1 -n 10 -i 5000 -r 1 -y &" # "%s -t 1 -n 10 -i 5000 -r 1 -y &"

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21063] taosBenchmark single table test cases [TD-21063] taosBenchmark single table test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -N -I taosc -t 1 -n 1 -y -E" % binPath cmd = "%s -N -I taosc -t 1 -n 1 -y -E" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -12,51 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
def getPath(tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath: class TDTestCase(TBase):
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
class TDTestCase:
def caseDescription(self): def caseDescription(self):
""" """
[TD-22334] taosBenchmark sml rest test cases [TD-22334] taosBenchmark sml rest test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
binPath = getPath() binPath = etool.benchMarkFile()
cmd = "%s -I sml-rest -t 1 -n 1 -y" % binPath cmd = "%s -I sml-rest -t 1 -n 1 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -13,13 +13,16 @@
import os import os
import time import time
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
def getPath(tool="taosBenchmark"): def etool.benchMarkFile()
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath: if "community" in selfPath:
@ -46,15 +49,12 @@ def getPath(tool="taosBenchmark"):
return paths[0] return paths[0]
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21932] taosBenchmark sml test cases [TD-21932] taosBenchmark sml test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
binPath = getPath() binPath = getPath()

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19352] taosBenchmark supplement insert test cases [TD-19352] taosBenchmark supplement insert test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 1 -n 1 -y" % binPath cmd = "%s -t 1 -n 1 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21806] taosBenchmark specifying vgroups test cases [TD-21806] taosBenchmark specifying vgroups test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -t 1 -n 1 -v 3 -y &" "%s -t 1 -n 1 -v 3 -y &"
% binPath % binPath

View File

@ -13,50 +13,25 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -F 7 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%%^*" "%s -F 7 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%%^*"
% binPath % binPath

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-13928] taosBenchmark improve user interface [TD-13928] taosBenchmark improve user interface
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/custom_col_tag.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/custom_col_tag.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/default.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/default.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -13,59 +13,34 @@
# import os, signal # import os, signal
import os import os
from time import sleep from time import sleep
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.execute("drop topic if exists topic_0") tdSql.execute("drop topic if exists topic_0")
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/default.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/default.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
tdSql.execute("alter database db WAL_RETENTION_PERIOD 3600000") tdSql.execute("alter database db WAL_RETENTION_PERIOD 3600000")
cmd = "%s -f ./taosbenchmark/json/tmq.json " % binPath cmd = "%s -f ./tools/benchmark/basic/json/tmq.json " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
sleep(15) sleep(15)

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-13823] taosBenchmark test cases [TD-13823] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -n 100 -t 100 -y" % binPath cmd = "%s -n 100 -t 100 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -14,10 +14,13 @@ import os
import json import json
import csv import csv
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
# reomve single and double quotation # reomve single and double quotation
@ -29,41 +32,13 @@ def removeQuotation(origin):
return value return value
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
# check correct # check correct
def checkCorrect(self, csvFile, allRows, interlaceRows): def checkCorrect(self, csvFile, allRows, interlaceRows):
@ -132,7 +107,7 @@ class TDTestCase:
def run(self): def run(self):
# path # path
benchmark = self.getPath() benchmark = etool.benchMarkFile()
# do check # do check
json = "taosbenchmark/json/exportCsv.json" json = "taosbenchmark/json/exportCsv.json"

View File

@ -12,81 +12,56 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-20424] taosBenchmark insert child table from and to test cases [TD-20424] taosBenchmark insert child table from and to test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 6 -n 1 -y" % binPath cmd = "%s -t 6 -n 1 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
cmd = "%s -f ./taosbenchmark/json/insert-from-to-continue-no.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/insert-from-to-continue-no.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 6 + 3) tdSql.checkData(0, 0, 6 + 3)
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 5 -n 1 -y" % binPath cmd = "%s -t 5 -n 1 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("use test") tdSql.execute("use test")
tdSql.execute("create table d5 using meters tags (4, 'd5')") tdSql.execute("create table d5 using meters tags (4, 'd5')")
cmd = "%s -f ./taosbenchmark/json/insert-from-to-continue-yes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/insert-from-to-continue-yes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 5 + 3) tdSql.checkData(0, 0, 5 + 3)
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 4 -n 1 -y" % binPath cmd = "%s -t 4 -n 1 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("use test") tdSql.execute("use test")
tdSql.execute("create table d4 using meters tags (4, 'd4')") tdSql.execute("create table d4 using meters tags (4, 'd4')")
cmd = "%s -f ./taosbenchmark/json/insert-from-to-continue-smart.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/insert-from-to-continue-smart.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")

View File

@ -12,56 +12,29 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-22157] taosBenchmark insert child table from and to test cases [TD-22157] taosBenchmark insert child table from and to test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/from-to.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/from-to.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")

View File

@ -13,52 +13,27 @@
import os import os
import time import time
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
now = time.time() now = time.time()
self.ts = int(round(now * 1000)) self.ts = int(round(now * 1000))
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath("taosBenchmark") binPath = etool.benchMarkFile()
if binPath == "": if binPath == "":
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
else: else:
@ -66,7 +41,7 @@ class TDTestCase:
# insert: create one or multiple tables per sql and insert multiple rows per sql # insert: create one or multiple tables per sql and insert multiple rows per sql
# test case for https://jira.taosdata.com:18080/browse/TD-4985 # test case for https://jira.taosdata.com:18080/browse/TD-4985
os.system("%s -f ./taosbenchmark/json/insert-json-csv.json -y " % binPath) os.system("%s -f ./tools/benchmark/basic/json/insert-json-csv.json -y " % binPath)
tdSql.execute("use db") tdSql.execute("use db")
if major_ver == "3": if major_ver == "3":

View File

@ -11,50 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -F abc -P abc -I abc -T abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y" "%s -F abc -P abc -I abc -T abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y"
% binPath % binPath

View File

@ -47,7 +47,7 @@
"timestamp_step": 0, "timestamp_step": 0,
"start_timestamp": "2020-1-1 0:0:0", "start_timestamp": "2020-1-1 0:0:0",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/TD-31490.csv", "sample_file": "./tools/benchmark/basic/csv/TD-31490.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "", "tags_file": "",
"columns": [ "columns": [

View File

@ -49,7 +49,7 @@
"disorder_range": 0, "disorder_range": 0,
"timestamp_step": 900000, "timestamp_step": 900000,
"start_timestamp": "2024-6-01 0:0:0", "start_timestamp": "2024-6-01 0:0:0",
"tags_file": "./taosbenchmark/csv/TS-5002.csv", "tags_file": "./tools/benchmark/basic/csv/TS-5002.csv",
"columns": [ "columns": [
{ {
"type": "FLOAT", "type": "FLOAT",

View File

@ -40,7 +40,7 @@
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "2022-10-01 00:00:00.000", "start_timestamp": "2022-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/insert-json-csv.csv", "sample_file": "./tools/benchmark/basic/csv/insert-json-csv.csv",
"columns": [{"type": "INT","count":2}, {"type": "BINARY", "len": 16, "count":1}], "columns": [{"type": "INT","count":2}, {"type": "BINARY", "len": 16, "count":1}],
"tags": [{"type": "INT", "count":2}, {"type": "BINARY", "len": 16, "count":1}] "tags": [{"type": "INT", "count":2}, {"type": "BINARY", "len": 16, "count":1}]
}] }]

View File

@ -40,7 +40,7 @@
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/sample_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}], "columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}],
@ -68,7 +68,7 @@
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "./taosbenchmark/csv/sample_ts_stmt_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_ts_stmt_tags.csv",
"columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}], "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}],
"tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}] "tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}]
}] }]

View File

@ -40,7 +40,7 @@
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/sample_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}], "columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}],
@ -67,8 +67,8 @@
"timestamp_step": 10, "timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/sample.csv", "sample_file": "./tools/benchmark/basic/csv/sample.csv",
"tags_file": "./taosbenchmark/csv/tags.csv", "tags_file": "./tools/benchmark/basic/csv/tags.csv",
"columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}], "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}],
"tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}] "tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}]
}] }]

View File

@ -52,7 +52,7 @@
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/sample.csv", "sample_file": "./tools/benchmark/basic/csv/sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}], "columns": [{"type": "INT", "count":3}, {"type": "DOUBLE", "count":3}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}, {"type": "BOOL"}],
"tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}]
@ -78,8 +78,8 @@
"timestamp_step": 10, "timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/sample.csv", "sample_file": "./tools/benchmark/basic/csv/sample.csv",
"tags_file": "./taosbenchmark/csv/tags.csv", "tags_file": "./tools/benchmark/basic/csv/tags.csv",
"columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}], "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}],
"tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}] "tags": [{"type": "TINYINT", "count":3}, {"type": "BINARY", "len": 16, "count":2}]
}] }]

View File

@ -31,7 +31,7 @@
"start_timestamp":1700000000000, "start_timestamp":1700000000000,
"auto_create_table": "no", "auto_create_table": "no",
"data_source": "sample", "data_source": "sample",
"sample_file": "./taosbenchmark/csv/d0.csv", "sample_file": "./tools/benchmark/basic/csv/d0.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"columns": [ "columns": [
{"type": "FLOAT", "name": "current", "count": 1, "max": 12, "min": 8 }, {"type": "FLOAT", "name": "current", "count": 1, "max": 12, "min": 8 },

View File

@ -31,7 +31,7 @@
"start_timestamp":1700000000000, "start_timestamp":1700000000000,
"auto_create_table": "yes", "auto_create_table": "yes",
"data_source": "sample", "data_source": "sample",
"sample_file": "./taosbenchmark/csv/d0.csv", "sample_file": "./tools/benchmark/basic/csv/d0.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"columns": [ "columns": [
{"type": "FLOAT", "name": "current", "count": 1, "max": 12, "min": 8 }, {"type": "FLOAT", "name": "current", "count": 1, "max": 12, "min": 8 },

View File

@ -39,9 +39,9 @@
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "now", "start_timestamp": "now",
"sample_file": "./taosbenchmark/csv/sample_no_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_no_ts.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "./taosbenchmark/csv/sample_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_tags.csv",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT"}] "tags": [{"type": "INT"}]
}] }]

View File

@ -24,7 +24,7 @@
"child_table_exists":"no", "child_table_exists":"no",
"childtable_count": 8, "childtable_count": 8,
"childtable_prefix": "stb", "childtable_prefix": "stb",
"childtable_sample_file": "./taosbenchmark/csv/sample_use_ts-XXXX.csv", "childtable_sample_file": "./tools/benchmark/basic/csv/sample_use_ts-XXXX.csv",
"escape_character": "no", "escape_character": "no",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 10, "batch_create_tbl_num": 10,
@ -39,9 +39,9 @@
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "now", "start_timestamp": "now",
"sample_file": "./taosbenchmark/csv/sample_use_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_use_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "./taosbenchmark/csv/sample_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_tags.csv",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT"}] "tags": [{"type": "INT"}]
}] }]

View File

@ -39,9 +39,9 @@
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "now", "start_timestamp": "now",
"sample_file": "./taosbenchmark/csv/sample_use_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_use_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "./taosbenchmark/csv/sample_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_tags.csv",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT"}] "tags": [{"type": "INT"}]
}] }]

View File

@ -14,7 +14,7 @@
{ {
"query_interval": 1, "query_interval": 1,
"concurrent":1, "concurrent":1,
"sql_file": "./taosbenchmark/json/query-error-sqls.txt", "sql_file": "./tools/benchmark/basic/json/query-error-sqls.txt",
"result": "taosc_query_specified-sqlfile" "result": "taosc_query_specified-sqlfile"
} }
} }

View File

@ -14,6 +14,6 @@
"specified_table_query": { "specified_table_query": {
"query_interval": 3, "query_interval": 3,
"concurrent": 3, "concurrent": 3,
"sql_file": "./taosbenchmark/json/query-sqls-slow-query.txt" "sql_file": "./tools/benchmark/basic/json/query-sqls-slow-query.txt"
} }
} }

View File

@ -13,7 +13,7 @@
{ {
"query_interval": 1, "query_interval": 1,
"concurrent":1, "concurrent":1,
"sql_file": "./taosbenchmark/json/query-sqls.txt", "sql_file": "./tools/benchmark/basic/json/query-sqls.txt",
"result": "taosc_query_specified-sqlfile" "result": "taosc_query_specified-sqlfile"
} }
} }

View File

@ -24,7 +24,7 @@
"child_table_exists":"no", "child_table_exists":"no",
"childtable_count": 8, "childtable_count": 8,
"childtable_prefix": "stb", "childtable_prefix": "stb",
"childtable_sample_file": "./taosbenchmark/csv/sample_use_ts-XXXX.csv", "childtable_sample_file": "./tools/benchmark/basic/csv/sample_use_ts-XXXX.csv",
"escape_character": "no", "escape_character": "no",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 10, "batch_create_tbl_num": 10,
@ -39,9 +39,9 @@
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "now", "start_timestamp": "now",
"sample_file": "./taosbenchmark/csv/sample_use_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_use_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "./taosbenchmark/csv/sample_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_tags.csv",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT"}] "tags": [{"type": "INT"}]
}] }]

View File

@ -39,9 +39,9 @@
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 1, "timestamp_step": 1,
"start_timestamp": "now", "start_timestamp": "now",
"sample_file": "./taosbenchmark/csv/sample_use_ts.csv", "sample_file": "./tools/benchmark/basic/csv/sample_use_ts.csv",
"use_sample_ts": "yes", "use_sample_ts": "yes",
"tags_file": "./taosbenchmark/csv/sample_tags.csv", "tags_file": "./tools/benchmark/basic/csv/sample_tags.csv",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT"}] "tags": [{"type": "INT"}]
}] }]

View File

@ -50,8 +50,8 @@
"timestamp_step": 10000000, "timestamp_step": 10000000,
"start_timestamp": "2021-07-01 00:00:00.000", "start_timestamp": "2021-07-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/nano_samples.csv", "sample_file": "./tools/benchmark/basic/csv/nano_samples.csv",
"tags_file": "./taosbenchmark/csv/nano_sampletags.csv", "tags_file": "./tools/benchmark/basic/csv/nano_sampletags.csv",
"columns": [{"type": "DOUBLE"}, {"type": "BINARY", "len": 64, "count":1}, {"type": "TIMESTAMP", "count":1}], "columns": [{"type": "DOUBLE"}, {"type": "BINARY", "len": 64, "count":1}, {"type": "TIMESTAMP", "count":1}],
"tags": [{"type": "BINARY", "len": 16, "count":1},{"type": "INT"},{"type": "DOUBLE"}] "tags": [{"type": "BINARY", "len": 16, "count":1},{"type": "INT"},{"type": "DOUBLE"}]
}, },
@ -74,8 +74,8 @@
"timestamp_step": 10000000, "timestamp_step": 10000000,
"start_timestamp": "2021-07-01 00:00:00.000", "start_timestamp": "2021-07-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./taosbenchmark/csv/nano_samples.csv", "sample_file": "./tools/benchmark/basic/csv/nano_samples.csv",
"tags_file": "./taosbenchmark/csv/nano_sampletags.csv", "tags_file": "./tools/benchmark/basic/csv/nano_sampletags.csv",
"columns": [{"type": "DOUBLE"}, {"type": "BINARY", "len": 64, "count":1}, {"type": "TIMESTAMP", "count":1}], "columns": [{"type": "DOUBLE"}, {"type": "BINARY", "len": 64, "count":1}, {"type": "TIMESTAMP", "count":1}],
"tags": [{"type": "BINARY", "len": 16, "count":1},{"type": "INT"},{"type": "DOUBLE"}] "tags": [{"type": "BINARY", "len": 16, "count":1},{"type": "INT"},{"type": "DOUBLE"}]
}] }]

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_json_tag.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_json_tag.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_only_create_table.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_only_create_table.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
@ -86,7 +61,7 @@ class TDTestCase:
tdSql.checkData(23, 2, 64) tdSql.checkData(23, 2, 64)
tdSql.checkData(28, 2, 64) tdSql.checkData(28, 2, 64)
cmd = "%s -f ./taosbenchmark/json/taosc_limit_offset.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_limit_offset.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -13,53 +13,25 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("Cannot find %s in path: %s" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -b binary,nchar,binary,nchar,binary,nchar,binary,nchar,binary,nchar,binary,nchar -t 2 -n 50000 -I stmt -y > /dev/null" "%s -b binary,nchar,binary,nchar,binary,nchar,binary,nchar,binary,nchar,binary,nchar -t 2 -n 50000 -I stmt -y > /dev/null"
@ -72,7 +44,7 @@ class TDTestCase:
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
cmd = "%s -f ./taosbenchmark/json/taosc_query-kill-slow-query.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_query-kill-slow-query.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
output = subprocess.check_output(cmd, shell=True).decode("utf-8") output = subprocess.check_output(cmd, shell=True).decode("utf-8")
if "KILL QUERY" not in output: if "KILL QUERY" not in output:

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
os.system( os.system(
"rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0" "rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0"
) )
@ -66,7 +41,7 @@ class TDTestCase:
tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)")
tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)") tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)")
tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)")
cmd = "%s -f ./taosbenchmark/json/taosc_query-error-sqlfile.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_query-error-sqlfile.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -12,50 +12,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
os.system( os.system(
"rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0" "rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0"
) )
@ -66,7 +41,7 @@ class TDTestCase:
tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)")
tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)") tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)")
tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)")
cmd = "%s -f ./taosbenchmark/json/taosc_query-sqlfile.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_query-sqlfile.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -14,53 +14,25 @@ import ast
import os import os
import re import re
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("Cannot find %s in path: %s" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
os.system( os.system(
"rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0" "rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0"
) )
@ -71,7 +43,7 @@ class TDTestCase:
tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)")
tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)") tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)")
tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)")
cmd = "%s -f ./taosbenchmark/json/taosc_query.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_query.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
with open("%s" % "taosc_query_specified-0", "r+") as f1: with open("%s" % "taosc_query_specified-0", "r+") as f1:
@ -84,7 +56,7 @@ class TDTestCase:
queryTaosc = line.strip().split()[0] queryTaosc = line.strip().split()[0]
assert queryTaosc == "1", "result is %s != expect: 1" % queryTaosc assert queryTaosc == "1", "result is %s != expect: 1" % queryTaosc
cmd = "%s -f ./taosbenchmark/json/rest_query.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/rest_query.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -11,53 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/rest_insert_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/rest_insert_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")

View File

@ -12,64 +12,36 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-22190] taosBenchmark reuse exist stb test cases [TD-22190] taosBenchmark reuse exist stb test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("Cannot find %s in path: %s" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")
tdSql.execute("create database if not exists db") tdSql.execute("create database if not exists db")
tdSql.execute("use db") tdSql.execute("use db")
tdSql.execute("create table stb (ts timestamp, c0 int) tags (t0 int)") tdSql.execute("create table stb (ts timestamp, c0 int) tags (t0 int)")
tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)")
# sys.exit(0) # sys.exit(0)
cmd = "%s -f ./taosbenchmark/json/reuse-exist-stb.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/reuse-exist-stb.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.new_0") tdSql.query("select count(*) from db.new_0")

View File

@ -11,52 +11,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_auto_create_table.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_auto_create_table.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,53 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_insert_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_insert_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")

View File

@ -11,58 +11,28 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_interlace.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_interlace.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,58 +11,28 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21932] taosBenchmark schemaless refine [TD-21932] taosBenchmark schemaless refine
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_json_alltypes-interlace.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_json_alltypes-interlace.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,58 +11,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_json_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_json_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,60 +11,29 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-23292] taosBenchmark test cases [TD-23292] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/sml_json_insert_alltypes-same-min-max.json" "%s -f ./tools/benchmark/basic/json/sml_json_insert_alltypes-same-min-max.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,13 +11,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
def getPath(tool="taosBenchmark"): def etool.benchMarkFile()
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath: if "community" in selfPath:
@ -47,15 +50,12 @@ def getPath(tool="taosBenchmark"):
return paths[0] return paths[0]
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21932] taosBenchmark sml test cases [TD-21932] taosBenchmark sml test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
@ -63,7 +63,7 @@ class TDTestCase:
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = getPath() binPath = getPath()
cmd = "%s -f ./taosbenchmark/json/sml_taosjson_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_taosjson_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,56 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-23292] taosBenchmark test cases [TD-23292] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/sml_taosjson_insert_alltypes-same-min-max.json" "%s -f ./tools/benchmark/basic/json/sml_taosjson_insert_alltypes-same-min-max.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,58 +11,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_telnet_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_telnet_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,60 +11,29 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-23292] taosBenchmark test cases [TD-23292] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/sml_telnet_insert_alltypes-same-min-max.json" "%s -f ./tools/benchmark/basic/json/sml_telnet_insert_alltypes-same-min-max.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -12,47 +12,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import json import json
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def testBenchmarkJson(self, benchmark, jsonFile): def testBenchmarkJson(self, benchmark, jsonFile):
# exe insert # exe insert
@ -85,17 +60,17 @@ class TDTestCase:
def run(self): def run(self):
benchmark = self.getPath() benchmark = etool.benchMarkFile()
''' stmt2 engine have some problem ''' stmt2 engine have some problem
# batch - auto-create-table(yes or no) # batch - auto-create-table(yes or no)
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_batch_autoctb_yes.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_batch_autoctb_yes.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_batch_autoctb_no.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_batch_autoctb_no.json")
# interlace - auto-create-table(yes or no) # interlace - auto-create-table(yes or no)
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_interlace_autoctb_yes.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_interlace_autoctb_yes.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_interlace_autoctb_no.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_interlace_autoctb_no.json")
# csv - (batch or interlace) # csv - (batch or interlace)
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_csv_interlace_autoctb_yes.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_csv_interlace_autoctb_yes.json")
self.testBenchmarkJson(benchmark, "./taosbenchmark/json/stmt2_insert_csv_batch_autoctb_no.json") self.testBenchmarkJson(benchmark, "./tools/benchmark/basic/json/stmt2_insert_csv_batch_autoctb_no.json")
''' '''

View File

@ -11,52 +11,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stmt_auto_create_table.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_auto_create_table.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,56 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-23292] taosBenchmark test cases [TD-23292] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/stmt_insert_alltypes-same-min-max.json" "%s -f ./tools/benchmark/basic/json/stmt_insert_alltypes-same-min-max.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,52 +11,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stmt_insert_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_insert_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TS-3060] taosBenchmark test cases [TS-3060] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_only_create_table.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_only_create_table.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
@ -86,7 +61,7 @@ class TDTestCase:
tdSql.checkData(23, 2, 64) tdSql.checkData(23, 2, 64)
tdSql.checkData(28, 2, 64) tdSql.checkData(28, 2, 64)
cmd = "%s -f ./taosbenchmark/json/stmt_limit_offset.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_limit_offset.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stmt_sample_use_ts-subtable.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_sample_use_ts-subtable.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stmt_sample_use_ts.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_sample_use_ts.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stmt_sample_doesnt_use_ts.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stmt_sample_doesnt_use_ts.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21047] taosBenchmark stream test cases [TD-21047] taosBenchmark stream test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stream-test.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stream-test.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,54 +11,29 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-21047] taosBenchmark stream test cases [TD-21047] taosBenchmark stream test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/stream_exist_stb_tag_prepare.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/stream_exist_stb_tag_prepare.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
cmd = "%s -f ./taosbenchmark/json/stream_exist_stb_tag_insert_partition.json " % binPath cmd = "%s -f ./tools/benchmark/basic/json/stream_exist_stb_tag_insert_partition.json " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,50 +11,24 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_rest_telnet.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_rest_telnet.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
@ -66,7 +40,7 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb2") tdSql.query("select count(*) from db.stb2")
tdSql.checkData(0, 0, 160) tdSql.checkData(0, 0, 160)
cmd = "%s -f ./taosbenchmark/json/sml_rest_line.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_rest_line.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
@ -78,7 +52,7 @@ class TDTestCase:
tdSql.query("select count(*) from db2.stb2") tdSql.query("select count(*) from db2.stb2")
tdSql.checkData(0, 0, 160) tdSql.checkData(0, 0, 160)
cmd = "%s -f ./taosbenchmark/json/sml_rest_json.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_rest_json.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,58 +11,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_auto_create_table.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_auto_create_table.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -13,56 +13,31 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
taosBenchmark insert mix data taosBenchmark insert mix data
""" """
@classmethod @classmethod
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
@classmethod @classmethod
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
@classmethod @classmethod
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
# mix 1 ~ 4 # mix 1 ~ 4
for i in range(4): for i in range(4):
cmd = "%s -f ./taosbenchmark/json/case-insert-mix%d.json" % (binPath, i + 1) cmd = "%s -f ./tools/benchmark/basic/json/case-insert-mix%d.json" % (binPath, i + 1)
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -13,51 +13,26 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19985] taosBenchmark retry test cases [TD-19985] taosBenchmark retry test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_insert_retry-global.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_insert_retry-global.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(2) time.sleep(2)

View File

@ -13,51 +13,26 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19985] taosBenchmark retry test cases [TD-19985] taosBenchmark retry test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_insert_retry-stb.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_insert_retry-stb.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(2) time.sleep(2)

View File

@ -13,56 +13,31 @@
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-19449] taosBenchmark creating table interval test cases [TD-19449] taosBenchmark creating table interval test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/taosc_insert_table-creating-interval.json -g 2>&1| grep sleep | wc -l" "%s -f ./tools/benchmark/basic/json/taosc_insert_table-creating-interval.json -g 2>&1| grep sleep | wc -l"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,56 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-23292] taosBenchmark test cases [TD-23292] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/taosc_insert_alltypes-same-min-max.json" "%s -f ./tools/benchmark/basic/json/taosc_insert_alltypes-same-min-max.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,56 +11,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = ( cmd = (
"%s -f ./taosbenchmark/json/taosc_insert_alltypes-partial-col.json" "%s -f ./tools/benchmark/basic/json/taosc_insert_alltypes-partial-col.json"
% binPath % binPath
) )
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)

View File

@ -11,59 +11,28 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
tdLog.info("projPath: %s" % projPath)
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_insert_alltypes.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_insert_alltypes.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_sample_use_ts-subtable.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_sample_use_ts-subtable.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -11,51 +11,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/taosc_sample_use_ts.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/taosc_sample_use_ts.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")

View File

@ -12,57 +12,32 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
# pylint: disable=R0201 # pylint: disable=R0201
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
if binPath == "": if binPath == "":
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
else: else:
tdLog.info("taosBenchmark use %s" % binPath) tdLog.info("taosBenchmark use %s" % binPath)
# insert: sample json # insert: sample json
os.system("%s -f ./taosbenchmark/json/insert-sample-ts-stmt.json -y " % binPath) os.system("%s -f ./tools/benchmark/basic/json/insert-sample-ts-stmt.json -y " % binPath)
tdSql.execute("use dbtest123") tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0") tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647) tdSql.checkData(0, 0, 2147483647)
@ -82,7 +57,7 @@ class TDTestCase:
tdSql.checkRows(10) tdSql.checkRows(10)
# insert: timestamp and step # insert: timestamp and step
os.system("%s -f ./taosbenchmark/json/insert-timestep-stmt.json -y " % binPath) os.system("%s -f ./tools/benchmark/basic/json/insert-timestep-stmt.json -y " % binPath)
tdSql.execute("use db") tdSql.execute("use db")
tdSql.query("show stables") tdSql.query("show stables")
if major_ver == "3": if major_ver == "3":
@ -106,7 +81,7 @@ class TDTestCase:
# # insert: disorder_ratio # # insert: disorder_ratio
os.system( os.system(
"%s -f ./taosbenchmark/json/insert-disorder-stmt.json 2>&1 -y " % binPath "%s -f ./tools/benchmark/basic/json/insert-disorder-stmt.json 2>&1 -y " % binPath
) )
tdSql.execute("use db") tdSql.execute("use db")
if major_ver == "3": if major_ver == "3":
@ -138,7 +113,7 @@ class TDTestCase:
# insert: test interlace parament # insert: test interlace parament
os.system( os.system(
"%s -f ./taosbenchmark/json/insert-interlace-row-stmt.json -y " % binPath "%s -f ./tools/benchmark/basic/json/insert-interlace-row-stmt.json -y " % binPath
) )
tdSql.execute("use db") tdSql.execute("use db")
if major_ver == "3": if major_ver == "3":
@ -155,7 +130,7 @@ class TDTestCase:
tdSql.execute("create database db") tdSql.execute("create database db")
tdSql.execute("use db") tdSql.execute("use db")
os.system( os.system(
"%s -y -f ./taosbenchmark/json/insert-drop-exist-auto-N00-stmt.json " "%s -y -f ./tools/benchmark/basic/json/insert-drop-exist-auto-N00-stmt.json "
% binPath % binPath
) # drop = no, child_table_exists, auto_create_table varies ) # drop = no, child_table_exists, auto_create_table varies
tdSql.execute("use db") tdSql.execute("use db")
@ -186,7 +161,7 @@ class TDTestCase:
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")
os.system( os.system(
"%s -y -f ./taosbenchmark/json/insert-drop-exist-auto-Y00-stmt.json " "%s -y -f ./tools/benchmark/basic/json/insert-drop-exist-auto-Y00-stmt.json "
% binPath % binPath
) # drop = yes, child_table_exists, auto_create_table varies ) # drop = yes, child_table_exists, auto_create_table varies
tdSql.execute("use db") tdSql.execute("use db")

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
import ast import ast
import re import re
@ -23,38 +26,10 @@ import re
import subprocess import subprocess
class TDTestCase: class TDTestCase(TBase):
# pylint: disable=R0201 # pylint: disable=R0201
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
# pylint: disable=R0201 # pylint: disable=R0201
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
# 获取taosc接口查询的结果文件中的内容,返回每行数据,并断言数据的第一列内容。 # 获取taosc接口查询的结果文件中的内容,返回每行数据,并断言数据的第一列内容。
def assertfileDataTaosc(self, filename, expectResult): def assertfileDataTaosc(self, filename, expectResult):
@ -106,7 +81,7 @@ class TDTestCase:
) )
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
if binPath == "": if binPath == "":
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
else: else:
@ -117,8 +92,8 @@ class TDTestCase:
os.system("rm -rf ./all_query*") os.system("rm -rf ./all_query*")
# taosc query: query specified table and query super table # taosc query: query specified table and query super table
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
os.system("%s -f ./taosbenchmark/json/queryTaosc-mixed-query.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryTaosc-mixed-query.json" % binPath)
os.system("cat query_res2.txt* > all_query_res2_taosc.txt") os.system("cat query_res2.txt* > all_query_res2_taosc.txt")
# correct Times testcases # correct Times testcases
@ -134,8 +109,8 @@ class TDTestCase:
os.system("rm -rf ./all_query*") os.system("rm -rf ./all_query*")
# use restful api to query # use restful api to query
os.system("%s -f ./taosbenchmark/json/queryInsertrestdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertrestdata.json" % binPath)
os.system("%s -f ./taosbenchmark/json/queryRestful.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryRestful.json" % binPath)
os.system("cat query_res2.txt* > all_query_res2_rest.txt") os.system("cat query_res2.txt* > all_query_res2_rest.txt")
# correct Times testcases # correct Times testcases
@ -154,49 +129,49 @@ class TDTestCase:
# query times less than or equal to 100 # query times less than or equal to 100
assert ( assert (
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) == 0 os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath) == 0
) )
assert ( assert (
os.system("%s -f ./taosbenchmark/json/querySpeciMutisql100.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/querySpeciMutisql100.json" % binPath)
!= 0 != 0
) )
assert ( assert (
os.system("%s -f ./taosbenchmark/json/querySuperMutisql100.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/querySuperMutisql100.json" % binPath)
== 0 == 0
) )
# query result print QPS # query result print QPS
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
exceptcode = os.system("%s -f ./taosbenchmark/json/queryQps.json" % binPath) exceptcode = os.system("%s -f ./tools/benchmark/basic/json/queryQps.json" % binPath)
assert exceptcode == 0 assert exceptcode == 0
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# use illegal or out of range parameters query json file # use illegal or out of range parameters query json file
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# exceptcode = os.system( # exceptcode = os.system(
# "%s -f ./taosbenchmark/json/queryTimes0.json" % # "%s -f ./tools/benchmark/basic/json/queryTimes0.json" %
# binPath) # binPath)
# assert exceptcode != 0 # assert exceptcode != 0
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# exceptcode0 = os.system( # exceptcode0 = os.system(
# "%s -f ./taosbenchmark/json/queryTimesless0.json" % # "%s -f ./tools/benchmark/basic/json/queryTimesless0.json" %
# binPath) # binPath)
# assert exceptcode0 != 0 # assert exceptcode0 != 0
# exceptcode1 = os.system( # exceptcode1 = os.system(
# "%s -f ./taosbenchmark/json/queryConcurrent0.json" % # "%s -f ./tools/benchmark/basic/json/queryConcurrent0.json" %
# binPath) # binPath)
# assert exceptcode2 != 0 # assert exceptcode2 != 0
# exceptcode3 = os.system( # exceptcode3 = os.system(
# "%s -f ./taosbenchmark/json/querrThreadsless0.json" % # "%s -f ./tools/benchmark/basic/json/querrThreadsless0.json" %
# binPath) # binPath)
# assert exceptcode3 != 0 # assert exceptcode3 != 0
# exceptcode4 = os.system( # exceptcode4 = os.system(
# "%s -f ./taosbenchmark/json/querrThreads0.json" % # "%s -f ./tools/benchmark/basic/json/querrThreads0.json" %
# binPath) # binPath)
# assert exceptcode4 != 0 # assert exceptcode4 != 0

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
import ast import ast
import re import re
@ -23,36 +26,8 @@ import re
import subprocess import subprocess
class TDTestCase: class TDTestCase(TBase):
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
# 获取taosc接口查询的结果文件中的内容,返回每行数据,并断言数据的第一列内容。 # 获取taosc接口查询的结果文件中的内容,返回每行数据,并断言数据的第一列内容。
def assertfileDataTaosc(self, filename, expectResult): def assertfileDataTaosc(self, filename, expectResult):
@ -104,7 +79,7 @@ class TDTestCase:
) )
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
if binPath == "": if binPath == "":
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
else: else:
@ -115,8 +90,8 @@ class TDTestCase:
os.system("rm -rf ./all_query*") os.system("rm -rf ./all_query*")
# taosc query: query specified table and query super table # taosc query: query specified table and query super table
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
os.system("%s -f ./taosbenchmark/json/queryTaosc.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryTaosc.json" % binPath)
os.system("cat query_res0.txt* > all_query_res0_taosc.txt") os.system("cat query_res0.txt* > all_query_res0_taosc.txt")
os.system("cat query_res1.txt* > all_query_res1_taosc.txt") os.system("cat query_res1.txt* > all_query_res1_taosc.txt")
os.system("cat query_res2.txt* > all_query_res2_taosc.txt") os.system("cat query_res2.txt* > all_query_res2_taosc.txt")
@ -141,8 +116,8 @@ class TDTestCase:
os.system("rm -rf ./all_query*") os.system("rm -rf ./all_query*")
# use restful api to query # use restful api to query
os.system("%s -f ./taosbenchmark/json/queryInsertrestdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertrestdata.json" % binPath)
os.system("%s -f ./taosbenchmark/json/queryRestful.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryRestful.json" % binPath)
os.system("cat query_res0.txt* > all_query_res0_rest.txt") os.system("cat query_res0.txt* > all_query_res0_rest.txt")
os.system("cat query_res1.txt* > all_query_res1_rest.txt") os.system("cat query_res1.txt* > all_query_res1_rest.txt")
os.system("cat query_res2.txt* > all_query_res2_rest.txt") os.system("cat query_res2.txt* > all_query_res2_rest.txt")
@ -176,49 +151,49 @@ class TDTestCase:
# query times less than or equal to 100 # query times less than or equal to 100
assert ( assert (
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) == 0 os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath) == 0
) )
assert ( assert (
os.system("%s -f ./taosbenchmark/json/querySpeciMutisql100.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/querySpeciMutisql100.json" % binPath)
!= 0 != 0
) )
assert ( assert (
os.system("%s -f ./taosbenchmark/json/querySuperMutisql100.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/querySuperMutisql100.json" % binPath)
== 0 == 0
) )
# query result print QPS # query result print QPS
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
exceptcode = os.system("%s -f ./taosbenchmark/json/queryQps.json" % binPath) exceptcode = os.system("%s -f ./tools/benchmark/basic/json/queryQps.json" % binPath)
assert exceptcode == 0 assert exceptcode == 0
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# use illegal or out of range parameters query json file # use illegal or out of range parameters query json file
os.system("%s -f ./taosbenchmark/json/queryInsertdata.json" % binPath) os.system("%s -f ./tools/benchmark/basic/json/queryInsertdata.json" % binPath)
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# exceptcode = os.system( # exceptcode = os.system(
# "%s -f ./taosbenchmark/json/queryTimes0.json" % # "%s -f ./tools/benchmark/basic/json/queryTimes0.json" %
# binPath) # binPath)
# assert exceptcode != 0 # assert exceptcode != 0
# 2021.02.09 need modify taosBenchmakr code # 2021.02.09 need modify taosBenchmakr code
# exceptcode0 = os.system( # exceptcode0 = os.system(
# "%s -f ./taosbenchmark/json/queryTimesless0.json" % # "%s -f ./tools/benchmark/basic/json/queryTimesless0.json" %
# binPath) # binPath)
# assert exceptcode0 != 0 # assert exceptcode0 != 0
# exceptcode1 = os.system( # exceptcode1 = os.system(
# "%s -f ./taosbenchmark/json/queryConcurrent0.json" % # "%s -f ./tools/benchmark/basic/json/queryConcurrent0.json" %
# binPath) # binPath)
# assert exceptcode2 != 0 # assert exceptcode2 != 0
# exceptcode3 = os.system( # exceptcode3 = os.system(
# "%s -f ./taosbenchmark/json/querrThreadsless0.json" % # "%s -f ./tools/benchmark/basic/json/querrThreadsless0.json" %
# binPath) # binPath)
# assert exceptcode3 != 0 # assert exceptcode3 != 0
# exceptcode4 = os.system( # exceptcode4 = os.system(
# "%s -f ./taosbenchmark/json/querrThreads0.json" % # "%s -f ./tools/benchmark/basic/json/querrThreads0.json" %
# binPath) # binPath)
# assert exceptcode4 != 0 # assert exceptcode4 != 0

View File

@ -12,58 +12,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import time import time
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.query("select client_version()") tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0]) client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0] major_ver = client_ver.split(".")[0]
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/sml_telnet_tcp.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/sml_telnet_tcp.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(5) time.sleep(5)

View File

@ -12,67 +12,42 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import time import time
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
tdSql.execute("drop topic if exists tmq_topic_0") tdSql.execute("drop topic if exists tmq_topic_0")
tdSql.execute("drop topic if exists tmq_topic_1") tdSql.execute("drop topic if exists tmq_topic_1")
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -f ./taosbenchmark/json/default.json" % binPath cmd = "%s -f ./tools/benchmark/basic/json/default.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("alter database db WAL_RETENTION_PERIOD 3600000") tdSql.execute("alter database db WAL_RETENTION_PERIOD 3600000")
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
cmd = "%s -f ./taosbenchmark/json/tmq_basic.json " % binPath cmd = "%s -f ./tools/benchmark/basic/json/tmq_basic.json " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(5) time.sleep(5)
cmd = "%s -f ./taosbenchmark/json/tmq_basic2.json " % binPath cmd = "%s -f ./tools/benchmark/basic/json/tmq_basic2.json " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(5) time.sleep(5)
cmd = "%s -f ./taosbenchmark/json/tmq_basic3.json " % binPath cmd = "%s -f ./tools/benchmark/basic/json/tmq_basic3.json " % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
time.sleep(5) time.sleep(5)

View File

@ -12,53 +12,23 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import subprocess import subprocess
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-22022] taosBenchmark cloud test cases [TD-22022] taosBenchmark cloud test cases
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("Cannot find %s in path: %s" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.info(f"{tool} not found in {projPath}!")
return f"/usr/local/taos/bin/{tool}"
else:
tdLog.info(f"{tool} is found in {paths[0]}!")
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -T 1 -t 2 -n 10 -y" % binPath cmd = "%s -T 1 -t 2 -n 10 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -10,50 +10,25 @@
################################################################### ###################################################################
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase(TBase):
def caseDescription(self): def caseDescription(self):
""" """
[TD-17079] taosBenchmark test cloud [TD-17079] taosBenchmark test cloud
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
else:
projPath = selfPath[: selfPath.find("tests")]
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
tdLog.info("taosBenchmark found in %s" % paths[0])
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.benchMarkFile()
cmd = "%s -t 1 -n 1 -y -W http://localhost:6041 -D 30" % binPath cmd = "%s -t 1 -n 1 -y -W http://localhost:6041 -D 30" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,7 @@ class TDTestCase:
case1<sdsang>: [TD-18291] taosdump basic test case1<sdsang>: [TD-18291] taosdump basic test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("Cannot find %s in path: %s" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -89,7 +63,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-18291] taosdump basic test case1<sdsang>: [TD-18291] taosdump basic test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -89,7 +64,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-20506] taosdump dump db with non-root case1<sdsang>: [TD-20506] taosdump dump db with non-root
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -89,7 +64,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TS-3072] taosdump dump escaped db name test case1<sdsang>: [TS-3072] taosdump dump escaped db name test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -73,7 +48,7 @@ class TDTestCase:
) )
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,39 +27,11 @@ class TDTestCase:
case1<sdsang>: [TS-3102] taosdump in diff type test case1<sdsang>: [TS-3102] taosdump in diff type test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TS-1762] taosdump with many columns case1<sdsang>: [TS-1762] taosdump with many columns
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -93,7 +68,7 @@ class TDTestCase:
ins_sql += ")" ins_sql += ")"
tdSql.execute(ins_sql) tdSql.execute(ins_sql)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,39 +27,11 @@ class TDTestCase:
case1<sdsang>: [TS-2769] taosdump start-time end-time test case1<sdsang>: [TS-2769] taosdump start-time end-time test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,39 +27,11 @@ class TDTestCase:
case1<sdsang>: [TS-2769] taosdump start-time end-time test case1<sdsang>: [TS-2769] taosdump start-time end-time test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -34,31 +37,6 @@ class TDTestCase:
else: else:
return True return True
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
if not os.path.exists("./taosdumptest/tmp1"): if not os.path.exists("./taosdumptest/tmp1"):
@ -93,7 +71,7 @@ class TDTestCase:
sql += "(%d, %d, 'nchar%d')" % (currts + i, i % 100, i % 100) sql += "(%d, %d, 'nchar%d')" % (currts + i, i % 100, i % 100)
tdSql.execute(sql) tdSql.execute(sql)
binPath = self.getPath("taosdump") binPath = self.etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -13,10 +13,13 @@
from logging.config import dictConfig from logging.config import dictConfig
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
import string import string
import random import random
@ -30,31 +33,6 @@ class TDTestCase:
self.numberOfTables = 1 self.numberOfTables = 1
self.numberOfRecords = 150 self.numberOfRecords = 150
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def generateString(self, length): def generateString(self, length):
chars = string.ascii_uppercase + string.ascii_lowercase chars = string.ascii_uppercase + string.ascii_lowercase
@ -90,7 +68,7 @@ class TDTestCase:
break break
tdSql.execute(sql) tdSql.execute(sql)
binPath = self.getPath("taosdump") binPath = self.etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-18291] taosdump basic test case1<sdsang>: [TD-18291] taosdump basic test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -89,7 +64,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,37 +27,6 @@ class TDTestCase:
case1<sdsang>: [TD-14544] taosdump data inspect case1<sdsang>: [TD-14544] taosdump data inspect
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -80,7 +52,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-19436] taosdump loose mode test case1<sdsang>: [TD-19436] taosdump loose mode test
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -79,7 +54,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -34,31 +37,6 @@ class TDTestCase:
else: else:
return True return True
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def createdb(self, precision="ns"): def createdb(self, precision="ns"):
tb_nums = self.numberOfTables tb_nums = self.numberOfTables
@ -132,7 +110,7 @@ class TDTestCase:
if not os.path.exists("./taosdumptest/dumptmp3"): if not os.path.exists("./taosdumptest/dumptmp3"):
os.makedirs("./taosdumptest/dumptmp3") os.makedirs("./taosdumptest/dumptmp3")
binPath = self.getPath("taosdump") binPath = self.etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-12526] taosdump supports big int case1<sdsang>: [TD-12526] taosdump supports big int
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -77,7 +52,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-12526] taosdump supports binary case1<sdsang>: [TD-12526] taosdump supports binary
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -71,7 +46,7 @@ class TDTestCase:
tdSql.execute("create table t2 using st tags(NULL)") tdSql.execute("create table t2 using st tags(NULL)")
tdSql.execute("insert into t2 values(1640000000000, NULL, NULL)") tdSql.execute("insert into t2 values(1640000000000, NULL, NULL)")
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -12,10 +12,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -24,36 +27,8 @@ class TDTestCase:
case1<sdsang>: [TD-12526] taosdump supports bool case1<sdsang>: [TD-12526] taosdump supports bool
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -70,7 +45,7 @@ class TDTestCase:
tdSql.execute("create table t3 using st tags(NULL)") tdSql.execute("create table t3 using st tags(NULL)")
tdSql.execute("insert into t3 values(1640000000000, NULL)") tdSql.execute("insert into t3 values(1640000000000, NULL)")
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

View File

@ -13,10 +13,13 @@
import os import os
import math import math
from util.log import * import frame
from util.cases import * import frame.etool
from util.sql import * from frame.log import *
from util.dnodes import * from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame import *
class TDTestCase: class TDTestCase:
@ -25,36 +28,8 @@ class TDTestCase:
case1<sdsang>: [TD-12526] taosdump supports double case1<sdsang>: [TD-12526] taosdump supports double
""" """
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if len(paths) == 0:
return ""
return paths[0]
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
@ -78,7 +53,7 @@ class TDTestCase:
# sys.exit(1) # sys.exit(1)
binPath = self.getPath() binPath = etool.taosDumpFile()
if binPath == "": if binPath == "":
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
else: else:

Some files were not shown because too many files have changed in this diff Show More