aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Remove packet_handler_benchmarkMartin Braun2022-06-102-380/+0
| | | | | | This was a test written in the early stages of re-writing UHD for the 4.0 release. It tests things that are no longer in use for UHD 4, thus, the test can go as well.
* rfnoc: Add atomic_item_size property to FFT blockMartin Braun2022-06-101-0/+11
| | | | | | The atomic item size for the FFT block is always equal to the length of the FFT, multiplied by bytes-per-sample (4). For now, this is all the FFT block supports.
* tests: streaming: temporarily mark b210 dropped samples as an xfailMatthew Crymble2022-06-101-4/+12
|
* tests: streaming: use assert instead of pytest.fail for underruns/overrunsMatthew Crymble2022-06-101-2/+2
| | | | | | | When an assert statement fails, pytest will determine whether that should be a fail or an xfail. By explicitly calling pytest.fail, we were preventing pytest from doing that determination, so an individual test case that had an xfail mark would have been a hard failure.
* tests: streaming: mark non-dpdk failures as xfailsMatthew Crymble2022-06-101-8/+20
|
* tests: streaming: select appropriate uhd config file before test runsMatthew Crymble2022-06-102-0/+44
|
* tests: streaming: don't set master clock rate on x310Matthew Crymble2022-06-101-2/+5
|
* tests: streaming: fix x310 test case valuesMatthew Crymble2022-06-101-3/+3
|
* tests: streaming: add support for B210 DUTsMatthew Crymble2022-06-101-2/+7
| | | | | | The use_dpdk will be false for all B210 test cases, but still needs to be defined since the main test_streaming() function requires a value for it.
* tests: streaming: include dual_SFP parameter for all casesMatthew Crymble2022-06-101-20/+18
| | | | | | The dual_SFP test case parameter will be false for all B210 and E320 test cases, but it still needs to be defined since the main test_streaming() function requires a value for it.
* tests: streaming: add support for more DUTsMatthew Crymble2022-06-101-0/+4
| | | | | | | | | | This commit enables runs for X310, X310 TwinRx, E320, and N310. By default, python's argparse module will expect a value to be provided for each argument defined. Specifying an nargs value of '?' for the pytest options allows us to use a single pytest invocation in our pipeline configuration, even though some options don't apply to some DUT types.
* tests: rfnoc: Add another loop graph testMartin Braun2022-04-071-0/+110
| | | | | | This test mimics the Radio <-> Replay loop graph. Because we need one back-edge in this graph, this test makes sure the atomic item sizes still resolve.
* rfnoc: Modify prop. propagation algorithm (back-edge resolution)Martin Braun2022-04-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the property propagation algorithm would first forward and resolve properties only along forward edges. Then, we would check that properties also align across back-edges. The assumption is that graphs are always structured in a way such that back-edges would align when the resolution is done. However, for the following graph, this would fail: Radio ---> Replay ^ | +---------+ The reason is that the radio block and the replay block both have an "atomic_item_size" property, which needs to be resolved both ways. If the default atomic_item_size is 4 for the radio, and 8 for the replay block, then the input atomic_item_size on the radio will never be aligned with the output atomic_item_size of the replay block, and there is no other mechanism to align those. The solution is to run the edge property propagation and resolution twice, first for the forward edges, then for the back-edges. For graphs that would previously work, this makes no difference: The additional step of propagation properties across the back-edges will not dirty any properties. However, for graphs like the one above, it will provide an additional resolution path for properties that are otherwise not connected.
* tests: streaming tests setupVirendra Kakade2022-04-062-5/+5
| | | | | | | Add auto DUT bitfile configuration. Add special network configuration commands for X410. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* uhd: Replay block version 1.1michael-west2022-04-011-15/+85
| | | | | | | | | - Add ability to get current record position. - Add ability to get current play position. - Track space in play command FIFO and throw uhd::op_failed error when command requested would overflow the command FIFO. Signed-off-by: michael-west <michael.west@ettus.com>
* tests: enable automated streaming tests on X410Virendra Kakade2022-03-311-8/+9
| | | | | | | | | | | | Enable automated streaming tests to run on X410. Disable tests on non-X410 devices for now. Run only DPDK tests since the setup can not withstand 4Rx 4Tx and 4FDx in non-DPDK mode in manual testing. And we need to enable running these tests for 100GbE testing. Adjust streaming test thresholds to new values which seemed to work fine in manual testing. Might make them tighter in future based on more data.
* tests: add X410 100GbE testsVirendra Kakade2022-03-311-23/+29
| | | | | | | | Disable non 100GbE X410 tests for now since the test framework currently assumes that the required bitfile(personality) is already loaded onto the device. Re-enable these tests when the above support is added. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* rfnoc: replay: Add ability to capture and read async infoMartin Braun2022-03-301-2/+15
| | | | | | | - Add action handlers to the replay block to store TX and RX events. - Adds two new APIs: get_{record,play}_async_metadata() to read back async info. - Add unit tests.
* tests: rfnoc: Amend mock nodes with action supportMartin Braun2022-03-301-0/+21
| | | | | | - Allow mock radios to generate mock overruns/underruns - Allow terminator blocks to inject arbitrary actions for testing purposes
* tests: Add complex include to resolve buildSteven Koo2022-03-291-0/+1
| | | | Signed-off-by: Steven Koo <steven.koo@ni.com>
* tests: use new args for x410 streaming testsVirendra Kakade2022-03-281-0/+6
| | | | | | | | Use new benchmark_rate args "--multi_streamer" and "--priority" for X410 streaming tests. This gets the best performance from the streaming host machine. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* test: x410: Add GPIO tests to X410 devtestLane Kolbly2022-03-233-6/+84
|
* host: devtest: Allow getting mgmt_addr in testsLane Kolbly2022-03-231-1/+1
|
* rfnoc: fir filter: Add support for multiple channels to block controllerJonathon Pendlum2022-03-231-76/+97
|
* test: add support for new benchmark_rate argsVirendra Kakade2022-03-232-8/+12
| | | | | | | | Add support for the new "priority" and "multi_streamer" benchmark_rate args to run_benchmark_rate.py to enable batch runs of benchmark_rate using those arguments. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* host: devtest: Add GPIO tests for reading back ATR settingsLane Kolbly2022-03-232-1/+30
|
* host: Create meta_range_t::as_monotonicLane Kolbly2022-03-141-0/+20
| | | | | | | | In order to perform certain operations (start/stop/step), meta_range_t objects must be "monotonic", meaning that the subranges composing it are sorted and non-overlapping. This commit creates a method which takes a non-monotonic meta_range_t containing no non-continuous subranges and converts it into a monotonic meta_range_t.
* host: test: Add UHD_UNITTEST_LOG_LEVEL overrideLane Kolbly2022-03-111-2/+13
|
* tests: Apply clang-format to convert_testAaron Rossetto2022-03-081-177/+259
|
* tests: Fix converter benchmark disable on Boost <1.68Aaron Rossetto2022-03-081-0/+80
| | | | | | | | | | | | | | | | Boost versions prior to 1.68 appear to have a bug where a decorator to denote a test as disabled is not honored when affixed to a data-driven test case, which is how the benchmarks in convert_test are skipped when the unit test is run. (The tests take some time to complete and we don't want them running with every CI pass.) This commit adds an alternative benchmark skipping mechanism when Boost <1.68 is used. The benchmark test cases perform a runtime check for the user-provided `--benchmark` command-line option. If not found, the test case returns prematurely. If found, the test case will execute. Note that because `--benchmark` is a command-line option specific to this test, and not to Boost, the options must follow `--` in the command line in order to take effect: `convert_test -- --benchmark`.
* rfnoc: window: Set window size register after loading coefficientsJonathon Pendlum2022-03-021-0/+7
|
* host: test: Add GPIO DDR register to x4xx mockLane Kolbly2022-03-021-0/+6
| | | | | | | | | This is useful for unit testing certain code which operates the DDR registers, in particular code which performs a read-modify-write operation on that register. Conceivably we could add more registers here, but I'm just doing one at a time.
* tests: Add saturating test casesAaron Rossetto2022-02-281-0/+137
| | | | | This commit adds test cases to convert_test to specifically test the saturating behavior of the fc32/fc64-to-sc16 conversions.
* tests: Add conversion benchmarking testsAaron Rossetto2022-02-281-38/+571
| | | | | | | | | | | | | This commit adds Boost test cases for benchmarking each of the existing conversions that are tested in convert_test. The benchmarks do take some time, and we do not want to run they as part of every CI run, so they are marked with a test decorator that disables the benchmark by default. To run the benchmarks, invoke convert_test with `--run-test=+benchmark*` to explicitly enable all disabled tests that begin with the word 'benchmark'. Individual benchmark test cases can be enabled by specifying the full name of the benchmark test or by crafting a wildcard that includes all benchmark test cases of interest.
* convert: Add benchmarking abilitiesAaron Rossetto2022-02-281-10/+97
| | | | | This commit adds code to the convert tests to support the ability to benchmark individual conversion test cases.
* tests: Force converter tests to be run with all available priosMartin Braun2022-02-281-49/+91
|
* convert: Minor cleanupAaron Rossetto2022-02-281-113/+36
| | | | | | | | | | | | | | | | | | | This commit implements some minor cleanup of various converter- and convert test-related code: * Improves the log messages regarding which converter was returned for a request. * Modifies the result checking code in the converter tests to only report an out-of-range sample error once, rather than reporting every out-of-range sample encountered during the test. This vastly cuts down on the output when a conversion has failed. * Adds a function `reverse_converter()` which, given a `convert::id_type` describing a conversion from C1 to C2, returns a `convert::id_type` describing the reverse conversion (C2 to C1). * Removes two redundant test cases from the converter test.
* Build uhd_test library as static when `-DBUILD_SHARED_LIBS=ON`David Seifert2022-02-241-1/+1
| | | | | * A uhd_test.so lacks the necessary symbols for testing due to default visibility set to hidden.
* host: Throw exception when accessing properties with incorrect typeLane Kolbly2022-02-071-0/+25
|
* uhd: Harmonize fuzzy frequency comparisonsMartin Braun2022-02-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Throughout UHD, we often do floating-point comparisons for frequency ranges that require resilience to floating point rounding errors. Most of the time the checks look like this: ```cpp if (fp_compare_epsilon<double>(freq) > boundary) { // ... } ``` The exception is the N320 daughterboard control, which uses a custom epsilon: ```cpp if (fp_compare_epsilon<double>(freq, RHODIUM_FREQ_COMPARE_EPSILON) > boundary) { // ... } ``` This was, for the most part, not by design, but because authors simply didn't think about which epsilon value was appropriate for the frequency comparison. This was complicated by the fact that fp_compare_epsilon previously had some issues. This patch introduces FREQ_COMPARE_EPSILON, which is a sensible default value for fp_compare_epsilon when doing frequency comparisons (note that fp_compare_delta already had such a value). Also, it introduces freq_compare_epsilon(x), which is a shorthand for fp_compare_epsilon<double>(x, FREQ_COMPARE_EPSILON). We then replace all occurrences of fp_compare_epsilon<double> which are specific to frequency checks with freq_compare_epsilon.
* math: fp_compare: Adapt fp_compare_epsilon API to actual useMartin Braun2022-02-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UHD had an issue where the design of fp_compare_epsilon and its usage differed. In fact, the *only* usage of fp_compare_epsilon outside of unit tests was to do a fuzzy frequency comparison, and it always took a form like this: ```cpp // The argument EPSILON may be implied, i.e., using the default if (fp_compare_epsilon<double>(test_freq, EPSILON) < boundary_freq) { // ... } ``` However, the API of fp_compare_epsilon was such that it would apply DOUBLE_PRECISION_EPSILON to part of the frequency comparison, thus rendering the argument EPSILON obsolete. When the default EPSILON was used, this was OK, but only when the floating point type of fp_compare_epsilon<> was `double`, and not `float`. As an example, consider the following: ``` if (fp_compare_epsilon<double>(1e9 + x, LITTLE_EPSILON) == 1e9) { // .... } double BIG_EPSILON = x * 10; if (fp_compare_epsilon<double>(1e9 + x, BIG_EPSILON) == 1e9) { // .... } ``` If you expect the second comparison to pass even if the first failed, then you are not alone. However, that's not what UHD would do. Because of the aforementioned behaviour, it would use DOUBLE_PRECISION_EPSILON for the right hand comparison, which would fail again. Instead of fixing the instances of fp_compare_epsilon throughout UHD, this patch changes the comparison algorithm from "very close with tolerance epsilon" to "close enough with tolerance epsilon". This requires only one side to be close to the other, using its own epsilon, so the aforementioned example would always pass on the second check. However, this exposed a second bug in fp_compare_epsilon. For greater-/less-than comparisons, it would use epsilon like a delta value, i.e., it would check if a + epsilon < b - epsilon That means that if a < b, but (b-a) < 2*epsilon, this check would return "false", i.e., it would report that a >= b, which is incorrect. These operators are now changed such that they first check equality of a and b using the algorithm described in the code, and then compare the values of a and b (ignoring epsilon) directly. A unit test for this case was added.
* host: zbx: Expose tuning table on property treeLane Kolbly2022-02-031-0/+59
| | | | | This allows viewing or, conceivably, customizing the tuning table that ZBX uses, depending on the particular needs of the end user.
* tests: Modularize x4xx_radio_mock to use it in other testsMartin Anderseck2022-01-252-269/+293
| | | | | Move x4xx_radio_mock_reg_iface_t and x400_radio_fixture from radio block test into own file to reuse it more easily in the future.
* host: Implement nameless_gain_mixinLane Kolbly2022-01-201-0/+1
|
* tests: disable x4xx_radio_block_test on macOSSteven Koo2022-01-191-26/+31
| | | | | | | | This commit disables x4xx_radio_block_test on macOS because the platform has stricter casting and symbol export rules, which causes this test to fail. Signed-off-by: Steven Koo <steven.koo@ni.com>
* SPI: Implement SPI engine for x410Martin Anderseck2022-01-131-0/+1
| | | | | Add SPI Core host implementation for x410 and a discoverable feature to make it accessible.
* host: tests: Make x4xx unit test support GPIOLane Kolbly2022-01-111-1/+1
|
* rfnoc: Add atomic item size property for RFNoC blocksLars Amsel2022-01-101-0/+106
| | | | | | | | | | | | | | | An RFNoC block (like the radio) might require a minimal number of items in each clock cycle, e.g. the radio has to process SPC (samples per cycle). Because data in RFNoC is transmitted and processed in packets, we have to make sure the items inside these packets are a multiple of the items processed in each cycle. This commit adds an atomic item size properties which is set by the radio and adapted by the streamers. The streamers adapt the SPP property of the radio block controller depending on the MTU value. This might lead to an SPP value which does not align with the SPC value of the radio block, hence we add a property resolver for the atomic item size.
* host: rf_control: Add internal antenna API abstraction.Lane Kolbly2022-01-051-0/+1
|
* host: tests: Add unit test for ZBX antenna APILane Kolbly2022-01-051-0/+20
|