未验证 提交 40757bf0 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-14540]<impr>: taosdump code cleanup (#11314)

* [TD-14540]<impr>: taosdump code cleanup

* update taos-tools

* refine 5-taos-tools/taosdump/taosdumpTestInspect.py

* [TD-14540]<impr>: refine tools/taosdumpTest2.py
上级 6c5a23ac
...@@ -59,6 +59,11 @@ class TDTestCase: ...@@ -59,6 +59,11 @@ class TDTestCase:
return v return v
def run(self): def run(self):
if not os.path.exists("./taosdumptest/tmp"):
os.makedirs("./taosdumptest/tmp")
else:
print("directory exists")
tdSql.prepare() tdSql.prepare()
tdSql.execute("create table st(ts timestamp, c1 timestamp, c2 int, c3 bigint, c4 float, c5 double, c6 binary(8), c7 smallint, c8 tinyint, c9 bool, c10 nchar(8)) tags(t1 int)") tdSql.execute("create table st(ts timestamp, c1 timestamp, c2 int, c3 bigint, c4 float, c5 double, c6 binary(8), c7 smallint, c8 tinyint, c9 bool, c10 nchar(8)) tags(t1 int)")
...@@ -80,17 +85,17 @@ class TDTestCase: ...@@ -80,17 +85,17 @@ class TDTestCase:
else: else:
tdLog.info("taosdump found in %s" % binPath) tdLog.info("taosdump found in %s" % binPath)
os.system("rm /tmp/*.sql") os.system("rm ./taosdumptest/tmp/*.sql")
os.system("rm /tmp/*.avro*") os.system("rm ./taosdumptest/tmp/*.avro*")
os.system( os.system(
"%s --databases db -o /tmp " % "%s --databases db -o ./taosdumptest/tmp " %
binPath) binPath)
tdSql.execute("drop database db") tdSql.execute("drop database db")
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(0) tdSql.checkRows(0)
os.system("%s -i /tmp -y" % binPath) os.system("%s -i ./taosdumptest/tmp -y" % binPath)
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(1) tdSql.checkRows(1)
...@@ -115,15 +120,15 @@ class TDTestCase: ...@@ -115,15 +120,15 @@ class TDTestCase:
self.generateString(16374), self.generateString(16374),
self.generateString(16374))) self.generateString(16374)))
os.system("rm /tmp/*.sql") os.system("rm ./taosdumptest/tmp/*.sql")
os.system("rm /tmp/*.avro*") os.system("rm ./taosdumptest/tmp/*.avro*")
os.system("%s -D test -o /tmp -y" % binPath) os.system("%s -D test -o ./taosdumptest/tmp -y" % binPath)
tdSql.execute("drop database test") tdSql.execute("drop database test")
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(1) tdSql.checkRows(1)
os.system("%s -i /tmp -y" % binPath) os.system("%s -i ./taosdumptest/tmp -y" % binPath)
tdSql.execute("use test") tdSql.execute("use test")
tdSql.error("show vnodes '' ") tdSql.error("show vnodes '' ")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册