test: modify testcase of hot refresh config
This commit is contained in:
parent
762f1eac1e
commit
1a265a2e9d
|
@ -506,7 +506,23 @@ 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()
|
||||
print("123456",buildPath)
|
||||
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()
|
||||
|
|
|
@ -201,6 +201,17 @@ class TDTestCase:
|
|||
tdSql.error(f'alter {dnode} "{name} {v}";')
|
||||
|
||||
def run(self):
|
||||
|
||||
# reset log
|
||||
taosdPath = tdCom.getTaosdPath()
|
||||
print(taosdPath,"123")
|
||||
taosdLogAbsoluteFilename = taosdPath + "/log/" + "taosdlog*"
|
||||
print(taosdLogAbsoluteFilename)
|
||||
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 +225,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()
|
||||
|
|
Loading…
Reference in New Issue