fix test cases
This commit is contained in:
parent
54f2e4af05
commit
c1c386bc42
|
@ -11,7 +11,7 @@ from util.dnodes import *
|
||||||
|
|
||||||
|
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
|
updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
|
||||||
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
|
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
|
||||||
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
|
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
|
||||||
def init(self, conn, logSql):
|
def init(self, conn, logSql):
|
||||||
|
@ -37,7 +37,7 @@ class TDTestCase:
|
||||||
def illegal_params(self):
|
def illegal_params(self):
|
||||||
|
|
||||||
illegal_params = ["1","0","NULL","False","True" ,"keep","now" ,"*" , "," ,"_" , "abc" ,"keep"]
|
illegal_params = ["1","0","NULL","False","True" ,"keep","now" ,"*" , "," ,"_" , "abc" ,"keep"]
|
||||||
|
|
||||||
for value in illegal_params:
|
for value in illegal_params:
|
||||||
|
|
||||||
tdSql.error("create database testdb replica 1 cachemodel '%s' " %value)
|
tdSql.error("create database testdb replica 1 cachemodel '%s' " %value)
|
||||||
|
@ -80,9 +80,9 @@ class TDTestCase:
|
||||||
tdSql.execute(" insert into tb2 values(now , %d, %f)" %(k,k*10) )
|
tdSql.execute(" insert into tb2 values(now , %d, %f)" %(k,k*10) )
|
||||||
|
|
||||||
def check_cachemodel_sets(self):
|
def check_cachemodel_sets(self):
|
||||||
|
|
||||||
|
|
||||||
# check cache_last value for database
|
# check cache_last value for database
|
||||||
|
|
||||||
tdSql.query(" show databases ")
|
tdSql.query(" show databases ")
|
||||||
databases_infos = tdSql.queryResult
|
databases_infos = tdSql.queryResult
|
||||||
|
@ -96,10 +96,10 @@ class TDTestCase:
|
||||||
continue
|
continue
|
||||||
cache_lasts[dbname]=self.getCacheModelNum(cache_last_value)
|
cache_lasts[dbname]=self.getCacheModelNum(cache_last_value)
|
||||||
|
|
||||||
|
|
||||||
# cache_last_set value
|
# cache_last_set value
|
||||||
for k , v in cache_lasts.items():
|
for k , v in cache_lasts.items():
|
||||||
|
|
||||||
if k=="testdb_"+str(self.getCacheModelStr(v)):
|
if k=="testdb_"+str(self.getCacheModelStr(v)):
|
||||||
tdLog.info(" database %s cache_last value check pass, value is %s "%(k,self.getCacheModelStr(v)) )
|
tdLog.info(" database %s cache_last value check pass, value is %s "%(k,self.getCacheModelStr(v)) )
|
||||||
else:
|
else:
|
||||||
|
@ -116,7 +116,7 @@ class TDTestCase:
|
||||||
dataPath = buildPath + "/../sim/dnode1/data"
|
dataPath = buildPath + "/../sim/dnode1/data"
|
||||||
abs_vnodePath = os.path.abspath(dataPath)+"/vnode/"
|
abs_vnodePath = os.path.abspath(dataPath)+"/vnode/"
|
||||||
tdLog.info("abs_vnodePath: %s" % abs_vnodePath)
|
tdLog.info("abs_vnodePath: %s" % abs_vnodePath)
|
||||||
|
|
||||||
tdSql.query(" show dnodes ")
|
tdSql.query(" show dnodes ")
|
||||||
dnode_id = tdSql.queryResult[0][0]
|
dnode_id = tdSql.queryResult[0][0]
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class TDTestCase:
|
||||||
vgroups_infos = tdSql.queryResult
|
vgroups_infos = tdSql.queryResult
|
||||||
for vgroup_info in vgroups_infos:
|
for vgroup_info in vgroups_infos:
|
||||||
vnode_json = abs_vnodePath + "/vnode" +f"{vgroup_info[0]}/" + "vnode.json"
|
vnode_json = abs_vnodePath + "/vnode" +f"{vgroup_info[0]}/" + "vnode.json"
|
||||||
vnode_info_of_db = f"cat {vnode_json}"
|
vnode_info_of_db = f"cat {vnode_json}"
|
||||||
vnode_info = subprocess.check_output(vnode_info_of_db, shell=True).decode("utf-8")
|
vnode_info = subprocess.check_output(vnode_info_of_db, shell=True).decode("utf-8")
|
||||||
infoDict = json.loads(vnode_info)
|
infoDict = json.loads(vnode_info)
|
||||||
vnode_json_of_dbname = f"{dnode_id}."+ dbname
|
vnode_json_of_dbname = f"{dnode_id}."+ dbname
|
||||||
|
@ -142,7 +142,7 @@ class TDTestCase:
|
||||||
tdLog.exit("cacheLast not found in vnode.json of vnode%d "%(vgroup_info[0]))
|
tdLog.exit("cacheLast not found in vnode.json of vnode%d "%(vgroup_info[0]))
|
||||||
|
|
||||||
def restart_check_cachemodel_sets(self):
|
def restart_check_cachemodel_sets(self):
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
tdSql.query("show dnodes")
|
tdSql.query("show dnodes")
|
||||||
index = tdSql.getData(0, 0)
|
index = tdSql.getData(0, 0)
|
||||||
|
@ -157,7 +157,7 @@ class TDTestCase:
|
||||||
self.prepare_datas()
|
self.prepare_datas()
|
||||||
self.check_cachemodel_sets()
|
self.check_cachemodel_sets()
|
||||||
self.restart_check_cachemodel_sets()
|
self.restart_check_cachemodel_sets()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
|
@ -18,7 +18,7 @@ from util.dnodes import *
|
||||||
def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key1='', value1=''):
|
def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key1='', value1=''):
|
||||||
if len(key) == 0:
|
if len(key) == 0:
|
||||||
tdLog.exit("taos test key is null!")
|
tdLog.exit("taos test key is null!")
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
taosCmd = buildPath + '\\build\\bin\\taos.exe '
|
taosCmd = buildPath + '\\build\\bin\\taos.exe '
|
||||||
taosCmd = taosCmd.replace('\\','\\\\')
|
taosCmd = taosCmd.replace('\\','\\\\')
|
||||||
|
@ -214,7 +214,7 @@ class TDTestCase:
|
||||||
retCode, retVal = taos_command(buildPath, "p", keyDict['p'], "taos>", keyDict['c'], '', "A", '')
|
retCode, retVal = taos_command(buildPath, "p", keyDict['p'], "taos>", keyDict['c'], '', "A", '')
|
||||||
if retCode != "TAOS_OK":
|
if retCode != "TAOS_OK":
|
||||||
tdLog.exit("taos -A fail")
|
tdLog.exit("taos -A fail")
|
||||||
|
|
||||||
sqlString = 'create database ' + newDbName + ';'
|
sqlString = 'create database ' + newDbName + ';'
|
||||||
retCode = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'a', retVal)
|
retCode = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'a', retVal)
|
||||||
if retCode != "TAOS_OK":
|
if retCode != "TAOS_OK":
|
||||||
|
@ -237,7 +237,7 @@ class TDTestCase:
|
||||||
tdLog.exit("taos -s fail")
|
tdLog.exit("taos -s fail")
|
||||||
|
|
||||||
print ("========== check new db ==========")
|
print ("========== check new db ==========")
|
||||||
tdSql.query("show databases")
|
tdSql.query("show databases")
|
||||||
for i in range(tdSql.queryRows):
|
for i in range(tdSql.queryRows):
|
||||||
if tdSql.getData(i, 0) == newDbName:
|
if tdSql.getData(i, 0) == newDbName:
|
||||||
break
|
break
|
||||||
|
@ -259,24 +259,24 @@ class TDTestCase:
|
||||||
if retCode != "TAOS_OK":
|
if retCode != "TAOS_OK":
|
||||||
tdLog.exit("taos -s insert data fail")
|
tdLog.exit("taos -s insert data fail")
|
||||||
|
|
||||||
sqlString = "select * from " + newDbName + ".ctb0"
|
sqlString = "select * from " + newDbName + ".ctb0"
|
||||||
tdSql.query(sqlString)
|
tdSql.query(sqlString)
|
||||||
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
||||||
tdSql.checkData(0, 1, 10)
|
tdSql.checkData(0, 1, 10)
|
||||||
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
||||||
tdSql.checkData(1, 1, 20)
|
tdSql.checkData(1, 1, 20)
|
||||||
sqlString = "select * from " + newDbName + ".ctb1"
|
sqlString = "select * from " + newDbName + ".ctb1"
|
||||||
tdSql.query(sqlString)
|
tdSql.query(sqlString)
|
||||||
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
||||||
tdSql.checkData(0, 1, 11)
|
tdSql.checkData(0, 1, 11)
|
||||||
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
||||||
tdSql.checkData(1, 1, 21)
|
tdSql.checkData(1, 1, 21)
|
||||||
|
|
||||||
keyDict['s'] = "\"select * from " + newDbName + ".ctb0\""
|
keyDict['s'] = "\"select * from " + newDbName + ".ctb0\""
|
||||||
retCode = taos_command(buildPath, "s", keyDict['s'], "2021-04-01 08:00:01.000", keyDict['c'], '', '', '')
|
retCode = taos_command(buildPath, "s", keyDict['s'], "2021-04-01 08:00:01.000", keyDict['c'], '', '', '')
|
||||||
if retCode != "TAOS_OK":
|
if retCode != "TAOS_OK":
|
||||||
tdLog.exit("taos -r show fail")
|
tdLog.exit("taos -r show fail")
|
||||||
|
|
||||||
tdLog.printNoPrefix("================================ parameter: -r")
|
tdLog.printNoPrefix("================================ parameter: -r")
|
||||||
keyDict['s'] = "\"select * from " + newDbName + ".ctb0\""
|
keyDict['s'] = "\"select * from " + newDbName + ".ctb0\""
|
||||||
retCode = taos_command(buildPath, "s", keyDict['s'], "1617235200000", keyDict['c'], '', 'r', '')
|
retCode = taos_command(buildPath, "s", keyDict['s'], "1617235200000", keyDict['c'], '', 'r', '')
|
||||||
|
@ -287,9 +287,9 @@ class TDTestCase:
|
||||||
retCode = taos_command(buildPath, "s", keyDict['s'], "1617235201000", keyDict['c'], '', 'r', '')
|
retCode = taos_command(buildPath, "s", keyDict['s'], "1617235201000", keyDict['c'], '', 'r', '')
|
||||||
if retCode != "TAOS_OK":
|
if retCode != "TAOS_OK":
|
||||||
tdLog.exit("taos -r show fail")
|
tdLog.exit("taos -r show fail")
|
||||||
|
|
||||||
tdSql.query('drop database %s'%newDbName)
|
tdSql.query('drop database %s'%newDbName)
|
||||||
|
|
||||||
tdLog.printNoPrefix("================================ parameter: -f")
|
tdLog.printNoPrefix("================================ parameter: -f")
|
||||||
pwd=os.getcwd()
|
pwd=os.getcwd()
|
||||||
newDbName="dbf"
|
newDbName="dbf"
|
||||||
|
@ -298,15 +298,15 @@ class TDTestCase:
|
||||||
sql2 = "echo use " + newDbName + " >> " + sqlFile
|
sql2 = "echo use " + newDbName + " >> " + sqlFile
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
sql3 = "echo create table ntbf (ts timestamp, c binary(40)) >> " + sqlFile
|
sql3 = "echo create table ntbf (ts timestamp, c binary(40)) >> " + sqlFile
|
||||||
sql4 = "echo insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\") >> " + sqlFile
|
sql4 = "echo insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\") >> " + sqlFile
|
||||||
else:
|
else:
|
||||||
sql3 = "echo 'create table ntbf (ts timestamp, c binary(40))' >> " + sqlFile
|
sql3 = "echo 'create table ntbf (ts timestamp, c binary(40))' >> " + sqlFile
|
||||||
sql4 = "echo 'insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\")' >> " + sqlFile
|
sql4 = "echo 'insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\")' >> " + sqlFile
|
||||||
sql5 = "echo show databases >> " + sqlFile
|
sql5 = "echo show databases >> " + sqlFile
|
||||||
os.system(sql1)
|
os.system(sql1)
|
||||||
os.system(sql2)
|
os.system(sql2)
|
||||||
os.system(sql3)
|
os.system(sql3)
|
||||||
os.system(sql4)
|
os.system(sql4)
|
||||||
os.system(sql5)
|
os.system(sql5)
|
||||||
|
|
||||||
keyDict['f'] = pwd + "/0-others/sql.txt"
|
keyDict['f'] = pwd + "/0-others/sql.txt"
|
||||||
|
@ -316,7 +316,7 @@ class TDTestCase:
|
||||||
tdLog.exit("taos -f fail")
|
tdLog.exit("taos -f fail")
|
||||||
|
|
||||||
print ("========== check new db ==========")
|
print ("========== check new db ==========")
|
||||||
tdSql.query("show databases")
|
tdSql.query("show databases")
|
||||||
for i in range(tdSql.queryRows):
|
for i in range(tdSql.queryRows):
|
||||||
#print ("dbseq: %d, dbname: %s"%(i, tdSql.getData(i, 0)))
|
#print ("dbseq: %d, dbname: %s"%(i, tdSql.getData(i, 0)))
|
||||||
if tdSql.getData(i, 0) == newDbName:
|
if tdSql.getData(i, 0) == newDbName:
|
||||||
|
@ -324,13 +324,13 @@ class TDTestCase:
|
||||||
else:
|
else:
|
||||||
tdLog.exit("create db fail after taos -f fail")
|
tdLog.exit("create db fail after taos -f fail")
|
||||||
|
|
||||||
sqlString = "select * from " + newDbName + ".ntbf"
|
sqlString = "select * from " + newDbName + ".ntbf"
|
||||||
tdSql.query(sqlString)
|
tdSql.query(sqlString)
|
||||||
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
tdSql.checkData(0, 0, '2021-04-01 08:00:00.000')
|
||||||
tdSql.checkData(0, 1, 'test taos -f1')
|
tdSql.checkData(0, 1, 'test taos -f1')
|
||||||
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
tdSql.checkData(1, 0, '2021-04-01 08:00:01.000')
|
||||||
tdSql.checkData(1, 1, 'test taos -f2')
|
tdSql.checkData(1, 1, 'test taos -f2')
|
||||||
|
|
||||||
shellCmd = "rm -f " + sqlFile
|
shellCmd = "rm -f " + sqlFile
|
||||||
os.system(shellCmd)
|
os.system(shellCmd)
|
||||||
tdSql.query('drop database %s'%newDbName)
|
tdSql.query('drop database %s'%newDbName)
|
||||||
|
@ -345,9 +345,9 @@ class TDTestCase:
|
||||||
#print ("-C return content:\n ", retVal)
|
#print ("-C return content:\n ", retVal)
|
||||||
totalCfgItem = {"firstEp":['', '', ''], }
|
totalCfgItem = {"firstEp":['', '', ''], }
|
||||||
for line in retVal.splitlines():
|
for line in retVal.splitlines():
|
||||||
strList = line.split()
|
strList = line.split()
|
||||||
if (len(strList) > 2):
|
if (len(strList) > 2):
|
||||||
totalCfgItem[strList[1]] = strList
|
totalCfgItem[strList[1]] = strList
|
||||||
|
|
||||||
#print ("dict content:\n ", totalCfgItem)
|
#print ("dict content:\n ", totalCfgItem)
|
||||||
firstEp = keyDict["h"] + ':' + keyDict['P']
|
firstEp = keyDict["h"] + ':' + keyDict['P']
|
||||||
|
@ -356,8 +356,8 @@ class TDTestCase:
|
||||||
|
|
||||||
if (totalCfgItem["rpcDebugFlag"][2] != self.rpcDebugFlagVal) and (totalCfgItem["rpcDebugFlag"][0] != 'cfg_file'):
|
if (totalCfgItem["rpcDebugFlag"][2] != self.rpcDebugFlagVal) and (totalCfgItem["rpcDebugFlag"][0] != 'cfg_file'):
|
||||||
tdLog.exit("taos -C return rpcDebugFlag error!")
|
tdLog.exit("taos -C return rpcDebugFlag error!")
|
||||||
|
|
||||||
count = os.cpu_count()
|
count = os.cpu_count()
|
||||||
if (totalCfgItem["numOfCores"][2] != count) and (totalCfgItem["numOfCores"][0] != 'default'):
|
if (totalCfgItem["numOfCores"][2] != count) and (totalCfgItem["numOfCores"][0] != 'default'):
|
||||||
tdLog.exit("taos -C return numOfCores error!")
|
tdLog.exit("taos -C return numOfCores error!")
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ from util.dnodes import *
|
||||||
def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key1='', value1=''):
|
def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key1='', value1=''):
|
||||||
if len(key) == 0:
|
if len(key) == 0:
|
||||||
tdLog.exit("taos test key is null!")
|
tdLog.exit("taos test key is null!")
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
taosCmd = buildPath + '\\build\\bin\\taos.exe '
|
taosCmd = buildPath + '\\build\\bin\\taos.exe '
|
||||||
taosCmd = taosCmd.replace('\\','\\\\')
|
taosCmd = taosCmd.replace('\\','\\\\')
|
||||||
|
@ -231,7 +231,7 @@ class TDTestCase:
|
||||||
tdLog.info("taos -P %s test success"%keyDict['P'])
|
tdLog.info("taos -P %s test success"%keyDict['P'])
|
||||||
else:
|
else:
|
||||||
tdLog.exit("taos -P %s fail"%keyDict['P'])
|
tdLog.exit("taos -P %s fail"%keyDict['P'])
|
||||||
|
|
||||||
tdLog.printNoPrefix("================================ parameter: -f with error sql ")
|
tdLog.printNoPrefix("================================ parameter: -f with error sql ")
|
||||||
pwd=os.getcwd()
|
pwd=os.getcwd()
|
||||||
newDbName="dbf"
|
newDbName="dbf"
|
||||||
|
@ -240,15 +240,15 @@ class TDTestCase:
|
||||||
sql2 = "echo use " + newDbName + " >> " + sqlFile
|
sql2 = "echo use " + newDbName + " >> " + sqlFile
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
sql3 = "echo create table ntbf (ts timestamp, c binary(40)) no this item >> " + sqlFile
|
sql3 = "echo create table ntbf (ts timestamp, c binary(40)) no this item >> " + sqlFile
|
||||||
sql4 = "echo insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\") >> " + sqlFile
|
sql4 = "echo insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\") >> " + sqlFile
|
||||||
else:
|
else:
|
||||||
sql3 = "echo 'create table ntbf (ts timestamp, c binary(40)) no this item' >> " + sqlFile
|
sql3 = "echo 'create table ntbf (ts timestamp, c binary(40)) no this item' >> " + sqlFile
|
||||||
sql4 = "echo 'insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\")' >> " + sqlFile
|
sql4 = "echo 'insert into ntbf values (\"2021-04-01 08:00:00.000\", \"test taos -f1\")(\"2021-04-01 08:00:01.000\", \"test taos -f2\")' >> " + sqlFile
|
||||||
sql5 = "echo show databases >> " + sqlFile
|
sql5 = "echo show databases >> " + sqlFile
|
||||||
os.system(sql1)
|
os.system(sql1)
|
||||||
os.system(sql2)
|
os.system(sql2)
|
||||||
os.system(sql3)
|
os.system(sql3)
|
||||||
os.system(sql4)
|
os.system(sql4)
|
||||||
os.system(sql5)
|
os.system(sql5)
|
||||||
|
|
||||||
keyDict['f'] = pwd + "/0-others/sql.txt"
|
keyDict['f'] = pwd + "/0-others/sql.txt"
|
||||||
|
@ -258,7 +258,7 @@ class TDTestCase:
|
||||||
tdLog.exit("taos -f fail")
|
tdLog.exit("taos -f fail")
|
||||||
|
|
||||||
print ("========== check new db ==========")
|
print ("========== check new db ==========")
|
||||||
tdSql.query("show databases")
|
tdSql.query("show databases")
|
||||||
for i in range(tdSql.queryRows):
|
for i in range(tdSql.queryRows):
|
||||||
#print ("dbseq: %d, dbname: %s"%(i, tdSql.getData(i, 0)))
|
#print ("dbseq: %d, dbname: %s"%(i, tdSql.getData(i, 0)))
|
||||||
if tdSql.getData(i, 0) == newDbName:
|
if tdSql.getData(i, 0) == newDbName:
|
||||||
|
@ -266,9 +266,9 @@ class TDTestCase:
|
||||||
else:
|
else:
|
||||||
tdLog.exit("create db fail after taos -f fail")
|
tdLog.exit("create db fail after taos -f fail")
|
||||||
|
|
||||||
sqlString = "select * from " + newDbName + ".ntbf"
|
sqlString = "select * from " + newDbName + ".ntbf"
|
||||||
tdSql.error(sqlString)
|
tdSql.error(sqlString)
|
||||||
|
|
||||||
shellCmd = "rm -f " + sqlFile
|
shellCmd = "rm -f " + sqlFile
|
||||||
os.system(shellCmd)
|
os.system(shellCmd)
|
||||||
|
|
||||||
|
@ -281,16 +281,16 @@ class TDTestCase:
|
||||||
tdSql.query('drop database %s'%newDbName)
|
tdSql.query('drop database %s'%newDbName)
|
||||||
|
|
||||||
tdLog.printNoPrefix("================================ parameter: -a with error value")
|
tdLog.printNoPrefix("================================ parameter: -a with error value")
|
||||||
#newDbName="dba"
|
#newDbName="dba"
|
||||||
errorPassword = 'errorPassword'
|
errorPassword = 'errorPassword'
|
||||||
sqlString = 'create database ' + newDbName + ';'
|
sqlString = 'create database ' + newDbName + ';'
|
||||||
retCode, retVal = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'a', errorPassword)
|
retCode, retVal = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'a', errorPassword)
|
||||||
if retCode != "TAOS_FAIL":
|
if retCode != "TAOS_FAIL":
|
||||||
tdLog.exit("taos -u %s -a %s"%(keyDict['u'], errorPassword))
|
tdLog.exit("taos -u %s -a %s"%(keyDict['u'], errorPassword))
|
||||||
|
|
||||||
tdLog.printNoPrefix("================================ parameter: -p with error value")
|
tdLog.printNoPrefix("================================ parameter: -p with error value")
|
||||||
#newDbName="dba"
|
#newDbName="dba"
|
||||||
keyDict['p'] = 'errorPassword'
|
keyDict['p'] = 'errorPassword'
|
||||||
retCode, retVal = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'p', keyDict['p'])
|
retCode, retVal = taos_command(buildPath, "u", keyDict['u'], "taos>", keyDict['c'], sqlString, 'p', keyDict['p'])
|
||||||
if retCode == "TAOS_FAIL" and "Authentication failure" in retVal:
|
if retCode == "TAOS_FAIL" and "Authentication failure" in retVal:
|
||||||
tdLog.info("taos -p %s test success"%keyDict['p'])
|
tdLog.info("taos -p %s test success"%keyDict['p'])
|
||||||
|
|
Loading…
Reference in New Issue