From 5e47bc8e3a08e54b578c47a7dc8b672af1715700 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 13 Jan 2024 15:45:21 +0800 Subject: [PATCH] fix: add exeNoWait --- tests/army/community/cmdline/fullopt.py | 7 +++---- tests/army/frame/eos.py | 7 +++++-- tests/army/frame/etool.py | 7 +++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/army/community/cmdline/fullopt.py b/tests/army/community/cmdline/fullopt.py index dfaee22c2f..f6baf5b004 100644 --- a/tests/army/community/cmdline/fullopt.py +++ b/tests/army/community/cmdline/fullopt.py @@ -72,15 +72,14 @@ class TDTestCase(TBase): # stop taosd sc.dnodeStop(idx) # other - etool.exeBinFile("taosd", f"-dm -c {cfg}") + etool.exeBinFile("taosd", f"-dm -c {cfg}", False) sc.dnodeStop(idx) etool.exeBinFile("taosd", "-a http://192.168.1.10") #exe - etool.exeBinFile("taosd", f"-E abc -c {cfg}") + etool.exeBinFile("taosd", f"-E abc -c {cfg}", False) sc.dnodeStop(idx) - etool.exeBinFile("taosd", f"-e def -c {cfg}") - + etool.exeBinFile("taosd", f"-e def -c {cfg}", False) # run def run(self): diff --git a/tests/army/frame/eos.py b/tests/army/frame/eos.py index bd84927c78..6bd8fd3aab 100644 --- a/tests/army/frame/eos.py +++ b/tests/army/frame/eos.py @@ -57,8 +57,11 @@ def exe(file): # execute file and return immediately def exeNoWait(file): - print("exe no wait") - + if isWin(): + cmd = f"mintty -h never {file}" + else: + cmd = f"nohup {file} > /dev/null 2>&1 & " + return exe(file) # run return output and error def run(command, timeout = 10): diff --git a/tests/army/frame/etool.py b/tests/army/frame/etool.py index d57932b459..c06afcd76e 100644 --- a/tests/army/frame/etool.py +++ b/tests/army/frame/etool.py @@ -55,9 +55,12 @@ def runBinFile(fname, command): return frame.eos.runRetList(f"{binFile} {command}") # exe build/bin file -def exeBinFile(fname, command): +def exeBinFile(fname, command, wait=True): binFile = frame.epath.binFile(fname) if frame.eos.isWin(): binFile += ".exe" - return frame.eos.exe(f"{binFile} {command}") \ No newline at end of file + if wait: + return frame.eos.exe(f"{binFile} {command}") + else: + return frame.eos.exeNoWait(f"{binFile} {command}") \ No newline at end of file