Skip to content

Commit 4563edc

Browse files
Use internal build version for release SWIs
Software image version for release SWIs only contains the version and not the changenum.
1 parent 0986854 commit 4563edc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/pytest_netdut/factories.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ def _os_version(request):
163163
ssh = request.getfixturevalue(f"{name}_ssh")
164164
assert ssh.cli_flavor in {"eos", "mos"}
165165
output = ssh.sendcmd("show version", timeout=300)
166-
matcher = re.search(r"Software image version: (\S*)", output)
166+
if ssh.cli_flavor == "mos":
167+
matcher = re.search(r"Software image version: (\S*)", output)
168+
else:
169+
# On release SWIs the "Sofware image version" only contains the version, e.g.
170+
# Software image version: 4.31.0F
171+
# Architecture: x86_64
172+
# Internal build version: 4.31.0F-33797590.4310F
173+
matcher = re.search(r"Internal build version: (\S*)", output)
167174
logging.info("Got OS version: %s", matcher.group(1))
168175
yield matcher.group(1)
169176

0 commit comments

Comments
 (0)