Skip to content

Commit

Permalink
Merge pull request #26 from aristanetworks/fix-os-version-for-release…
Browse files Browse the repository at this point in the history
…-swis

Use internal build version for release SWIs
  • Loading branch information
kennylau-arista authored Oct 25, 2023
2 parents 0986854 + 7740a07 commit f7625ca
Showing 1 changed file with 13 additions and 6 deletions.
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

0 comments on commit f7625ca

Please sign in to comment.