Merge branch '3.0' of github.com:taosdata/TDengine into szhou/table-count-scan
This commit is contained in:
commit
f758c3b062
|
@ -418,7 +418,7 @@
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
|
||||||
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
|
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
|
#,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py
|
||||||
|
|
|
@ -4,7 +4,7 @@ import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
from util.log import *
|
from util.log import *
|
||||||
from util.sql import *
|
from util.sql import *
|
||||||
from util.cases import *
|
from util.cases import *
|
||||||
|
@ -13,162 +13,167 @@ from util.dnodes import TDDnodes
|
||||||
from util.dnodes import TDDnode
|
from util.dnodes import TDDnode
|
||||||
from util.cluster import *
|
from util.cluster import *
|
||||||
|
|
||||||
|
BASEVERSION = "3.0.1.8"
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
def caseDescription(self):
|
def caseDescription(self):
|
||||||
'''
|
'''
|
||||||
3.0 data compatibility test
|
3.0 data compatibility test
|
||||||
case1: basedata version is 3.0.1.0
|
case1: basedata version is 3.0.1.8
|
||||||
'''
|
'''
|
||||||
return
|
return
|
||||||
|
|
||||||
def init(self, conn, logSql, replicaVar=1):
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
self.replicaVar = int(replicaVar)
|
self.replicaVar = int(replicaVar)
|
||||||
tdLog.debug(f"start to excute {__file__}")
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
tdSql.init(conn.cursor())
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
|
||||||
def getBuildPath(self):
|
def getBuildPath(self):
|
||||||
selfPath = os.path.dirname(os.path.realpath(__file__))
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
if ("community" in selfPath):
|
if ("community" in selfPath):
|
||||||
projPath = selfPath[:selfPath.find("community")]
|
projPath = selfPath[:selfPath.find("community")]
|
||||||
else:
|
else:
|
||||||
projPath = selfPath[:selfPath.find("tests")]
|
projPath = selfPath[:selfPath.find("tests")]
|
||||||
|
|
||||||
for root, dirs, files in os.walk(projPath):
|
for root, dirs, files in os.walk(projPath):
|
||||||
if ("taosd" in files or "taosd.exe" in files):
|
if ("taosd" in files or "taosd.exe" in files):
|
||||||
rootRealPath = os.path.dirname(os.path.realpath(root))
|
rootRealPath = os.path.dirname(os.path.realpath(root))
|
||||||
if ("packaging" not in rootRealPath):
|
if ("packaging" not in rootRealPath):
|
||||||
buildPath = root[:len(root)-len("/build/bin")]
|
buildPath = root[:len(root)-len("/build/bin")]
|
||||||
break
|
break
|
||||||
return buildPath
|
return buildPath
|
||||||
|
|
||||||
def getCfgPath(self):
|
def getCfgPath(self):
|
||||||
buildPath = self.getBuildPath()
|
buildPath = self.getBuildPath()
|
||||||
selfPath = os.path.dirname(os.path.realpath(__file__))
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
if ("community" in selfPath):
|
if ("community" in selfPath):
|
||||||
cfgPath = buildPath + "/../sim/dnode1/cfg/"
|
cfgPath = buildPath + "/../sim/dnode1/cfg/"
|
||||||
else:
|
else:
|
||||||
cfgPath = buildPath + "/../sim/dnode1/cfg/"
|
cfgPath = buildPath + "/../sim/dnode1/cfg/"
|
||||||
|
|
||||||
return cfgPath
|
return cfgPath
|
||||||
|
|
||||||
def installTaosd(self,bPath,cPath):
|
def installTaosd(self,bPath,cPath):
|
||||||
# os.system(f"rmtaos && mkdir -p {self.getBuildPath()}/build/lib/temp && mv {self.getBuildPath()}/build/lib/libtaos.so* {self.getBuildPath()}/build/lib/temp/ ")
|
# os.system(f"rmtaos && mkdir -p {self.getBuildPath()}/build/lib/temp && mv {self.getBuildPath()}/build/lib/libtaos.so* {self.getBuildPath()}/build/lib/temp/ ")
|
||||||
# os.system(f" mv {bPath}/build {bPath}/build_bak ")
|
# os.system(f" mv {bPath}/build {bPath}/build_bak ")
|
||||||
# os.system(f"mv {self.getBuildPath()}/build/lib/libtaos.so {self.getBuildPath()}/build/lib/libtaos.so_bak ")
|
# os.system(f"mv {self.getBuildPath()}/build/lib/libtaos.so {self.getBuildPath()}/build/lib/libtaos.so_bak ")
|
||||||
# os.system(f"mv {self.getBuildPath()}/build/lib/libtaos.so.1 {self.getBuildPath()}/build/lib/libtaos.so.1_bak ")
|
# os.system(f"mv {self.getBuildPath()}/build/lib/libtaos.so.1 {self.getBuildPath()}/build/lib/libtaos.so.1_bak ")
|
||||||
|
|
||||||
packagePath="/usr/local/src/"
|
packagePath = "/usr/local/src/"
|
||||||
packageName="TDengine-server-3.0.1.0-Linux-x64.tar.gz"
|
|
||||||
os.system(f"cd {packagePath} && tar xvf TDengine-server-3.0.1.0-Linux-x64.tar.gz && cd TDengine-server-3.0.1.0 && ./install.sh -e no " )
|
packageName = "TDengine-server-"+ BASEVERSION + "-Linux-x64.tar.gz"
|
||||||
tdDnodes.stop(1)
|
packageTPath = packageName.split("-Linux-")[0]
|
||||||
print(f"start taosd: nohup taosd -c {cPath} & ")
|
my_file = Path(f"{packagePath}/{packageName}")
|
||||||
os.system(f" nohup taosd -c {cPath} & " )
|
if not my_file.exists():
|
||||||
sleep(1)
|
print(f"{packageName} is not exists")
|
||||||
|
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 " )
|
||||||
|
tdDnodes.stop(1)
|
||||||
|
print(f"start taosd: nohup taosd -c {cPath} & ")
|
||||||
|
os.system(f" nohup taosd -c {cPath} & " )
|
||||||
|
sleep(5)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def buildTaosd(self,bPath):
|
def buildTaosd(self,bPath):
|
||||||
# os.system(f"mv {bPath}/build_bak {bPath}/build ")
|
# os.system(f"mv {bPath}/build_bak {bPath}/build ")
|
||||||
os.system(f" cd {bPath} && make install ")
|
os.system(f" cd {bPath} && make install ")
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print(f"start taosd run")
|
bPath=self.getBuildPath()
|
||||||
bPath=self.getBuildPath()
|
cPath=self.getCfgPath()
|
||||||
cPath=self.getCfgPath()
|
dbname = "test"
|
||||||
dbname = "test"
|
stb = f"{dbname}.meters"
|
||||||
stb = f"{dbname}.meters"
|
self.installTaosd(bPath,cPath)
|
||||||
self.installTaosd(bPath,cPath)
|
os.system("echo 'debugFlag 143' > /etc/taos/taos.cfg ")
|
||||||
os.system("echo 'debugFlag 143' > /etc/taos/taos.cfg ")
|
tableNumbers=100
|
||||||
os.system("echo ' supportVnodes 256' > /etc/taos/taos.cfg ")
|
recordNumbers1=100
|
||||||
tableNumbers=100
|
recordNumbers2=1000
|
||||||
recordNumbers1=100
|
# tdsqlF=tdCom.newTdSql()
|
||||||
recordNumbers2=1000
|
# print(tdsqlF)
|
||||||
#tdsqlF=tdCom.newTdSql()
|
# tdsqlF.query(f"SELECT SERVER_VERSION();")
|
||||||
#print(tdsqlF)
|
# print(tdsqlF.query(f"SELECT SERVER_VERSION();"))
|
||||||
|
# oldServerVersion=tdsqlF.queryResult[0][0]
|
||||||
|
# tdLog.info(f"Base server version is {oldServerVersion}")
|
||||||
|
# tdsqlF.query(f"SELECT CLIENT_VERSION();")
|
||||||
|
# # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison
|
||||||
|
# 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 ")
|
||||||
|
sleep(3)
|
||||||
|
|
||||||
oldServerVersion = '3.0.1.0'
|
# tdsqlF.query(f"select count(*) from {stb}")
|
||||||
#tdsqlF.query(f"SELECT SERVER_VERSION();")
|
# tdsqlF.checkData(0,0,tableNumbers*recordNumbers1)
|
||||||
#print(tdsqlF.query(f"SELECT SERVER_VERSION();"))
|
os.system("pkill taosd")
|
||||||
#oldServerVersion=tdsqlF.queryResult[0][0]
|
sleep(2)
|
||||||
#tdLog.info(f"Base server version is {oldServerVersion}")
|
|
||||||
#tdsqlF.query(f"SELECT CLIENT_VERSION();")
|
|
||||||
#
|
|
||||||
## the oldClientVersion can't be updated in the same python process,so the version is new compiled verison
|
|
||||||
#oldClientVersion=tdsqlF.queryResult[0][0]
|
|
||||||
|
|
||||||
#tdLog.info(f"Base client version is {oldClientVersion}")
|
print(f"start taosd: nohup taosd -c {cPath} & ")
|
||||||
|
os.system(f" nohup taosd -c {cPath} & " )
|
||||||
tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}")
|
sleep(10)
|
||||||
tdLog.info(f" LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
|
tdLog.info(" LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y ")
|
||||||
os.system(f"LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
|
os.system("LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y")
|
||||||
sleep(3)
|
os.system("pkill -9 taosd")
|
||||||
|
|
||||||
# tdsqlF.query(f"select count(*) from {stb}")
|
|
||||||
# tdsqlF.checkData(0,0,tableNumbers*recordNumbers1)
|
|
||||||
os.system("pkill taosd")
|
|
||||||
sleep(2)
|
|
||||||
|
|
||||||
print(f"start taosd: nohup taosd -c {cPath} & ")
|
|
||||||
os.system(f" nohup taosd -c {cPath} & " )
|
|
||||||
sleep(10)
|
|
||||||
tdLog.info(" LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y ")
|
|
||||||
os.system("LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y")
|
|
||||||
os.system("pkill -9 taosd")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tdLog.printNoPrefix("==========step2:update new version ")
|
tdLog.printNoPrefix("==========step2:update new version ")
|
||||||
self.buildTaosd(bPath)
|
self.buildTaosd(bPath)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
tdsql=tdCom.newTdSql()
|
tdsql=tdCom.newTdSql()
|
||||||
print(tdsql)
|
print(tdsql)
|
||||||
|
|
||||||
|
|
||||||
tdsql.query(f"SELECT SERVER_VERSION();")
|
tdsql.query(f"SELECT SERVER_VERSION();")
|
||||||
nowServerVersion=tdsql.queryResult[0][0]
|
nowServerVersion=tdsql.queryResult[0][0]
|
||||||
tdLog.info(f"New server version is {nowServerVersion}")
|
tdLog.info(f"New server version is {nowServerVersion}")
|
||||||
tdsql.query(f"SELECT CLIENT_VERSION();")
|
tdsql.query(f"SELECT CLIENT_VERSION();")
|
||||||
nowClientVersion=tdsql.queryResult[0][0]
|
nowClientVersion=tdsql.queryResult[0][0]
|
||||||
tdLog.info(f"New client version is {nowClientVersion}")
|
tdLog.info(f"New client version is {nowClientVersion}")
|
||||||
|
|
||||||
tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}")
|
tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}")
|
||||||
tdsql.query(f"select count(*) from {stb}")
|
tdsql.query(f"select count(*) from {stb}")
|
||||||
tdsql.checkData(0,0,tableNumbers*recordNumbers1)
|
tdsql.checkData(0,0,tableNumbers*recordNumbers1)
|
||||||
os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
|
os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
|
||||||
tdsql.query(f"select count(*) from {stb}")
|
tdsql.query(f"select count(*) from {stb}")
|
||||||
tdsql.checkData(0,0,tableNumbers*recordNumbers2)
|
tdsql.checkData(0,0,tableNumbers*recordNumbers2)
|
||||||
|
tdsql.query(f"select count(*) from db4096.stb0")
|
||||||
|
tdsql.checkData(0,0,50000)
|
||||||
|
|
||||||
|
tdsql=tdCom.newTdSql()
|
||||||
|
tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542")
|
||||||
|
tdsql.execute("drop database if exists db")
|
||||||
|
tdsql.execute("create database db")
|
||||||
|
tdsql.execute("use db")
|
||||||
|
tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);")
|
||||||
|
tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);")
|
||||||
|
tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);")
|
||||||
|
tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);")
|
||||||
|
tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);")
|
||||||
|
tdsql.query("select * from db.ct3")
|
||||||
|
tdsql.checkData(0,1,13)
|
||||||
|
tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);")
|
||||||
|
tdsql.query("select * from db.ct4")
|
||||||
|
tdsql.checkData(0,1,14)
|
||||||
|
tdsql.query("describe information_schema.ins_databases;")
|
||||||
|
qRows=tdsql.queryRows
|
||||||
|
for i in range(qRows) :
|
||||||
|
if tdsql.queryResult[i][0]=="retentions" :
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
tdsql=tdCom.newTdSql()
|
|
||||||
tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542")
|
|
||||||
tdsql.execute("drop database if exists db")
|
|
||||||
tdsql.execute("create database db")
|
|
||||||
tdsql.execute("use db")
|
|
||||||
tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);")
|
|
||||||
tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);")
|
|
||||||
tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);")
|
|
||||||
tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);")
|
|
||||||
tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);")
|
|
||||||
tdsql.query("select * from db.ct3")
|
|
||||||
tdsql.checkData(0,1,13)
|
|
||||||
tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);")
|
|
||||||
tdsql.query("select * from db.ct4")
|
|
||||||
tdsql.checkData(0,1,14)
|
|
||||||
tdsql.query("describe information_schema.ins_databases;")
|
|
||||||
qRows=tdsql.queryRows
|
|
||||||
for i in range(qRows) :
|
|
||||||
if tdsql.queryResult[i][0]=="retentions" :
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
def stop(self):
|
|
||||||
tdSql.close()
|
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
|
||||||
|
|
||||||
tdCases.addLinux(__file__, TDTestCase())
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
tdCases.addWindows(__file__, TDTestCase())
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
|
Loading…
Reference in New Issue