add insert/int.py and insert/float.py to test insert function.
[TD-167]
This commit is contained in:
parent
0b8123f5de
commit
46a7c3c912
|
@ -1,3 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
python3 ./test.py -f insert/basic.py $1
|
python3 ./test.py -f insert/basic.py $1
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py -s $1
|
||||||
|
sleep 1
|
||||||
|
python3 ./test.py -f insert/int.py $1
|
||||||
|
python3 ./test.py -s $1
|
||||||
|
sleep 1
|
||||||
|
python3 ./test.py -f insert/float.py $1
|
||||||
|
python3 ./test.py -s $1
|
||||||
|
|
|
@ -100,12 +100,15 @@ if __name__ == "__main__":
|
||||||
tdDnodes.deploy(1)
|
tdDnodes.deploy(1)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
conn = taos.connect(
|
conn = taos.connect(
|
||||||
host='192.168.0.1',
|
host='127.0.0.1',
|
||||||
config=tdDnodes.getSimCfgPath())
|
config=tdDnodes.getSimCfgPath())
|
||||||
if fileName == "all":
|
if fileName == "all":
|
||||||
tdCases.runAllLinux(conn)
|
tdCases.runAllLinux(conn)
|
||||||
else:
|
else:
|
||||||
tdCases.runOneLinux(conn, fileName)
|
try:
|
||||||
|
tdCases.runOneLinux(conn, fileName)
|
||||||
|
except Exception as e:
|
||||||
|
tdLog.exit("failed: %s" % fileName)
|
||||||
conn.close()
|
conn.close()
|
||||||
else:
|
else:
|
||||||
tdLog.notice("Procedures for tdengine deployed in %s" % (masterIp))
|
tdLog.notice("Procedures for tdengine deployed in %s" % (masterIp))
|
||||||
|
|
|
@ -67,12 +67,16 @@ class TDCases:
|
||||||
if tmp.name.find(fileName) != -1:
|
if tmp.name.find(fileName) != -1:
|
||||||
case = testModule.TDTestCase()
|
case = testModule.TDTestCase()
|
||||||
case.init(conn)
|
case.init(conn)
|
||||||
case.run()
|
try:
|
||||||
|
case.run()
|
||||||
|
except Exception as e:
|
||||||
|
tdLog.notice(repr(e))
|
||||||
|
tdLog.exit("failed: %s" % fileName)
|
||||||
case.stop()
|
case.stop()
|
||||||
runNum += 1
|
runNum += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tdLog.notice("total %d Linux test case(s) executed" % (runNum))
|
tdLog.success("total %d Linux test case(s) executed" % (runNum))
|
||||||
|
|
||||||
def runAllWindows(self, conn):
|
def runAllWindows(self, conn):
|
||||||
# TODO: load all Windows cases here
|
# TODO: load all Windows cases here
|
||||||
|
|
|
@ -19,12 +19,19 @@ from util.log import *
|
||||||
|
|
||||||
|
|
||||||
class TDSimClient:
|
class TDSimClient:
|
||||||
|
def __init__(self):
|
||||||
|
self.testCluster = False
|
||||||
|
|
||||||
def init(self, path):
|
def init(self, path):
|
||||||
|
self.__init__()
|
||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
def getCfgDir(self):
|
def getCfgDir(self):
|
||||||
return self.cfgDir
|
return self.cfgDir
|
||||||
|
|
||||||
|
def setTestCluster(self, value):
|
||||||
|
self.testCluster = value
|
||||||
|
|
||||||
def cfg(self, option, value):
|
def cfg(self, option, value):
|
||||||
cmd = "echo '%s %s' >> %s" % (option, value, self.cfgPath)
|
cmd = "echo '%s %s' >> %s" % (option, value, self.cfgPath)
|
||||||
if os.system(cmd) != 0:
|
if os.system(cmd) != 0:
|
||||||
|
@ -55,8 +62,9 @@ class TDSimClient:
|
||||||
if os.system(cmd) != 0:
|
if os.system(cmd) != 0:
|
||||||
tdLog.exit(cmd)
|
tdLog.exit(cmd)
|
||||||
|
|
||||||
self.cfg("masterIp", "192.168.0.1")
|
if self.testCluster:
|
||||||
self.cfg("secondIp", "192.168.0.2")
|
self.cfg("masterIp", "192.168.0.1")
|
||||||
|
self.cfg("secondIp", "192.168.0.2")
|
||||||
self.cfg("logDir", self.logDir)
|
self.cfg("logDir", self.logDir)
|
||||||
self.cfg("numOfLogLines", "100000000")
|
self.cfg("numOfLogLines", "100000000")
|
||||||
self.cfg("numOfThreadsPerCore", "2.0")
|
self.cfg("numOfThreadsPerCore", "2.0")
|
||||||
|
@ -128,11 +136,12 @@ class TDDnode:
|
||||||
if self.testCluster:
|
if self.testCluster:
|
||||||
self.startIP()
|
self.startIP()
|
||||||
|
|
||||||
self.cfg("masterIp", "192.168.0.1")
|
if self.testCluster:
|
||||||
self.cfg("secondIp", "192.168.0.2")
|
self.cfg("masterIp", "192.168.0.1")
|
||||||
self.cfg("publicIp", "192.168.0.%d" % (self.index))
|
self.cfg("secondIp", "192.168.0.2")
|
||||||
self.cfg("internalIp", "192.168.0.%d" % (self.index))
|
self.cfg("publicIp", "192.168.0.%d" % (self.index))
|
||||||
self.cfg("privateIp", "192.168.0.%d" % (self.index))
|
self.cfg("internalIp", "192.168.0.%d" % (self.index))
|
||||||
|
self.cfg("privateIp", "192.168.0.%d" % (self.index))
|
||||||
self.cfg("dataDir", self.dataDir)
|
self.cfg("dataDir", self.dataDir)
|
||||||
self.cfg("logDir", self.logDir)
|
self.cfg("logDir", self.logDir)
|
||||||
self.cfg("numOfLogLines", "100000000")
|
self.cfg("numOfLogLines", "100000000")
|
||||||
|
@ -291,10 +300,6 @@ class TDDnodes:
|
||||||
for i in range(len(self.dnodes)):
|
for i in range(len(self.dnodes)):
|
||||||
self.dnodes[i].init(self.path)
|
self.dnodes[i].init(self.path)
|
||||||
|
|
||||||
self.sim = TDSimClient()
|
|
||||||
self.sim.init(self.path)
|
|
||||||
self.sim.deploy()
|
|
||||||
|
|
||||||
def setTestCluster(self, value):
|
def setTestCluster(self, value):
|
||||||
self.testCluster = value
|
self.testCluster = value
|
||||||
|
|
||||||
|
@ -302,6 +307,11 @@ class TDDnodes:
|
||||||
self.valgrind = value
|
self.valgrind = value
|
||||||
|
|
||||||
def deploy(self, index):
|
def deploy(self, index):
|
||||||
|
self.sim = TDSimClient()
|
||||||
|
self.sim.init(self.path)
|
||||||
|
self.sim.setTestCluster(self.testCluster)
|
||||||
|
self.sim.deploy()
|
||||||
|
|
||||||
self.check(index)
|
self.check(index)
|
||||||
self.dnodes[index - 1].setTestCluster(self.testCluster)
|
self.dnodes[index - 1].setTestCluster(self.testCluster)
|
||||||
self.dnodes[index - 1].setValgrind(self.valgrind)
|
self.dnodes[index - 1].setValgrind(self.valgrind)
|
||||||
|
|
|
@ -63,7 +63,7 @@ class TDSql:
|
||||||
def checkRows(self, expectRows):
|
def checkRows(self, expectRows):
|
||||||
if self.queryRows != expectRows:
|
if self.queryRows != expectRows:
|
||||||
tdLog.exit(
|
tdLog.exit(
|
||||||
"sql:%.40s, queryRows:%d != expect:%d" %
|
"failed: sql:%.40s, queryRows:%d != expect:%d" %
|
||||||
(self.sql, self.queryRows, expectRows))
|
(self.sql, self.queryRows, expectRows))
|
||||||
tdLog.info("sql:%.40s, queryRows:%d == expect:%d" %
|
tdLog.info("sql:%.40s, queryRows:%d == expect:%d" %
|
||||||
(self.sql, self.queryRows, expectRows))
|
(self.sql, self.queryRows, expectRows))
|
||||||
|
|
Loading…
Reference in New Issue