aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
* test: Fix potential resource leakMartin Anderseck2021-08-041-5/+4
| | | | | | | Fixed issue where variable tmp_file going out of scope could have leaked the storage it points to. Replaced the declaration of tmp_file by using a unique pointer with custom deleter that takes care of closing the tmpfile when it is not needed anymore.
* uhd: Fix usage of std::abs with template parametersMartin Braun2021-07-231-3/+3
| | | | | | | | | `std::abs` is only a templated function, when dealing with complex numbers. For real values, it is an overload. There is no documented standard way to use `std::abs<double>()` for real-valued arguments. We therefore remove all usages of `std::abs<>()` and replace them with `std::abs()` where they were taking a real-valued argument.
* rfnoc: allow find_blocks to search by device number or block count.Lars Amsel2021-07-201-0/+1
| | | | | | | | | | | | | In current implementation it is not possible to find all blocks of a device by calling find_blocks("0/"). The same is true for the block count. This is caused by the valid block id regex which requires a block name. This regex is used to validate the block name as well as to match block ids in search. This fix looses the requirement for the block name to allow searches by device number and block count and also extends the is_valid_block_id method to require the block name match to be non empty (which restores the previous behaviour at this point).
* rfnoc: fix block id check to allow underscoreLars Amsel2021-07-141-0/+7
| | | | | | | We allow underscore in RFNoC's block names but the regular expressions only allowed the underscore in the block name RE. This fix adds the underscore to the block id RE as well as adapts the unit tests accordingly.
* tests: add missing header, required by some compilersMichael Dickens2021-07-021-0/+1
| | | | Ref: https://github.com/EttusResearch/uhd/issues/451
* uhd: Remove includes of list_of.hpp where appropriateMartin Braun2021-06-243-4/+0
| | | | This Boost header is included in some places, despite not being used.
* uhd: Remove all occurences of boost::math::*round()Martin Braun2021-06-241-5/+3
| | | | | | | Its behaviour is almost identical to std::lround, which we use instead. The only downside of std::lround is that it always returns a long, which we don't always need. We thus add some casts for those cases to make the compiler happy.
* zbx: Fix clang compiler warningsMartin Braun2021-06-221-2/+2
| | | | | | | | - Missing override - Superfluous 'this' lambda capture - Register state in zbx_cpld_ctrl was being initialized too late (this is actually a bug depending on compiler version) - Remove lots of unused fields from experts
* test: add DPDK option for max streaming rate testsMatthew Crymble2021-06-183-82/+230
|
* uhd: Add support for the USRP X410Lars Amsel2021-06-1012-3/+2336
| | | | | | | | | | | | | | | | 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>
* devtest: benchmark_rate: Add support for rx and tx only testsmattprost2021-06-101-19/+27
| | | | | | | 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>
* tests: Make python_api_test.py always explicitly call PythonMartin Braun2021-06-022-9/+5
| | | | | | | | | 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.
* tests: Add MTU forwarding policy restriction unit testAaron Rossetto2021-05-181-0/+58
|
* tests: Update multi_usrp_test.pyMartin Braun2021-05-101-115/+259
| | | | | | | | | | 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
* devtest: Make Python tests their own type of devtestMartin Braun2021-05-103-41/+68
| | | | | | | | | | | 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.
* experts: Change coercion policy for regular prop nodesMartin Braun2021-05-041-4/+7
| | | | | | | | | | | | | | | | The experts framework has two ways of integrating expert nodes into the property tree: add_prop_node() and add_dual_prop_node(). In the latter case, the experts should take care of coercion, and thus, we subscribe to the desired value. In the former case, this is not necessary, and precludes us from using set_coercer() with prop nodes on the prop tree. This change lets us use regular nodes in the expert framework that also use property tree coercers. As of now, there is not a single property node in UHD that uses add_prop_node() and also does any kind of coercion, so this change has no effect on current code (this is only used in TwinRX as of now).
* host: Update code base using clang-tidyMartin Braun2021-03-171-6/+5
| | | | | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json Note: This is the same procedure as 107a49c0, but applied to all the new code since then.
* tests: Fix warnings for rf_control_gain_profile_testMartin Braun2021-03-111-4/+1
| | | | | - Remove unused const - Fix includes to IWYU and clang-format order
* lib: Fix warnings related to unnecessary lambda capturesMartin Braun2021-03-041-4/+1
|
* tests: Remove unused constantsMartin Braun2021-03-048-23/+0
| | | | This fixes some clang warnings.
* host: Update code base using clang-tidyMartin Braun2021-03-0422-111/+114
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* devtest: reapply allow extra device arguments when running devtestsSteven Koo2021-02-122-2/+5
| | | | | | | | | | | | | | | | | | 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>
* Revert "devtest: allow extra device arguments when running devtests"Matthew Crymble2021-02-082-5/+2
| | | | | This reverts commit 7b86a47bf7143df1cac252602e3c9ddbdd871d90. This was causing issues when building UHD with ninja
* devtest: lower rate for rx_all_chans_fast testMatthew Crymble2021-02-011-4/+4
| | | | Using 12.5 MS/s exceeded the maximum throughput when using 4 channels over 1 GbE
* devtest: allow extra device arguments when running devtestsMatthew Crymble2021-01-212-2/+5
| | | | | | | | | 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
* uhd: Split radio_control into rf_control interfacesLane Kolbly2021-01-112-0/+46
| | | | | | These rf_control interfaces allow easier implementation of radio controls as well as allowing easier sharing of code for implementing e.g. gain_profile.
* Create C++ wrappers for MPM RPC callsLane Kolbly2021-01-111-0/+1
| | | | | | | | | This gives us type-safety, as well as allowing us to create unit tests for RFNoC radio_controls without having to create actual RPC servers and clients in the unit tests. This change also fixes a bug in mpmd_mb_controller::set_sync_source, where it was calling the wrong MPM function.
* uhd: revert "Check property type at access..."Steven Koo2021-01-081-18/+0
| | | | | | | | | | This change reverts cb9329a681552e6ac6277d16e1627afcbb23e637. The type checking is causing some conversion issues on clang/macos. The type_index checking doesn't work correctly across shared libraries and should not be relied on to verify type, since it can vary from compiler to compiler. Signed-off-by: Steven Koo <steven.koo@ni.com>
* devtest: optionally generate XML report when running devtestsJoerg Hofrichter2021-01-081-1/+13
| | | | | | | 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).
* tests: Add UT for node removal prop resol'n restorationAaron Rossetto2020-11-201-0/+53
|
* uhd_images_downloader: Add environment variable for http authLane Kolbly2020-10-152-0/+46
| | | | | | | | | This allows the image downloader to download files from restricted sources using HTTP basic auth, specifying the credentials in the UHD_IMAGES_USER and UHD_IMAGES_PASSWORD environment variables: ``` UHD_IMAGES_USER=lane UHD_IMAGES_PASSWORD=MyS3cretPassword uhd_images_downloader.py ```
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-241-0/+1
|
* tests: Fix build issue with Boost 1.67Martin Braun2020-09-111-0/+3
| | | | | Boost 1.67 will fail to build some tests that include mock_transport.hpp if an additional include is missing.
* rfnoc: replay: Add support for 32-bit memory address widthsettus2020-09-031-2/+2
| | | | | | Increases the supported memory sizes in software to 2^32 and beyond. Signed-off-by: mattprost <matt.prost@ni.com>
* tests: fbs test: Fix issues around missing gitMartin Braun2020-08-251-1/+2
| | | | | | | | | - update_fbs.py would use git directly, instead of the requested git executable - There are other corner cases for the git executable detection, which are now all captured under a more general exception type Credit to Christopher Friedt for pointing out the original issue.
* devtest: Support multi_usrp_test on WindowsSteven Koo2020-08-101-1/+6
| | | | | | 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.
* rfnoc: Remove M_PI usage to fix Windows buildsSteven Koo2020-08-071-7/+5
| | | | | | M_PI may not exist if _USE_MATH_DEFINES isn't defined before the first include of math.h or cmath on Windows. This changes avoids the issue all together by defining our own PI.
* tests: Add unit test for Keep One in N block controllerAaron Rossetto2020-08-052-0/+141
|
* devtest: Update filter for e31x devicesSteven Koo2020-08-041-1/+1
| | | | Filter for e3x0 no longer matches e31x devices. Switch to e3xx.
* tests: Add graph disconnect/reconnect unit testmichael-west2020-08-041-0/+37
| | | | Signed-off-by: michael-west <michael.west@ettus.com>
* RFNoC: Add xport disconnect callbacksmichael-west2020-08-041-2/+10
| | | | | | | | | | | | Transports were not disconnecting their links from the I/O service upon destruction, leaving behind inaccessible send and recv links used by nothing. This led to I/O errors after creating several transports. Added callbacks to transports to automatically disconnect their links from the I/O service when the transport is destroyed. Updated all callers to supply a disconnect callback. Signed-off-by: michael-west <michael.west@ettus.com>
* tests: Add Replay Block controller unit testmattprost2020-08-042-0/+764
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* tests: Add unit test for siggen RFNoC block controllerAaron Rossetto2020-07-302-0/+352
|
* rfnoc: Add Switchboard block unit testsJesse Zhang2020-07-302-0/+161
|
* rfnoc: Support instance overrides in set_properties()Aaron Rossetto2020-07-243-3/+42
| | | | | | | | | | | | | | | | | | | | | | | This commit adds an enhancement to node_t::set_properties() in which the instance argument provided to the function (which normally applies to all properties in the key/value list) can be overridden on a per-property basis using a special syntax. If the key consists of the property name followed by a colon (':') and then a number, the number following the colon is used to determine which instance of the property this set pertains to, and the value passed via the instance parameter is ignored for that property. For example, in the following call: node->set_properties("dog=10,cat:2=5,bird:0=0.5", 1) instance 1 of node's 'dog' property is set to 10, the 1 coming from the instance parameter, instance 2 of the node's 'cat' property is set to 5 due to the override syntax provided in the string, and instance 0 of the node's 'bird' property is set to 0.5 due to its override. If the name/instance pair is malformed, e.g. 'value:=10' or 'value:foobar=10', a runtime error is thrown.
* multi_usrp: Add get_radio_control() API callMartin Braun2020-07-161-0/+1
| | | | | This is an advanced API call that allows direct underlying access to the radio_control object for RFNoC devices.
* tests: Add unit test for Moving Average RFNoC blockmattprost2020-07-162-0/+111
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* python: Add payload agnostic methods to CHDR APISamuel O'Brien2020-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In the c++ api, methods like chdr_packet#set_payload() and chdr_packet#get_payload() are templated over the payload type (payload_t). For methods like set_payload, they are overloaded by the type of an argument, so in pybind we can just explicitly instaniate the template for each payload_t and register it with pybind under the same name. At runtime, pybind looks at the type of the argument and decides which to call. The problem arose with methods like get_payload, which are overloaded by return type. In C++, the compiler can infer the template type by the type of the target at the call site. In python, there is no way for the pybind to determine which variant of get_payload to call, and it would crash. Previously, the workaround for this was to declare get_payload_ctrl, get_payload_mgmt, etc, but this was rather anti-pythonic. This commit utilizes the fact that python methods don't have a constrained return type to resolve this. Now, get_payload will call a python method which looks at the chdr_packet#header#pkt_type field to determine which variant of get_payload to call and returns that type of payload_t. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* python: Document CHDR Test GenerationSamuel O'Brien2020-07-162-19/+44
| | | | | | | | | The script_test.py script is used to generate data .cpp files from a wireshark trace for the C++ CHDR Parser tests. This commit expands the script to also generate the data .py files for the Python CHDR Parser tests. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* python: Add bindings for C++ CHDR ParserSamuel O'Brien2020-07-165-0/+47029
| | | | | | | | | | | | | This commit adds pybind11 glue code for the userland chdr parsing code introduced in the uhd::utils::chdr namespace. Additionally, it moves some pybind11 adapter code to a common pybind_adaptors.hpp file which originally existed in the cal_python.hpp file. This commit also adds unit tests for the python bindings using a captured wireshark trace which is located in rfnoc_packets_*.py and some handwritten packets in hardcoded_packets.py Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>