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

update windows test framwork

上级 6cfbf4c5
python .\test.py -f insert\basic.py -w 1 -m u05 python .\test.py -f insert\basic.py
python .\test.py -f insert\int.py -w 1 -m u05 python .\test.py -f insert\int.py
python .\test.py -f insert\float.py -w 1 -m u05 python .\test.py -f insert\float.py
python .\test.py -f insert\bigint.py -w 1 -m u05 python .\test.py -f insert\bigint.py
python .\test.py -f insert\bool.py -w 1 -m u05 python .\test.py -f insert\bool.py
python .\test.py -f insert\double.py -w 1 -m u05 python .\test.py -f insert\double.py
python .\test.py -f insert\smallint.py -w 1 -m u05 python .\test.py -f insert\smallint.py
python .\test.py -f insert\tinyint.py -w 1 -m u05 python .\test.py -f insert\tinyint.py
python .\test.py -f insert\date.py -w 1 -m u05 python .\test.py -f insert\date.py
python .\test.py -f insert\binary.py -w 1 -m u05 python .\test.py -f insert\binary.py
python .\test.py -f insert\nchar.py -w 1 -m u05 python .\test.py -f insert\nchar.py
python .\test.py -f query\filter.py -w 1 -m u05 python .\test.py -f query\filter.py
python .\test.py -f query\filterCombo.py -w 1 -m u05 python .\test.py -f query\filterCombo.py
python .\test.py -f query\queryNormal.py -w 1 -m u05 python .\test.py -f query\queryNormal.py
python .\test.py -f query\queryError.py -w 1 -m u05 python .\test.py -f query\queryError.py
python .\test.py -f query\filterAllIntTypes.py -w 1 -m u05 python .\test.py -f query\filterAllIntTypes.py
python .\test.py -f query\filterFloatAndDouble.py -w 1 -m u05 python .\test.py -f query\filterFloatAndDouble.py
python .\test.py -f query\filterOtherTypes.py -w 1 -m u05 python .\test.py -f query\filterOtherTypes.py
python .\test.py -f query\querySort.py -w 1 -m u05 python .\test.py -f query\querySort.py
python .\test.py -f query\queryJoin.py -w 1 -m u05 python .\test.py -f query\queryJoin.py
\ No newline at end of file \ No newline at end of file
# -*- 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 *
...@@ -53,9 +54,10 @@ class TDTestCase: ...@@ -53,9 +54,10 @@ 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', '') if platform.system() == "Linux":
result = ''.join(os.popen(r"""taos -s "insert into db.tb values (now+4a, \"'';\")" -c %s"""%(config_dir)).readlines()) 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', '')
if "Query OK" not in result: tdLog.exit("err:insert '';") result = ''.join(os.popen(r"""taos -s "insert into db.tb values (now+4a, \"'';\")" -c %s"""%(config_dir)).readlines())
if "Query OK" not in result: tdLog.exit("err:insert '';")
tdLog.info('drop database db') tdLog.info('drop database db')
tdSql.execute('drop database db') tdSql.execute('drop database db')
tdLog.info('show databases') tdLog.info('show databases')
......
...@@ -15,6 +15,7 @@ import sys ...@@ -15,6 +15,7 @@ import sys
from util.log import * from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
import platform
class TDTestCase: class TDTestCase:
...@@ -37,7 +38,7 @@ class TDTestCase: ...@@ -37,7 +38,7 @@ class TDTestCase:
tdSql.error("insert into tb values (now, 'taosdata001')") tdSql.error("insert into tb values (now, 'taosdata001')")
tdSql.error("insert into tb(now, 😀)") if platform.system() == "Linux" : tdSql.error("insert into tb(now, 😀)")
tdSql.query("select * from tb") tdSql.query("select * from tb")
tdSql.checkRows(2) tdSql.checkRows(2)
......
...@@ -17,6 +17,7 @@ from util.log import * ...@@ -17,6 +17,7 @@ from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
from util.dnodes import * from util.dnodes import *
import platform
class TDTestCase: class TDTestCase:
def init(self, conn, logSql): def init(self, conn, logSql):
...@@ -137,8 +138,9 @@ class TDTestCase: ...@@ -137,8 +138,9 @@ class TDTestCase:
tdSql.checkData(1, 1, 421) tdSql.checkData(1, 1, 421)
tdSql.checkData(1, 2, "tm1") tdSql.checkData(1, 2, "tm1")
tdDnodes.stop(1) if platform.system() == "Linux":
tdDnodes.start(1) tdDnodes.stop(1)
tdDnodes.start(1)
tdSql.query("select last(*) from m1 group by tbname") tdSql.query("select last(*) from m1 group by tbname")
tdSql.checkData(0, 0, "2020-03-01 01:01:01") tdSql.checkData(0, 0, "2020-03-01 01:01:01")
......
@echo off @echo off
echo locale en_US.UTF-8>"C:\\TDengine\\cfg\\taos.cfg" SETLOCAL EnableDelayedExpansion
echo charset UTF-8>>"C:\\TDengine\\cfg\\taos.cfg" for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( set "DEL=%%a")
for /F "usebackq tokens=*" %%i in ( f.bat) do ( for /F "usebackq tokens=*" %%i in (fulltest.bat) do (
echo Processing %%i echo Processing %%i
call %%i ARG1 > result.txt 2>error.txt call %%i ARG1 -w 1 -m %1 > result.txt 2>error.txt
if errorlevel 1 (echo failed) else (echo sucess) if errorlevel 1 ( call :colorEcho 0c "failed" &echo. ) else ( call :colorEcho 0a "Success" &echo. )
) )
@echo on
\ No newline at end of file exit
:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
\ No newline at end of file
...@@ -15,6 +15,8 @@ import sys ...@@ -15,6 +15,8 @@ import sys
import os import os
import os.path import os.path
import platform import platform
import pathlib
import shutil
import subprocess import subprocess
from time import sleep from time import sleep
from util.log import * from util.log import *
...@@ -62,32 +64,45 @@ class TDSimClient: ...@@ -62,32 +64,45 @@ class TDSimClient:
cmd = "echo %s %s >> %s" % (option, value, self.cfgPath) cmd = "echo %s %s >> %s" % (option, value, self.cfgPath)
if os.system(cmd) != 0: if os.system(cmd) != 0:
tdLog.exit(cmd) tdLog.exit(cmd)
def os_string(self,path):
os_path = path.replace("/",os.sep)
return os_path
def deploy(self): def deploy(self):
self.logDir = "%s/sim/psim/log" % (self.path) self.logDir = self.os_string("%s/sim/psim/log" % (self.path))
self.cfgDir = "%s/sim/psim/cfg" % (self.path) self.cfgDir = self.os_string("%s/sim/psim/cfg" % (self.path))
self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path) self.cfgPath = self.os_string("%s/sim/psim/cfg/taos.cfg" % (self.path))
cmd = "rm -rf " + self.logDir # cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0: # if os.system(cmd) != 0:
tdLog.exit(cmd) # tdLog.exit(cmd)
if os.path.exists(self.logDir):
cmd = "mkdir -p " + self.logDir try:
if os.system(cmd) != 0: shutil.rmtree(self.logDir)
tdLog.exit(cmd) except:
tdLog.exit("del %s failed"%self.logDir)
cmd = "rm -rf " + self.cfgDir # cmd = "mkdir -p " + self.logDir
if os.system(cmd) != 0: # if os.system(cmd) != 0:
tdLog.exit(cmd) # tdLog.exit(cmd)
os.makedirs(self.logDir)
cmd = "mkdir -p " + self.cfgDir # cmd = "rm -rf " + self.cfgDir
if os.system(cmd) != 0: # if os.system(cmd) != 0:
tdLog.exit(cmd) # tdLog.exit(cmd)
if os.path.exists(self.cfgDir):
cmd = "touch " + self.cfgPath try:
if os.system(cmd) != 0: shutil.rmtree(self.cfgDir)
tdLog.exit(cmd) except:
tdLog.exit("del %s failed"%self.cfgDir)
# cmd = "mkdir -p " + self.cfgDir
# if os.system(cmd) != 0:
# tdLog.exit(cmd)
os.makedirs(self.cfgDir)
# cmd = "touch " + self.cfgPath
# if os.system(cmd) != 0:
# tdLog.exit(cmd)
try:
pathlib.Path(self.cfgPath).touch()
except:
tdLog.exit("create %s failed"%self.cfgPath)
if self.testCluster: if self.testCluster:
self.cfg("masterIp", "192.168.0.1") self.cfg("masterIp", "192.168.0.1")
self.cfg("secondIp", "192.168.0.2") self.cfg("secondIp", "192.168.0.2")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册