Skip to content

Commit

Permalink
[SP-3183] Check QSPI version
Browse files Browse the repository at this point in the history
Signed-off-by: Mariia Azbeleva <mariia.azbeleva@unikie.com>
  • Loading branch information
azbeleva authored and Mika Tammi committed Nov 2, 2023
1 parent 702e51e commit 20775d2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Robot-Framework/lib/output_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def parse_iperf_output(output):
"rx": rx
}


def get_wifi_ip_from_ifconfig(output, if_name):
pattern = if_name + r'.*?\n.*?inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'
match = re.search(pattern, output)
Expand All @@ -143,3 +144,22 @@ def get_wifi_ip_from_ifconfig(output, if_name):
else:
print(f"Couldn't find ip with pattern {pattern}")
return None


def get_qspi_versions(output):
fw_pattern = r"Current firmware version is: (\d*.\d*.\d*)"
sw_pattern = r"Current software version is: (\d*.\d*.\d*)"

match = re.search(fw_pattern, output)
if match:
fw_version = match.group(1)
else:
raise Exception(f"Couldn't parse current firmware version, pattern: {tx_pattern}")

match = re.search(sw_pattern, output)
if match:
sw_version = match.group(1)
else:
raise Exception(f"Couldn't parse current software version, pattern: {rx_pattern}")

return fw_version, sw_version
5 changes: 5 additions & 0 deletions Robot-Framework/resources/ssh_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,8 @@ Check if ssh is ready on device
END

[Return] ${is_ready}

Check QSPI Version is up to date
${output} Execute Command ota-check-firmware
${fw_version} ${sw_version} Get qspi versions ${output}
Should Be True '${fw_version}' == '${sw_version}' Update QSPI version! Test results can be wrong!
7 changes: 6 additions & 1 deletion Robot-Framework/test-suites/bat-tests/others.robot
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ Test nixos version format
Verify Nixos Version Format
[Teardown] Close All Connections


Check QSPI version
[Documentation] QSPI version should be up-to-date
[Tags] bat SP-T100 orin-agx orin-nx
[Setup] Connect
Check QSPI Version is up to date
[Teardown] Close All Connections

0 comments on commit 20775d2

Please sign in to comment.