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

Use internal build version for release SWIs #26

Merged
merged 2 commits into from
Oct 25, 2023
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
19 changes: 13 additions & 6 deletions src/pytest_netdut/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def _sku(request):
ssh = request.getfixturevalue(f"{name}_ssh")
assert ssh.cli_flavor in {"eos", "mos"}
output = ssh.sendcmd("show version", timeout=300)
matcher = re.search(r"(DCS-7.*)", output)
logging.info("Got SKU: %s", matcher.group(1))
yield matcher.group(1)
match = re.search(r"(DCS-7.*)", output)
logging.info("Got SKU: %s", match.group(1))
yield match.group(1)

return _sku

Expand All @@ -163,9 +163,16 @@ def _os_version(request):
ssh = request.getfixturevalue(f"{name}_ssh")
assert ssh.cli_flavor in {"eos", "mos"}
output = ssh.sendcmd("show version", timeout=300)
matcher = re.search(r"Software image version: (\S*)", output)
logging.info("Got OS version: %s", matcher.group(1))
yield matcher.group(1)
if ssh.cli_flavor == "mos":
match = re.search(r"Software image version: (\S*)", output)
else:
# On release SWIs the "Sofware image version" only contains the version, e.g.
# Software image version: 4.31.0F
# Architecture: x86_64
# Internal build version: 4.31.0F-33797590.4310F
match = re.search(r"Internal build version: (\S*)", output)
logging.info("Got OS version: %s", match.group(1))
yield match.group(1)

return _os_version

Expand Down