提交 f7181a5e 编写于 作者: S Shuduo Sang

add function to delete data files.

上级 c736e05c
...@@ -108,6 +108,18 @@ class Test: ...@@ -108,6 +108,18 @@ class Test:
tdDnodes.start(1) tdDnodes.start(1)
tdSql.prepare() tdSql.prepare()
def delete_datafiles(self):
tdLog.info("delete data files")
dnodesDir = tdDnodes.getDnodesRootDir()
dataDir = dnodesDir + '/dnode1/*'
deleteCmd = 'rm -rf %s' % dataDir
os.system(deleteCmd)
self.current_tb = ""
self.last_tb = ""
self.written = 0
tdDnodes.start(1)
tdSql.prepare()
class TDTestCase: class TDTestCase:
def init(self, conn, logSql): def init(self, conn, logSql):
...@@ -129,10 +141,11 @@ class TDTestCase: ...@@ -129,10 +141,11 @@ class TDTestCase:
7: test.drop_table, 7: test.drop_table,
8: test.reset_query_cache, 8: test.reset_query_cache,
9: test.reset_database, 9: test.reset_database,
10: test.delete_datafiles,
} }
for x in range(1, 100): for x in range(1, 100):
r = random.randint(1, 9) r = random.randint(1, 10)
tdLog.notice("iteration %d run func %d" % (x, r)) tdLog.notice("iteration %d run func %d" % (x, r))
switch.get(r, lambda: "ERROR")() switch.get(r, lambda: "ERROR")()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册