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

Tests/Ping: log stdout #369

Merged
merged 2 commits into from
May 29, 2024
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
6 changes: 5 additions & 1 deletion lnst/Tests/Ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ def run(self):
except KeyboardInterrupt:
pass

self._res_data["stdout"] = stdout
self._res_data["stderr"] = stderr

if ping_process.returncode > 1:
self._res_data["msg"] = "returncode = {}".format(ping_process.returncode)
logging.error(self._res_data["msg"])
if stderr != "":
self._res_data["stderr"] = stderr
logging.error("errors reported by ping")
logging.error(self._res_data["stderr"])
return False

logging.debug(f"Ping stdout:\n{stdout}")

stat_pttr1 = r'(\d+) packets transmitted, (\d+) received'
stat_pttr2 = r'rtt min/avg/max/mdev = (\d+\.\d+)/(\d+\.\d+)/(\d+\.\d+)/(\d+\.\d+) ms'

Expand Down
Loading