aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2023-10-25 23:58:43 -0700
committerAki Tomita <121511582+atomita-ni@users.noreply.github.com>2023-11-01 20:45:06 -0500
commit4cecc1e15aed67426fe86b99e7809c913b7a5228 (patch)
treee1b89938e24f835b2c0479cac4c1c7df5197face /host
parentmulti_usrp: Added module_serial to info (diff)
downloaduhd-4cecc1e15aed67426fe86b99e7809c913b7a5228.tar.xz
uhd-4cecc1e15aed67426fe86b99e7809c913b7a5228.zip
tests: Add tests for module_serial field
Added test to verify existence of the module_serial field and value to multi_usrp_test. Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host')
-rwxr-xr-xhost/tests/devtest/multi_usrp_test.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/host/tests/devtest/multi_usrp_test.py b/host/tests/devtest/multi_usrp_test.py
index 9a54e2031..0f65075dc 100755
--- a/host/tests/devtest/multi_usrp_test.py
+++ b/host/tests/devtest/multi_usrp_test.py
@@ -261,14 +261,18 @@ def get_test(usrp, prop, num_chans):
# Refresh dictionary for each channel
dictionary = getattr(usrp, "get_usrp_rx_info")(chan) if "rx" in prop \
else getattr(usrp, "get_usrp_tx_info")(chan)
- value = getattr(usrp, getter)(chan) if prop != 'mboard_name' \
- else getattr(usrp, getter)(0)
- # get_mboard_name function maps to mboard_id field in dict.
- dict_value = dictionary['mboard_id'] if prop == 'mboard_name' \
- else dictionary[prop]
- if value != dict_value:
- raise Exception("value in dict is {} and callback value is {}"
- .format(dictionary[prop], value))
+ if "_info" in prop:
+ if not "module_serial" in dictionary.keys() or dictionary["module_serial"] == "n/a":
+ raise Exception("Module serial number missing")
+ else:
+ value = getattr(usrp, getter)(chan) if prop != 'mboard_name' \
+ else getattr(usrp, getter)(0)
+ # get_mboard_name function maps to mboard_id field in dict.
+ dict_value = dictionary['mboard_id'] if prop == 'mboard_name' \
+ else dictionary[prop]
+ if value != dict_value:
+ raise Exception("value in dict is {} and callback value is {}"
+ .format(dictionary[prop], value))
return True
@@ -517,8 +521,6 @@ def run_api_test(usrp, device_config):
'issue_stream_cmd', # Gets called by recv_num_samps
'get_rx_num_channels', # Got called above
'get_tx_num_channels', # Got called above
- 'get_usrp_rx_info',
- 'get_usrp_tx_info',
'get_num_mboards', # Got called above
'get_rx_stream',
'get_tx_stream', # Require stream_args_t
@@ -526,6 +528,10 @@ def run_api_test(usrp, device_config):
method_executor.tested.extend(device_config.get('imply_tested', []))
actual_tests = [
+ (['get_usrp_rx_info'],
+ lambda: get_test(usrp, 'usrp_rx_info', num_rx_chans)),
+ (['get_usrp_tx_info'],
+ lambda: get_test(usrp, 'usrp_tx_info', num_tx_chans)),
(['get_rx_freq', 'set_rx_freq', 'get_rx_freq_range'],
lambda: range_test(usrp, 'rx_freq', num_rx_chans, 'coerce',
arg_converter=uhd.types.TuneRequest)),