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

test: add platform logic (#11459)

* [TD-13558]<feature>: taos shell refactor

add taosTools as submodule

* add tools/taos-tools

* add more client interface for taosTools compile

* update taos-tools

* update taos-tools

* refactor shell

* [TD-13558]<feature>: taos shell test speed

* [TD-13558]<feature>: taos -n startup works

* taos -n rpc works

* taos -n server works

* cleanup code since no endPort in 3.0

* update taos-tools

* [TD-13558]<feature>: taos -C works

* improve taos shell -c WIP

* update taos-tools

* add demoapi.c

* adjust show databases result for 3.0

* test: add platform logic
上级 4e9a9318
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import platform
import sys import sys
from util.log import * from util.log import *
from util.cases import * from util.cases import *
...@@ -70,32 +71,27 @@ class TDTestCase: ...@@ -70,32 +71,27 @@ class TDTestCase:
tdLog.info("tdSql.checkData(0, 0, '34567')") tdLog.info("tdSql.checkData(0, 0, '34567')")
tdSql.checkData(0, 0, '34567') tdSql.checkData(0, 0, '34567')
tdLog.info("insert into tb values (now+4a, \"'';\")") tdLog.info("insert into tb values (now+4a, \"'';\")")
config_dir = subprocess.check_output(
str("ps -ef |grep dnode1|grep -v grep |awk '{print $NF}'"),
stderr=subprocess.STDOUT,
shell=True).decode('utf-8').replace(
'\n',
'')
binPath = self.getPath("taos") if platform.system() == "Linux":
if (binPath == ""): config_dir = subprocess.check_output(
tdLog.exit("taos not found!") str("ps -ef |grep dnode1|grep -v grep |awk '{print $NF}'"),
else: stderr=subprocess.STDOUT,
tdLog.info("taos found: %s" % binPath) shell=True).decode('utf-8').replace(
'\n',
'')
result = ''.join( binPath = self.getPath("taos")
os.popen( if (binPath == ""):
r"""%s -s "insert into db.tb values (now+4a, \"'';\")" -c %s""" % tdLog.exit("taos not found!")
(binPath, (config_dir))).readlines()) else:
if "Query OK" not in result: tdLog.info("taos found: %s" % binPath)
tdLog.exit("err:insert '';")
tdLog.info('drop database db') result = ''.join(
tdSql.execute('drop database db') os.popen(
tdLog.info('show databases') r"""%s -s "insert into db.tb values (now+4a, \"'';\")" -c %s""" %
tdSql.query('show databases') (binPath, (config_dir))).readlines())
tdLog.info('tdSql.checkRow(0)') if "Query OK" not in result:
tdSql.checkRows(1) tdLog.exit("err:insert '';")
# convert end
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册