diff --git a/tests/pytest/tools/taosdumpTest2.py b/tests/pytest/tools/taosdumpTest2.py index 952f68b47767e63cf96f95445282a4f2692b9e50..1aeda47e9c0ed4ea3c0acd90d50c919a9ad6bb1a 100644 --- a/tests/pytest/tools/taosdumpTest2.py +++ b/tests/pytest/tools/taosdumpTest2.py @@ -59,6 +59,11 @@ class TDTestCase: return v def run(self): + if not os.path.exists("./taosdumptest/tmp"): + os.makedirs("./taosdumptest/tmp") + else: + print("directory exists") + 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)") @@ -80,17 +85,17 @@ class TDTestCase: else: tdLog.info("taosdump found in %s" % binPath) - os.system("rm /tmp/*.sql") - os.system("rm /tmp/*.avro*") + os.system("rm ./taosdumptest/tmp/*.sql") + os.system("rm ./taosdumptest/tmp/*.avro*") os.system( - "%s --databases db -o /tmp " % + "%s --databases db -o ./taosdumptest/tmp " % binPath) tdSql.execute("drop database db") tdSql.query("show databases") tdSql.checkRows(0) - os.system("%s -i /tmp -y" % binPath) + os.system("%s -i ./taosdumptest/tmp -y" % binPath) tdSql.query("show databases") tdSql.checkRows(1) @@ -115,15 +120,15 @@ class TDTestCase: self.generateString(16374), self.generateString(16374))) - os.system("rm /tmp/*.sql") - os.system("rm /tmp/*.avro*") - os.system("%s -D test -o /tmp -y" % binPath) + os.system("rm ./taosdumptest/tmp/*.sql") + os.system("rm ./taosdumptest/tmp/*.avro*") + os.system("%s -D test -o ./taosdumptest/tmp -y" % binPath) tdSql.execute("drop database test") tdSql.query("show databases") tdSql.checkRows(1) - os.system("%s -i /tmp -y" % binPath) + os.system("%s -i ./taosdumptest/tmp -y" % binPath) tdSql.execute("use test") tdSql.error("show vnodes '' ")