Commit graph

77 commits

Author SHA1 Message Date
mattprost
ea76face99 devtest: benchmark_rate: Add support for rx and tx only tests
Fixes some minor reporting issues that occurred in devtest streaming
tests with only rx or only tx.

Signed-off-by: mattprost <matt.prost@ni.com>
2021-06-10 07:28:25 -05:00
Martin Braun
5f8142e543 tests: Make python_api_test.py always explicitly call Python
This change makes it such that python_api_test.py will spawn
a subprocess for multi_usrp_test.py by explicitly calling the Python
interpreter, and making the path to multi_usrp_test.py the first
argument.
This fixes running this devtest after installing Python tests via ipks
on embedded devices.
2021-06-02 21:49:39 -07:00
Martin Braun
147527a75d tests: Update multi_usrp_test.py
Many updates to this test. Most tests weren't even working properly.
Highlights:

- Add device-specific configuration. Includes defaults, but also the
  option to specify a YAML file.
- Improved output for better readability
- Made a whole bunch of tests work
2021-05-10 15:02:24 -05:00
Martin Braun
8a33db6022 devtest: Make Python tests their own type of devtest
Like the example test, the Python-based test is now codified. The
"special sauce" for Python tests revolves around the fact that they
require the Python API, so we have to gracefully fail if the Python API
was never enabled, but hard-fail when the Python API is enabled, but not
working.

This creates a new type of devtest (UHDPythonTestCase) and moves
uhd_python_api_test over to the new type.
2021-05-10 15:02:24 -05:00
Steven Koo
72ac96b23a devtest: reapply allow extra device arguments when running devtests
This change is substantially the same as 7b86a47, but implemented in a ninja
supported way. ninja doesn't allow for arguments, so this uses an environment
variable. This is compatible with both make and ninja. The only change
from the calling point of view is you must set the environment variable
before calling "make test_[devicetype]" instead of after as an arg.

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: EXTRA_DEV_ARGS=addr=192.168.30.2 make test_x3x0

Also-by: Matthew Crymble <matthew.crymble@ni.com>
Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-02-12 13:16:01 -08:00
Matthew Crymble
50e6357b55 Revert "devtest: allow extra device arguments when running devtests"
This reverts commit 7b86a47bf7.
This was causing issues when building UHD with ninja
2021-02-08 15:27:16 -06:00
Matthew Crymble
1ed4dd7071 devtest: lower rate for rx_all_chans_fast test
Using 12.5 MS/s exceeded the maximum throughput when using 4 channels over 1 GbE
2021-02-01 13:31:29 -06:00
Matthew Crymble
7b86a47bf7 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
2021-01-21 12:48:30 -06:00
Joerg Hofrichter
9f3ec1c5ab devtest: optionally generate XML report when running devtests
If the unittests are invoked with an extra argument -x, an XML report
is generated.

This depends on the python module unittest-xml-reporting (aka. xmlrunner).
2021-01-08 08:56:43 -06:00
Cristina Fuentes
2e64cb1b28 multi_usrp: Add get_mb_controller() API call 2020-09-24 15:16:45 -05:00
Steven Koo
2da3cdcb3b devtest: Support multi_usrp_test on Windows
Windows requires the command 'python' to prepend calls to .py files.
This change moves the path to multi_usrp_test.py to an argument on
Windows.
2020-08-10 15:14:36 -05:00
Steven Koo
31cade6566 devtest: Update filter for e31x devices
Filter for e3x0 no longer matches e31x devices. Switch to e3xx.
2020-08-04 15:47:33 -05:00
Martin Braun
e4291f1ddc multi_usrp: Add get_radio_control() API call
This is an advanced API call that allows direct underlying
access to the radio_control object for RFNoC devices.
2020-07-16 15:17:26 -05:00
Martin Braun
f832a176d9 devtest: Assert result of python_api_test correctly
Before this, the python_api_test didn't assert an error when it failed.
2020-06-10 12:46:33 -05:00
Martin Braun
6db281792b devtest: Don't skip Python API tests if Python API is enabled
One of the devtests (the python_api_test) gets skipped without failures
if the uhd module can't be loaded. However, this can mask errors if the
uhd module can't be loaded because it's broken. This change will verify
if the uhd module should have been loaded, and throw an error if that's
the case.
2020-06-10 12:46:33 -05:00
Martin Braun
f04d109936 b200: tests: Fix PyLint issues in B200 devtest 2020-06-10 12:46:33 -05:00
Martin Braun
ffb9187944 tests: Fix multi_usrp_test
This is a test that automatically executes API calls. The following
tests were broken:
- clock source: On B200mini, we need to set the time source back to
  internal to test the clock source.
- The filter API call tests did not match the API calls themselves
2020-06-10 12:46:33 -05:00
Matthew Crymble
6810cf2a4c tests: updated devtest runner to use standard device args
This will allow run_testsuite.py to be called for specific devices instead
of all devices for a certain type.
2020-05-27 09:46:01 -05:00
Martin Braun
1eecf8cf53 tests: Remove 'six' dependency from devtest
This removes 'six' as a dependency for devtest.
2020-05-12 12:04:11 -05:00
Martin Braun
1bba62a75a Remove remaining Python 2 references
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
  python3
2020-05-07 15:10:41 -05:00
Michael West
b8b1d28d14 test: Add output for gpio_test
Print output from stdout and stderr upon error.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Michael West
022cfa3d80 devtest: Add support for TwinRX to x3x0
Adding necessary code to examine number of TX and RX channels and adjust
test cases accordingly.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Michael West
8d5bcddd0d devtest: Add method to get number of channels
Adding method to get number of TX and RX channels to usrp_probe.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Michael West
09f3d17f5c devtest: Fix benchmark_rate_test success criteria
Allow success if testing either TX or RX.  Previously required both TX
and RX to be tested simultaneously.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Ciro Nishiguchi
ff17d7428b devtest: add missing devtest to n3xx 2020-04-03 07:33:22 -05:00
Martin Braun
879f021a02 devtest: Add test_messages_test to X310
- Fixes issues with test_messages_test (it had inverted the pass/fail
  condition)
- Improve Pylint scores in affected files
2019-11-26 12:21:33 -08:00
Martin Braun
e0a40fd1d7 devtest: Use with() statement to open files
This fixes warnings such as this during devtest:

/home/mbr0wn/src/uhddev/host/tests/devtest/uhd_test_base.py:112:
ResourceWarning: unclosed file <_io.TextIOWrapper
name='./results_x300_F457AD.log' mode='r' encoding='UTF-8'>
  self.results = yaml.safe_load(open(self.results_file).read()) or {}
  /path/to/uhd/host/tests/devtest/uhd_test_base.py:150:
  ResourceWarning: unclosed file <_io.TextIOWrapper
  name='./results_x300_F457AD.log' mode='w' encoding='UTF-8'>
    yaml.dump(self.results, default_flow_style=False))
    ok
2019-11-26 12:21:33 -08:00
Brent Stapleton
41f142050f tests: Change Python YAML module
Use Python's `ruamel.yaml` module instead of `yaml`
2019-11-26 12:21:32 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
2019-11-26 12:16:25 -08:00
Martin Braun
2ed94af772 uhd: Remove deprecated objects and methods
This removes the following symbols:
- otw_type_t
- clock_config_t
- Any functions that use those symbols
- Non-standard args from examples (e.g., --total-time is deprecated in
  favour of --duration)
2019-11-26 11:49:08 -08:00
Martin Braun
21ed72b5a2 devtese: Change default Python interpreter to 3
Usually, devtest is run via make (or ninja), and will use the correct
Python interpreter. When running directly on the command line, it is
important to pick the right Python interpreter so it will work with the
Python API.

Here, we change the default interpreter from Python 2 to 3, because
that's the more common version, and will be the only option for upcoming
UHD 4.0 anyway.
2019-11-08 08:56:20 -08:00
erickshepherdNI
fb71222b31 e3xx: corrected frontend name in devtest 2019-10-28 13:40:19 -07:00
Martin Braun
8081105e24 devtest: Add new test for tx_waveforms
This will run tx_waveforms with a few settings.
2019-05-22 14:27:02 -07:00
Martin Braun
600f655e8e tests: Make the Python interpreter for devtests a parameter
When running 'make test_***', it now also defaults to
RUNTIME_PYTHON_EXECUTABLE.
2019-04-25 10:46:44 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Trung Tran
3f77f6d5e0 devtest: add universal_newlines to subprocess call
subprocess call in python3+ return stderr and stdout object is byte
object instead of text. This caused many issue with parsing the ouput in
devtest. These are not an issue in python2. This change will make
devtest more python3 compatible.

Signed-off-by: Trung.Tran<trung.tran@ettus.com>
2019-01-23 11:03:39 -08:00
Trung Tran
c6618dd8d3 tests: replace has_key by using 'in'
python3+ dropped has_key function on dictionary. In order to make it
compatible, we need to use 'in' keyword.

Signed-off-by: Trung.Tran<trung.tran@ettus.com>
2019-01-23 11:03:39 -08:00
Brent Stapleton
494c7338d7 devtest: Fix CMake endif warning
When adding E320 devtests, the `endif` clause had the wrong argument,
which resulted in a CMake warning.
2019-01-03 12:11:06 -08:00
Sugandha Gupta
027040752f devtest: x3x0: Enable rx_samples_to_file in devtest 2018-12-17 14:24:13 -08:00
Martin Braun
2e85508a87 cmake: Properly register devtest
If N300 or E320 is disabled, the appropriate devtests are no longer
registered.
2018-11-29 09:55:08 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Sugandha Gupta
167be53183 e320: devtest: Reduce sample rate for 1G devtest
The E320 default master clock rate is 16MHz, therefore we need to
reduce the 2 channel receive rate to 8MHz in order to be able to meet
the requested rate.
2018-09-26 14:10:23 -07:00
Sugandha Gupta
e16e046d43 devtest: n3x0: Enable rx_samples_to_file test 2018-09-14 16:34:51 -07:00
Sugandha Gupta
fbd51d33e9 devtest: e320: Re-enable rx_samples_to_file test
The test has been fixed in commit 9c7d251b32
to parse for D and S correctly
2018-09-12 12:10:39 -07:00
Sugandha Gupta
94d6a6a0a6 e320: gpio: Fix front panel GPIO readback
The gpio devtest passes after this fix. Enabling the test
2018-09-12 12:10:39 -07:00
Martin Braun
6849514a05 devtest: Improve error handling for shell_application 2018-08-22 18:37:12 -07:00
Martin Braun
35a74c8c80 devtest: b2xx: Fix some arguments for MIMO test 2018-08-22 18:37:12 -07:00
Martin Braun
2b15ecde2b devtest: Fix counting of underruns/overruns
Our regex was borked.
2018-08-22 18:37:12 -07:00
Martin Braun
9c7d251b32 devtest: Remove parsing for DD.. and SS..
Detecting drops by parsing for DD and SS was a flawed method. Tools
should find those programmatically. Plus, the string 'DDC' would
interfere with the regex. Also, we're now using
UHD_LOG_FASTPATH_DISABLE.
2018-08-22 18:37:12 -07:00
Martin Braun
21d7250849 devtest: Default UHD_LOG_FASTPATH_DISABLE to 1 2018-08-22 18:37:12 -07:00