Merge pull request #24306 from taosdata/test/3.0/TD-28085

test: modify testcase of hot refresh config
This commit is contained in:
Alex Duan 2024-01-02 16:32:33 +08:00 committed by GitHub
commit 3eadc04992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

View File

@ -506,7 +506,22 @@ class TDCom:
if ("packaging" not in rootRealPath):
buildPath = root[:len(root) - len("/build/bin")]
break
if platform.system().lower() == 'windows':
win_sep = "\\"
buildPath = buildPath.replace(win_sep,'/')
return buildPath
def getTaosdPath(self, dnodeID="dnode1"):
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
taosdPath = buildPath + "/../sim/" + dnodeID
tdLog.info("taosdPath: %s" % taosdPath)
return taosdPath
def getClientCfgPath(self):
buildPath = self.getBuildPath()

View File

@ -201,6 +201,14 @@ class TDTestCase:
tdSql.error(f'alter {dnode} "{name} {v}";')
def run(self):
# reset log
taosdLogAbsoluteFilename = tdCom.getTaosdPath() + "/log/" + "taosdlog*"
tdSql.execute("alter all dnodes 'resetlog';")
r = subprocess.Popen("cat {} | grep 'reset log file'".format(taosdLogAbsoluteFilename), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = r.communicate()
assert('reset log file' in stdout.decode())
for key in self.configration_dic:
if "cli" == key:
for item in self.configration_dic[key]:
@ -214,12 +222,7 @@ class TDTestCase:
self.svr_check(item["name"], item["alias"], item["except_values"], True)
else:
raise Exception(f"unknown key: {key}")
# reset log
path = os.sep.join([tdDnodes.getDnodesRootDir(), "dnode1", "log", "taosdlog.*"])
tdSql.execute("alter all dnodes 'resetlog';")
r = subprocess.Popen("cat {} | grep 'reset log file'".format(path), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = r.communicate()
assert('reset log file' in stdout.decode())
def stop(self):
tdSql.close()