From f97b46877dd70a302d9fadb33f1fd2d5c85f91ac Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 1 Dec 2022 17:11:22 +0800 Subject: [PATCH] test:modify testcase that deletes dataDir when starting old taosd --- tests/system-test/0-others/compatibility.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 7f52c754cf..287dffa7bd 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -62,7 +62,7 @@ class TDTestCase: # os.system(f"mv {self.getBuildPath()}/build/lib/libtaos.so.1 {self.getBuildPath()}/build/lib/libtaos.so.1_bak ") packagePath = "/usr/local/src/" - + dataPath = cPath + "/../data/" packageName = "TDengine-server-"+ BASEVERSION + "-Linux-x64.tar.gz" packageTPath = packageName.split("-Linux-")[0] my_file = Path(f"{packagePath}/{packageName}") @@ -71,10 +71,10 @@ class TDTestCase: os.system(f"cd {packagePath} && wget https://www.tdengine.com/assets-download/3.0/{packageName}") else: print(f"{packageName} has been exists") - os.system(f"cd {packagePath} && tar xvf {packageName} && cd {packageTPath} && ./install.sh -e no " ) + os.system(f" cd {packagePath} && tar xvf {packageName} && cd {packageTPath} && ./install.sh -e no " ) tdDnodes.stop(1) - print(f"start taosd: nohup taosd -c {cPath} & ") - os.system(f" nohup taosd -c {cPath} & " ) + print(f"start taosd: rm -rf {dataPath}/* && nohup taosd -c {cPath} & ") + os.system(f"rm -rf {dataPath}/* && nohup taosd -c {cPath} & " ) sleep(5) @@ -85,8 +85,8 @@ class TDTestCase: def run(self): - bPath=self.getBuildPath() - cPath=self.getCfgPath() + bPath = self.getBuildPath() + cPath = self.getCfgPath() dbname = "test" stb = f"{dbname}.meters" self.installTaosd(bPath,cPath) @@ -94,6 +94,7 @@ class TDTestCase: tableNumbers=100 recordNumbers1=100 recordNumbers2=1000 + # tdsqlF=tdCom.newTdSql() # print(tdsqlF) # tdsqlF.query(f"SELECT SERVER_VERSION();") @@ -105,6 +106,7 @@ class TDTestCase: # oldClientVersion=tdsqlF.queryResult[0][0] # tdLog.info(f"Base client version is {oldClientVersion}") # baseVersion = "3.0.1.8" + tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{BASEVERSION}") tdLog.info(f" LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") os.system(f"LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")