feat: taosd full options do

This commit is contained in:
Alex Duan 2024-01-13 14:50:17 +08:00
parent 782607fe68
commit 7b29c97f27
3 changed files with 60 additions and 10 deletions

View File

@ -36,20 +36,48 @@ class TDTestCase(TBase):
self.timestamp_step = 1000 self.timestamp_step = 1000
# taosBenchmark run # taosBenchmark run
etool.runBenchmark(command = f"-d {self.db} -t {self.childtable_count} -n {self.insert_rows} -y") etool.runBenchmark(command = f"-d {self.db} -t {self.childtable_count} -n {self.insert_rows} -v 2 -y")
def doAction(self): def doTaosd(self):
tdLog.info(f"do action.") tdLog.info(f"check taosd command options...")
idx = 1 # dnode1
cfg = sc.dnodeCfgPath(idx)
# dump out sdb # -s
sdb = "./sdb.json" sdb = "./sdb.json"
eos.delFile(sdb) eos.delFile(sdb)
cfg = sc.dnodeCfgPath(1)
etool.runBinFile("taosd", f"-s -c {cfg}") etool.runBinFile("taosd", f"-s -c {cfg}")
self.checkFileExist(sdb) self.checkFileExist(sdb)
# -C
etool.runBinFile("taosd", "-C")
# -k
rets = etool.runBinFile("taosd", "-C")
self.checkListNotEmpty(rets)
# -V
rets = etool.runBinFile("taosd", "-V")
self.checkListNotEmpty(rets)
# --help
rets = etool.runBinFile("taosd", "--help")
self.checkListNotEmpty(rets)
# except input
etool.runBinFile("taosd", "-c")
etool.runBinFile("taosd", "-e")
# stop taosd
sc.dnodeStop(idx)
# other
etool.runBinFile("taosd", f"-dm -c {cfg}")
sc.dnodeStop(idx)
etool.runBinFile("taosd", "-a http://192.168.1.10")
etool.runBinFile("taosd", f"-E abc -c {cfg}")
etool.runBinFile("taosd", f"-e abc -c {cfg}")
def doTaos(self):
tdLog.info(f"check taos command options...")
# run # run
def run(self): def run(self):
@ -59,7 +87,10 @@ class TDTestCase(TBase):
self.insertData() self.insertData()
# do action # do action
self.doAction() self.doTaosd()
# do taos
self.doTaos()
tdLog.success(f"{__file__} successfully executed") tdLog.success(f"{__file__} successfully executed")

View File

@ -189,7 +189,13 @@ class TBase:
return False return False
# check file exist # check file exist
def checkFileExist(self, pathFile): def checkFileExist(self, pathFile):
if os.path.exists(pathFile) == False: if os.path.exists(pathFile) == False:
tdLog.exit(f"file not exist {pathFile}") tdLog.exit(f"file not exist {pathFile}")
# check list not exist
def checkListNotEmpty(self, lists, tips=""):
if len(lists) == 0:
tdLog.exit(f"list is empty {tips}")

View File

@ -28,6 +28,19 @@ class srvCtl:
self.mLevel = 0 self.mLevel = 0
self.mLevelDisk = 0 self.mLevelDisk = 0
#
# control server
#
# start
def dnodeStart(self, idx):
return tdDnodes.starttaosd(idx)
# stop
def dnodeStop(self, idx):
return tdDnodes.stoptaosd(idx)
# #
# about path # about path
# #