diff --git a/tests/army/enterprise/multi-level/mlevel_basic.py b/tests/army/enterprise/multi-level/mlevel_basic.py index a12b1b59eb..70bfb9b66e 100644 --- a/tests/army/enterprise/multi-level/mlevel_basic.py +++ b/tests/army/enterprise/multi-level/mlevel_basic.py @@ -16,12 +16,13 @@ import time import taos import frame +import frame.etool from frame.log import * from frame.cases import * from frame.sql import * from frame.caseBase import * - +from frame import * class TDTestCase(TBase): @@ -30,9 +31,10 @@ class TDTestCase(TBase): def insertData(self): tdLog.info(f"insert data.") # taosBenchmark run - json = frame.etool.curFile(__file__, "mlevel_basic.json") - frame.etool.runBenchmark(json=json) + json = etool.curFile(__file__, "mlevel_basic.json") + etool.runBenchmark(json=json) + tdSql.execute(f"use {self.db}") # set insert data information self.childtable_count = 2 self.insert_rows = 1000000 @@ -76,4 +78,4 @@ class TDTestCase(TBase): tdCases.addLinux(__file__, TDTestCase()) -tdCases.addWindows(__file__, TDTestCase()) \ No newline at end of file +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/army/frame/caseBase.py b/tests/army/frame/caseBase.py index 7b371cd822..11c44b28e9 100644 --- a/tests/army/frame/caseBase.py +++ b/tests/army/frame/caseBase.py @@ -16,11 +16,11 @@ import os import time import datetime -from log import * -from sql import * +from frame.log import * +from frame.sql import * # test case base -class DbBase: +class TBase: # # frame call @@ -85,7 +85,7 @@ class DbBase: tdSql.checkAgg(sql, self.childtable_count) # check step - sql = f"select count(*) from (select diff(ts) as dif from {self.stb} group by tbname) where dif != {self.timestamp_step}" + sql = f"select count(*) from (select diff(ts) as dif from {self.stb} partition by tbname) where dif != {self.timestamp_step}" tdSql.checkAgg(sql, 0) # save agg result diff --git a/tests/army/frame/eos.py b/tests/army/frame/eos.py index 2d8559f3eb..ab4d2c1bd0 100644 --- a/tests/army/frame/eos.py +++ b/tests/army/frame/eos.py @@ -22,7 +22,7 @@ import datetime # if windows platform return True def isWin(): - return sys.platform.system().lower() == 'windows' + return sys.platform.lower() == 'windows' # wait util execute file finished def exe(file): diff --git a/tests/army/frame/epath.py b/tests/army/frame/epath.py index 644e448fb7..edff9c78a4 100644 --- a/tests/army/frame/epath.py +++ b/tests/army/frame/epath.py @@ -19,13 +19,13 @@ import os from frame.log import * # build/bin path -binPath = "" +binDir = "" -def binPath(self): - global binPath +def binPath(): + global binDir - if binPath != "": - return binPath + if binDir != "": + return binDir selfPath = os.path.dirname(os.path.realpath(__file__)) @@ -46,8 +46,8 @@ def binPath(self): else: tdLog.info(f"taosd found in {buildPath}") # return - binPath = buildPath + "/build/bin/" - return binPath + binDir = buildPath + "/build/bin/" + return binDir -def binFile(self, file): - return binPath() + file \ No newline at end of file +def binFile(filename): + return binPath() + filename diff --git a/tests/army/frame/etool.py b/tests/army/frame/etool.py index 5ba29ee1c3..f24871b3dd 100644 --- a/tests/army/frame/etool.py +++ b/tests/army/frame/etool.py @@ -19,22 +19,24 @@ import sys import os import time import datetime -import epath -import eos +import frame.epath +import frame.eos # run taosBenchmark with command or json file mode def runBenchmark(command = "", json = "") : # get taosBenchmark path - bmFile = epath.binFile("taosBenchmark") - if eos.isWin(): + bmFile = frame.epath.binFile("taosBenchmark") + if frame.eos.isWin(): bmFile += ".exe" # run if command != "": - eos.exe(bmFile + " " + command) + frame.eos.exe(bmFile + " " + command) if json != "": - eos.exe(bmFile + " -f " + json) + cmd = f"{bmFile} -f {json}" + print(cmd) + frame.eos.exe(cmd) # get current directory file name -def curFile(fullPath, file): - return os.path.dirname(fullPath) + "/" + file +def curFile(fullPath, filename): + return os.path.dirname(fullPath) + "/" + filename diff --git a/tests/army/frame/sql.py b/tests/army/frame/sql.py index b3ee1ed5f8..2e14f0c2f0 100644 --- a/tests/army/frame/sql.py +++ b/tests/army/frame/sql.py @@ -538,7 +538,7 @@ class TDSql: # check like select count(*) ... sql def checkAgg(self, sql, expectCnt): self.query(sql) - self.checkRowCol(0, 0, expectCnt) + self.checkData(0, 0, expectCnt) # get first value def getFirstValue(self, sql) :