Commit graph

98 commits

Author SHA1 Message Date
prefix
b380c7a762 host: add octoclock python api
Co-authored-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2024-09-05 14:45:45 +02:00
Grant Meyerhoff
767f716bd5 devtest: fix python formatting for tests 2024-07-15 14:40:11 +02:00
Grant Meyerhoff
c2734e9c3f devtest: fix python formatting for device patterns 2024-07-15 14:40:11 +02:00
michael-west
4cecc1e15a 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>
2023-11-01 20:45:06 -05:00
michael-west
d1797a2a49 cmake: Fix make_x410 and make_x440 targets
Only the make_x4xx target existed and did not actually run any tests.
Added correct mapping for make_x410 and make_x440 devtest targets.
Removed make_x4xx target.

Signed-off-by: michael-west <michael.west@ettus.com>
2023-11-01 20:45:06 -05:00
Grant Meyerhoff
66b9933a86 devtest: remove API calls that now error 2023-09-06 10:09:36 -05:00
Grant Meyerhoff
fee5ada222 devtest: fix typo in error message 2023-08-02 09:48:30 -05:00
Grant Meyerhoff
f4c7802e07 devtest: correct docstrings with example being run 2023-07-25 09:45:11 -05:00
Grant Meyerhoff
7d6de9d10a devtest: disable rx_samples_to_file_test for x440
disable test because of stream rate limitations for the 1GbE port
2023-07-25 09:45:11 -05:00
Grant Meyerhoff
ac0f3014b6 devtest: gpio test updates 2023-07-13 15:01:55 -05:00
Grant Meyerhoff
9c4f2f2319 devtest: remove benchmark_rate test for x440
The benchmark_rate test for x440 would require more than the 1GbE connection at the minimum rate

Since devtests cannot require special cabling, skip this devtest on x440
2023-07-10 09:53:30 -05:00
Grant Meyerhoff
797d093ea5 devtest: add exemptions for x440 python API test 2023-06-27 11:05:37 -05:00
mattprost
be4aaf6cfa devtest: Add multi-spc timed command tests
These tests are designed to validate timed commands operating correctly
at various offsets. This is to support the multiple-samples-per-cycle
logic in the FPGA which enables multi-spc streaming on certain devices.
The tests cover devices with digital code shared in the RFNoC framework,
even if they do not strictly support multi-spc streaming.

Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Wade Fife <wade.fife@ettus.com>
Signed-off-by: mattprost <matt.prost@ni.com>
2022-12-21 20:26:51 -06:00
Lane Kolbly
24eddf75fe test: x410: Add GPIO tests to X410 devtest 2022-03-23 21:09:39 -05:00
Lane Kolbly
897384aabf host: devtest: Allow getting mgmt_addr in tests 2022-03-23 21:09:39 -05:00
Lane Kolbly
91b6110210 host: devtest: Add GPIO tests for reading back ATR settings 2022-03-23 16:14:07 -05:00
Martin Braun
5e093c1e48 devtest: Clarify data type in multi_usrp_test::send_waveform() 2021-10-06 11:57:25 -07:00
Martin Braun
30a40395b9 devtest: Add receive stability test to B2xx devtest 2021-09-28 06:24:05 -07:00
Martin Braun
d0e75f66fa devtest: Add receive stability test
At this point, this test chokes an RX streamer to force an overrun. It
then confirms that the overrun message is returned to the call site, and
that the streamer returns to continuous streaming after the overrun
handling.
2021-09-28 06:24:05 -07:00
Martin Braun
09d94529e5 cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIR
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html

Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.

This was changed using sed:

$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
    `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
    `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`

At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.

Shoutout to GitHub user marcobergamin for bringing this up.
2021-09-10 15:08:10 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
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