Skip to content

Commit

Permalink
Use internal build version for release SWIs
Browse files Browse the repository at this point in the history
Software image version for release SWIs only contains the version and not the
changenum.
  • Loading branch information
kennylau-arista committed Oct 20, 2023
1 parent 0986854 commit 4563edc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pytest_netdut/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ 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)
if ssh.cli_flavor == "mos":
matcher = 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
matcher = re.search(r"Internal build version: (\S*)", output)
logging.info("Got OS version: %s", matcher.group(1))
yield matcher.group(1)

Expand Down

0 comments on commit 4563edc

Please sign in to comment.