提交 881b267d 编写于 作者: B bryanchang0603

[TD-4473] revertalterkeep.py to older version

上级 ed65cfc6
...@@ -116,58 +116,25 @@ class TDTestCase: ...@@ -116,58 +116,25 @@ class TDTestCase:
##TODO: need to wait for TD-4445 to implement the following ##TODO: need to wait for TD-4445 to implement the following
## tests ## tests
# tdSql.prepare()
## preset the keep # tdSql.execute('create table tb (ts timestamp, speed int)')
tdSql.prepare() # tdSql.execute('alter database db keep 10,10,10')
tdSql.execute('create table tb (ts timestamp, speed int)') # tdSql.execute('insert into tb values (now, 10)')
tdSql.execute('alter database db keep 10,10,10') # tdSql.execute('insert into tb values (now + 10m, 10)')
tdSql.execute('insert into tb values (now, 10)') # tdSql.query('select * from tb')
tdSql.execute('insert into tb values (now + 10m, 10)') # tdSql.checkRows(2)
tdSql.query('select * from tb') # tdSql.execute('alter database db keep 40,40,40')
tdSql.checkRows(2)
#after alter from small to large, check if the alter if functioning
#test if change through test.py is consistent with change from taos client
#test case for TD-4459 and TD-4445
tdSql.execute('alter database db keep 40,40,40')
tdSql.query('show databases')
tdSql.checkData(0,7,'40,40,40')
tdSql.error('insert into tb values (now-60d, 10)')
tdSql.execute('insert into tb values (now-30d, 10)')
tdSql.query('select * from tb')
tdSql.checkRows(3)
rowNum = 3
for i in range(30):
rowNum += 1
tdSql.execute('alter database db keep 20,20,20')
tdSql.execute('alter database db keep 40,40,40')
tdSql.query('show databases')
tdSql.checkData(0,7,'40,40,40')
tdSql.error('insert into tb values (now-60d, 10)')
tdSql.execute('insert into tb values (now-30d, 10)')
tdSql.query('select * from tb')
tdSql.checkRows(rowNum)
tdSql.execute('alter database db keep 10,10,10')
tdSql.query('show databases')
tdSql.checkData(0,7,'10,10,10')
# tdSql.execute('alter database db keep 15,15,15')
# tdSql.query('show databases') # tdSql.query('show databases')
# tdSql.checkData(0,7,'15,15,15') # tdSql.checkData(0,7,'40,40,40')
tdSql.execute('insert into tb values (now-15d, 10)') # tdSql.error('insert into tb values (now-60d, 10)')
tdSql.query('select * from tb') # tdSql.execute('insert into tb values (now-30d, 10)')
tdSql.checkRows(rowNum + 1) # tdSql.query('select * from tb')
# tdSql.checkRows(3)
# tdSql.execute('alter database db keep 20,20,20') # tdSql.execute('alter database db keep 20,20,20')
# tdSql.query('show databases') # tdSql.query('show databases')
# tdSql.checkData(0,7,'20,20,20') # tdSql.checkData(0,7,'20,20,20')
# tdSql.error('insert into tb values (now-30d, 10)')
# tdSql.query('show databases')
# tdSql.checkData(0,7,'20,20,20')
# tdSql.query('select * from tb') # tdSql.query('select * from tb')
# tdSql.checkRows(rowNum) # tdSql.checkRows(2)
def stop(self): def stop(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册