提交 46a7c3c9 编写于 作者: sangshuduo's avatar sangshuduo

add insert/int.py and insert/float.py to test insert function.

[TD-167]
上级 0b8123f5
#!/bin/bash
python3 ./test.py -f insert/basic.py $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.start(1)
conn = taos.connect(
host='192.168.0.1',
host='127.0.0.1',
config=tdDnodes.getSimCfgPath())
if fileName == "all":
tdCases.runAllLinux(conn)
else:
tdCases.runOneLinux(conn, fileName)
try:
tdCases.runOneLinux(conn, fileName)
except Exception as e:
tdLog.exit("failed: %s" % fileName)
conn.close()
else:
tdLog.notice("Procedures for tdengine deployed in %s" % (masterIp))
......
......@@ -67,12 +67,16 @@ class TDCases:
if tmp.name.find(fileName) != -1:
case = testModule.TDTestCase()
case.init(conn)
case.run()
try:
case.run()
except Exception as e:
tdLog.notice(repr(e))
tdLog.exit("failed: %s" % fileName)
case.stop()
runNum += 1
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):
# TODO: load all Windows cases here
......
......@@ -19,12 +19,19 @@ from util.log import *
class TDSimClient:
def __init__(self):
self.testCluster = False
def init(self, path):
self.__init__()
self.path = path
def getCfgDir(self):
return self.cfgDir
def setTestCluster(self, value):
self.testCluster = value
def cfg(self, option, value):
cmd = "echo '%s %s' >> %s" % (option, value, self.cfgPath)
if os.system(cmd) != 0:
......@@ -55,8 +62,9 @@ class TDSimClient:
if os.system(cmd) != 0:
tdLog.exit(cmd)
self.cfg("masterIp", "192.168.0.1")
self.cfg("secondIp", "192.168.0.2")
if self.testCluster:
self.cfg("masterIp", "192.168.0.1")
self.cfg("secondIp", "192.168.0.2")
self.cfg("logDir", self.logDir)
self.cfg("numOfLogLines", "100000000")
self.cfg("numOfThreadsPerCore", "2.0")
......@@ -128,11 +136,12 @@ class TDDnode:
if self.testCluster:
self.startIP()
self.cfg("masterIp", "192.168.0.1")
self.cfg("secondIp", "192.168.0.2")
self.cfg("publicIp", "192.168.0.%d" % (self.index))
self.cfg("internalIp", "192.168.0.%d" % (self.index))
self.cfg("privateIp", "192.168.0.%d" % (self.index))
if self.testCluster:
self.cfg("masterIp", "192.168.0.1")
self.cfg("secondIp", "192.168.0.2")
self.cfg("publicIp", "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("logDir", self.logDir)
self.cfg("numOfLogLines", "100000000")
......@@ -291,10 +300,6 @@ class TDDnodes:
for i in range(len(self.dnodes)):
self.dnodes[i].init(self.path)
self.sim = TDSimClient()
self.sim.init(self.path)
self.sim.deploy()
def setTestCluster(self, value):
self.testCluster = value
......@@ -302,6 +307,11 @@ class TDDnodes:
self.valgrind = value
def deploy(self, index):
self.sim = TDSimClient()
self.sim.init(self.path)
self.sim.setTestCluster(self.testCluster)
self.sim.deploy()
self.check(index)
self.dnodes[index - 1].setTestCluster(self.testCluster)
self.dnodes[index - 1].setValgrind(self.valgrind)
......
......@@ -63,7 +63,7 @@ class TDSql:
def checkRows(self, expectRows):
if self.queryRows != expectRows:
tdLog.exit(
"sql:%.40s, queryRows:%d != expect:%d" %
"failed: sql:%.40s, queryRows:%d != expect:%d" %
(self.sql, self.queryRows, expectRows))
tdLog.info("sql:%.40s, queryRows:%d == expect:%d" %
(self.sql, self.queryRows, expectRows))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册