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

[TD-2984] <fix>: combine taosdemo and taosdemox.

上级 0dc94d66
...@@ -26,6 +26,7 @@ class TDTestCase: ...@@ -26,6 +26,7 @@ class TDTestCase:
self.numberOfTables = 10000 self.numberOfTables = 10000
self.numberOfRecords = 100 self.numberOfRecords = 100
def getBuildPath(self): def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
...@@ -38,9 +39,10 @@ class TDTestCase: ...@@ -38,9 +39,10 @@ class TDTestCase:
if ("taosd" in files): if ("taosd" 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 run(self): def run(self):
tdSql.prepare() tdSql.prepare()
buildPath = self.getBuildPath() buildPath = self.getBuildPath()
...@@ -48,17 +50,20 @@ class TDTestCase: ...@@ -48,17 +50,20 @@ class TDTestCase:
tdLog.exit("taosd not found!") tdLog.exit("taosd not found!")
else: else:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/" binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -M -t %d -n %d -x" % (binPath,self.numberOfTables, self.numberOfRecords)) os.system("%staosdemo -y -M -t %d -n %d -x" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute("use test") tdSql.execute("use test")
tdSql.query("select count(*) from meters") tdSql.query("select count(*) from meters")
tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords) tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords)
tdSql.query("select sum(col1) from test.meters interval(1h) sliding(30m)") tdSql.query(
"select sum(col1) from test.meters interval(1h) sliding(30m)")
tdSql.checkRows(2) tdSql.checkRows(2)
tdSql.query("select apercentile(col1, 1) from test.meters interval(10s)") tdSql.query(
"select apercentile(col1, 1) from test.meters interval(10s)")
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.error("select loc, count(loc) from test.meters") tdSql.error("select loc, count(loc) from test.meters")
......
...@@ -31,7 +31,8 @@ class TDTestCase: ...@@ -31,7 +31,8 @@ class TDTestCase:
def insertDataAndAlterTable(self, threadID): def insertDataAndAlterTable(self, threadID):
if(threadID == 0): if(threadID == 0):
os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords)) os.system("taosdemo -y -t %d -n %d -x" %
(self.numberOfTables, self.numberOfRecords))
if(threadID == 1): if(threadID == 1):
time.sleep(2) time.sleep(2)
print("use test") print("use test")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册