Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Backport: fix wrong cleos version returned in getClientVersion of tests/Cluster.py #667

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,16 +603,23 @@ def doNodesHaveBlockNum(nodes, targetBlockNum, blockType, printCount):
return ret

@staticmethod
def getClientVersion(verbose=False):
def getClientVersion(fullVersion=False):
"""Returns client version (string)"""
p = re.compile(r'^v?(.+)\n$')
try:
cmd="%s version client" % (Utils.EosClientPath)
if verbose: Utils.Print("cmd: %s" % (cmd))
if fullVersion: cmd="%s version full" % (Utils.EosClientPath)
if Utils.Debug: Utils.Print("cmd: %s" % (cmd))
response=Utils.checkOutput(cmd.split())
assert(response)
assert(isinstance(response, str))
if verbose: Utils.Print("response: <%s>" % (response))
verStr=response.strip()
if Utils.Debug: Utils.Print("response: <%s>" % (response))
m=p.match(response)
if m is None:
Utils.Print("ERROR: client version regex mismatch")
return None

verStr=m.group(1)
return verStr
except subprocess.CalledProcessError as ex:
msg=ex.output.decode("utf-8")
Expand Down