提交 2f7644b4 编写于 作者: S Shuduo Sang

fix autopep8 format.

上级 35f5a204
......@@ -29,14 +29,14 @@ class TDTestCase:
def run(self):
chars = string.ascii_uppercase+string.ascii_lowercase
chars = string.ascii_uppercase + string.ascii_lowercase
getDbNameLen = "grep -w '#define TSDB_DB_NAME_LEN' ../../src/inc/taosdef.h|awk '{print $3}'"
dbNameMaxLen = int(subprocess.check_output(getDbNameLen, shell=True))
tdLog.notice("DB name max length is %d" % dbNameMaxLen)
tdLog.info("=============== step1")
db_name = ''.join(random.choices(chars, k=(dbNameMaxLen+1)))
db_name = ''.join(random.choices(chars, k=(dbNameMaxLen + 1)))
tdLog.info('db_name length %d' % len(db_name))
tdLog.info('create database %s' % db_name)
tdSql.error('create database %s' % db_name)
......@@ -52,7 +52,7 @@ class TDTestCase:
tdSql.checkData(0, 0, db_name.lower())
tdLog.info("=============== step3")
db_name = ''.join(random.choices(chars, k=(dbNameMaxLen-1)))
db_name = ''.join(random.choices(chars, k=(dbNameMaxLen - 1)))
tdLog.info('db_name length %d' % len(db_name))
tdLog.info('create database %s' % db_name)
tdSql.execute('create database %s' % db_name)
......
......@@ -25,7 +25,21 @@ class TDTestCase:
tdSql.error("insert into tb values (now, )")
with open("../../README.md", "r") as inputFile:
data = inputFile.read(4084).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
data = inputFile.read(4084).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
tdLog.info("insert %d length data: %s" % (len(data), data))
......@@ -39,17 +53,79 @@ class TDTestCase:
tdLog.info("tdSql.checkData(0, 1, '%s')" % data)
tdSql.checkData(0, 1, data)
tdLog.info('create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))')
tdSql.execute('create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))')
speed = inputFile.read(2044).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
temp = inputFile.read(2040).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
tdLog.info(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))')
tdSql.execute(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))')
speed = inputFile.read(2044).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
temp = inputFile.read(2040).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
tdLog.info("insert into tb values (now+3a, speed, temp)")
tdSql.error("insert into tb values (now+3a, '%s', '%s')" % (speed, temp))
speed = inputFile.read(2040).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
temp = inputFile.read(2044).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
tdSql.error(
"insert into tb values (now+3a, '%s', '%s')" %
(speed, temp))
speed = inputFile.read(2040).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
temp = inputFile.read(2044).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
tdLog.info("insert into tb values (now+4a, speed, temp)")
tdSql.error("insert into tb values (now+4a, '%s', '%s')" % (speed, temp))
tdSql.error(
"insert into tb values (now+4a, '%s', '%s')" %
(speed, temp))
tdLog.info('tdSql.checkRow(2)')
tdSql.checkRows(2)
......
......@@ -33,7 +33,21 @@ class TDTestCase:
tdSql.checkData(0, 1, 'taosdata')
with open("../../README.md", "r") as inputFile:
data = inputFile.read(1021).replace("\n", " ").replace("\\", " ").replace("\'", " ").replace("\"", " ").replace("[", " ").replace("]", " ").replace("!", " ")
data = inputFile.read(1021).replace(
"\n",
" ").replace(
"\\",
" ").replace(
"\'",
" ").replace(
"\"",
" ").replace(
"[",
" ").replace(
"]",
" ").replace(
"!",
" ")
tdLog.info("insert %d length data: %s" % (len(data), data))
......
......@@ -37,7 +37,7 @@ class TDTestCase:
print("==============step2")
tdSql.execute(
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
('2020-05-13 10:00:00.001', 1)
dev_002 VALUES('2020-05-13 10:00:00.001', 1)""")
......
......@@ -37,7 +37,7 @@ class TDTestCase:
print("==============step2")
tdSql.execute(
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
('2020-05-13 10:00:00.001', 1)
dev_002 VALUES('2020-05-13 10:00:00.001', 1)""")
......
......@@ -18,18 +18,24 @@ class TDTestCase:
tdSql.prepare()
getTableNameLen = "grep -w '#define TSDB_TABLE_NAME_LEN' ../../src/inc/taosdef.h|awk '{print $3}'"
tableNameMaxLen = int(subprocess.check_output(getTableNameLen, shell=True))
tableNameMaxLen = int(
subprocess.check_output(
getTableNameLen, shell=True))
tdLog.notice("table name max length is %d" % tableNameMaxLen)
chars = string.ascii_uppercase+string.ascii_lowercase
chars = string.ascii_uppercase + string.ascii_lowercase
tb_name = ''.join(random.choices(chars, k=tableNameMaxLen))
tdLog.info('tb_name length %d' % len(tb_name))
tdLog.info('create table %s (ts timestamp, value int)' % tb_name)
tdSql.error('create table %s (ts timestamp, speed binary(4089))' % tb_name)
tdSql.error(
'create table %s (ts timestamp, speed binary(4089))' %
tb_name)
tb_name = ''.join(random.choices(chars, k=191))
tdLog.info('tb_name length %d' % len(tb_name))
tdLog.info('create table %s (ts timestamp, value int)' % tb_name)
tdSql.execute('create table %s (ts timestamp, speed binary(4089))' % tb_name)
tdSql.execute(
'create table %s (ts timestamp, speed binary(4089))' %
tb_name)
def stop(self):
tdSql.close()
......
......@@ -33,19 +33,27 @@ class TDTestCase:
stb_name = "stb%d" % x
tagSeq = "tag0 int"
for y in range(1, x+1):
for y in range(1, x + 1):
tagSeq = tagSeq + ", tag%d int" % y
tdLog.info("create table %s (ts timestamp, value int) tags (%s)" % (stb_name, tagSeq))
tdSql.execute("create table %s (ts timestamp, value int) tags (%s)" % (stb_name, tagSeq))
tdLog.info(
"create table %s (ts timestamp, value int) tags (%s)" %
(stb_name, tagSeq))
tdSql.execute(
"create table %s (ts timestamp, value int) tags (%s)" %
(stb_name, tagSeq))
tdSql.query("show stables")
tdSql.checkRows(boundary)
stb_name = "stb%d" % (boundary+1)
stb_name = "stb%d" % (boundary + 1)
tagSeq = tagSeq + ", tag%d int" % (boundary)
tdLog.info("create table %s (ts timestamp, value int) tags (%s)" % (stb_name, tagSeq))
tdSql.error("create table %s (ts timestamp, value int) tags (%s)" % (stb_name, tagSeq))
tdLog.info(
"create table %s (ts timestamp, value int) tags (%s)" %
(stb_name, tagSeq))
tdSql.error(
"create table %s (ts timestamp, value int) tags (%s)" %
(stb_name, tagSeq))
tdSql.query("show stables")
tdSql.checkRows(boundary)
......
......@@ -103,7 +103,8 @@ class TDDnode:
self.logDir = "%s/pysim/dnode%d/log" % (self.path, self.index)
self.dataDir = "%s/pysim/dnode%d/data" % (self.path, self.index)
self.cfgDir = "%s/pysim/dnode%d/cfg" % (self.path, self.index)
self.cfgPath = "%s/pysim/dnode%d/cfg/taos.cfg" % (self.path, self.index)
self.cfgPath = "%s/pysim/dnode%d/cfg/taos.cfg" % (
self.path, self.index)
cmd = "rm -rf " + self.dataDir
if os.system(cmd) != 0:
......@@ -188,7 +189,7 @@ class TDDnode:
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("community" not in rootRealPath):
binPath = os.path.join(root, "taosd")
break;
break
else:
projPath = selfPath + "/../../../"
for root, dirs, files in os.walk(projPath):
......@@ -196,7 +197,7 @@ class TDDnode:
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
binPath = os.path.join(root, "taosd")
break;
break
if (binPath == ""):
tdLog.exit("taosd not found!s")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册