Skip to content

Commit

Permalink
PR #12209 from OhadMeir: Enable D457 FW update on LibCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Sep 20, 2023
2 parents 8496930 + 774f119 commit 2a4819e
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions unit-tests/test-fw-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# we want this test to run first so that all tests run with updated FW versions, so we give it priority 0
#test:priority 0
#test:device each(D400*) !D457
#test:donotrun:gha
#test:device each(D400*)

import sys
import os
Expand All @@ -13,22 +14,25 @@
import pyrealsense2 as rs
import pyrsutils as rsutils
from rspy import devices, log, test, file, repo


if not devices.acroname:
log.i( "No Acroname library found; skipping device FW update" )
sys.exit(0)
# Following will throw if no acroname module is found
from rspy import acroname
try:
devices.acroname.discover()
except acroname.NoneFoundError as e:
log.f( e )
# Remove acroname -- we're likely running inside run-unit-tests in which case the
# acroname hub is likely already connected-to from there and we'll get an error
# thrown ('failed to connect to acroname (result=11)'). We do not need it -- just
# needed to verify it is available above...
devices.acroname = None
import time

# This is the first test running, discover acroname modules.
# Not relevant to MIPI devices running on jetson for LibCI
if 'jetson' not in test.context:
if not devices.acroname:
log.i( "No Acroname library found; skipping device FW update" )
sys.exit(0)
# Following will throw if no acroname module is found
from rspy import acroname
try:
devices.acroname.discover()
except acroname.NoneFoundError as e:
log.f( e )
# Remove acroname -- we're likely running inside run-unit-tests in which case the
# acroname hub is likely already connected-to from there and we'll get an error
# thrown ('failed to connect to acroname (result=11)'). We do not need it -- just
# needed to verify it is available above...
devices.acroname = None


def send_hardware_monitor_command(device, command):
Expand Down Expand Up @@ -182,6 +186,7 @@ def find_image_or_exit( product_name, fw_version_regex = r'(\d+\.){3}(\d+)' ):
subprocess.run( cmd ) # may throw

# make sure update worked
time.sleep(3) # MIPI devices do not re-enumerate so we need to give them some time to restart
devices.query( monitor_changes = False )
sn_list = devices.all()
device = devices.get_first( sn_list ).handle
Expand Down

0 comments on commit 2a4819e

Please sign in to comment.