提交 a4189fac 编写于 作者: L liuyq-617

modify time in another way

上级 4bec4814
......@@ -44,7 +44,8 @@ class TDTestRetetion:
caller = inspect.getframeinfo(inspect.stack()[1][0])
args = (caller.filename, caller.lineno, sql, self.queryRows, expectRows)
os.system("sudo timedatectl set-ntp true")
time.sleep(40)
os.system("date -s '%s'"%(datetime.datetime.now()+datetime.timedelta(hours=1)))
time.sleep(5)
tdLog.exit("%s(%d) failed: sql:%s, queryRows:%d != expect:%d" % args)
def run(self):
......@@ -63,7 +64,7 @@ class TDTestRetetion:
tdLog.info("=============== step2")
tdDnodes.stop(1)
os.system("sudo timedatectl set-ntp false")
os.system("sudo date -s $(date -d \"${DATE} 2 days\" \"+%Y%m%d\")")
os.system("date -s '%s'"%(datetime.datetime.now()+datetime.timedelta(hours=48)))
tdDnodes.start(1)
cmd = 'insert into test values(now,5);'
tdDnodes.stop(1)
......@@ -79,7 +80,7 @@ class TDTestRetetion:
self.checkRows(5,cmd)
tdLog.info("=============== step3")
tdDnodes.stop(1)
os.system("sudo date -s $(date -d \"${DATE} 2 days\" \"+%Y%m%d\")")
os.system("date -s '%s'"%(datetime.datetime.now()+datetime.timedelta(hours=48)))
tdDnodes.start(1)
tdLog.info(cmd)
tdSql.execute(cmd)
......@@ -110,7 +111,8 @@ class TDTestRetetion:
def stop(self):
os.system("sudo timedatectl set-ntp true")
time.sleep(40)
os.system("date -s '%s'"%(datetime.datetime.now()+datetime.timedelta(hours=1)))
time.sleep(5)
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册