aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/devtest/run_testsuite.py
diff options
context:
space:
mode:
authorMatthew Crymble <matthew.crymble@ni.com>2021-01-15 16:47:16 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-21 12:48:30 -0600
commit7b86a47bf7143df1cac252602e3c9ddbdd871d90 (patch)
tree08733462cdd0bf376b9ee53e6d69bd8eb54c56bc /host/tests/devtest/run_testsuite.py
parent7e2edf7057edc17b3991566ac5559dfde8966934 (diff)
downloaduhd-7b86a47bf7143df1cac252602e3c9ddbdd871d90.tar.gz
uhd-7b86a47bf7143df1cac252602e3c9ddbdd871d90.tar.bz2
uhd-7b86a47bf7143df1cac252602e3c9ddbdd871d90.zip
devtest: allow extra device arguments when running devtests
This allows running devtests for a single device instead of all connected devices or selecting a specific network interface. Set the additional device arguments with the EXTRA_DEV_ARGS variable. This can be set as an environment variable or on the command line. For example: make test_x3x0 EXTRA_DEV_ARGS=addr=192.168.30.2
Diffstat (limited to 'host/tests/devtest/run_testsuite.py')
-rwxr-xr-xhost/tests/devtest/run_testsuite.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/host/tests/devtest/run_testsuite.py b/host/tests/devtest/run_testsuite.py
index a5ece8ac6..4e45b112e 100755
--- a/host/tests/devtest/run_testsuite.py
+++ b/host/tests/devtest/run_testsuite.py
@@ -90,6 +90,7 @@ def main():
env = setup_env(args)
devtest_pattern = "devtest_{p}.py".format(p=args.devtest_pattern)
uhd_args_list = get_usrp_list(args.args, env)
+ arg_dict = dict(arg.split('=') for arg in args.args.strip(',').split(','))
if len(uhd_args_list) == 0:
print("No devices found. Exiting.")
exit(1)
@@ -103,13 +104,15 @@ def main():
print('--- This will take some time. Better grab a cup of tea.')
sys.stdout.flush()
args_str = uhd_info['args']
- env['_UHD_TEST_ARGS_STR'] = args_str
logfile_name = "log{}.log".format(
args_str.replace('type=', '_').replace('serial=', '_').replace(',', '')
)
resultsfile_name = "results{}.log".format(
args_str.replace('type=', '_').replace('serial=', '_').replace(',', '')
)
+ if 'addr' in arg_dict:
+ args_str += ',addr={}'.format(arg_dict['addr'])
+ env['_UHD_TEST_ARGS_STR'] = args_str
env['_UHD_TEST_LOGFILE'] = os.path.join(args.log_dir, logfile_name)
env['_UHD_TEST_RESULTSFILE'] = os.path.join(args.log_dir, resultsfile_name)
env['_UHD_TEST_LOG_LEVEL'] = str(logging.INFO)