From 5eb4f664528fe58a8026d7fcc94f2c6b03c9ef54 Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 6 Jun 2024 13:01:03 +0800 Subject: [PATCH] test: adjust test case for taos/taosd version output --- tests/system-test/0-others/show.py | 6 +++--- tests/system-test/0-others/taosShell.py | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py index a5db5d193a..7c7870e773 100644 --- a/tests/system-test/0-others/show.py +++ b/tests/system-test/0-others/show.py @@ -191,12 +191,12 @@ class TDTestCase: tdSql.query('show local variables') for i in tdSql.queryResult: if i[0].lower() == "gitinfo": - taos_gitinfo_sql = f"gitinfo: {i[1]}" + taos_gitinfo_sql = f"git: {i[1]}" taos_info = os.popen('taos -V').read() - taos_gitinfo = re.findall("^gitinfo.*",taos_info,re.M) + taos_gitinfo = re.findall("^git: .*",taos_info,re.M) tdSql.checkEqual(taos_gitinfo_sql,taos_gitinfo[0]) taosd_info = os.popen('taosd -V').read() - taosd_gitinfo = re.findall("^gitinfo.*",taosd_info,re.M) + taosd_gitinfo = re.findall("^git: .*",taosd_info,re.M) tdSql.checkEqual(taosd_gitinfo_sql,taosd_gitinfo[0]) def show_base(self): diff --git a/tests/system-test/0-others/taosShell.py b/tests/system-test/0-others/taosShell.py index 1227378799..3b6f6c6fab 100644 --- a/tests/system-test/0-others/taosShell.py +++ b/tests/system-test/0-others/taosShell.py @@ -5,6 +5,7 @@ import time import socket import os import platform +import re if platform.system().lower() == 'windows': import wexpect as taosExpect else: @@ -370,10 +371,11 @@ class TDTestCase: if retCode != "TAOS_OK": tdLog.exit("taos -V fail") - version = 'version: ' + version - retVal = retVal.replace("\n", "") - retVal = retVal.replace("\r", "") - if retVal.startswith(version) == False: + version = 'taos version: ' + version + # retVal = retVal.replace("\n", "") + # retVal = retVal.replace("\r", "") + taosVersion = re.findall((f'^%s'%(version)), retVal,re.M) + if len(taosVersion) == 0: print ("return version: [%s]"%retVal) print ("dict version: [%s]"%version) tdLog.exit("taos -V version not match")