diff --git a/Robot-Framework/lib/output_parser.py b/Robot-Framework/lib/output_parser.py index 44398ba1..4a331f5c 100644 --- a/Robot-Framework/lib/output_parser.py +++ b/Robot-Framework/lib/output_parser.py @@ -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) @@ -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 diff --git a/Robot-Framework/resources/ssh_keywords.resource b/Robot-Framework/resources/ssh_keywords.resource index 4d16dfde..9d291659 100644 --- a/Robot-Framework/resources/ssh_keywords.resource +++ b/Robot-Framework/resources/ssh_keywords.resource @@ -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! diff --git a/Robot-Framework/test-suites/bat-tests/others.robot b/Robot-Framework/test-suites/bat-tests/others.robot index 8c2c5a69..7e1595f6 100644 --- a/Robot-Framework/test-suites/bat-tests/others.robot +++ b/Robot-Framework/test-suites/bat-tests/others.robot @@ -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