|WARNING| [v3,5/5] test: allow setting random seed for tests
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 27 21:15:27 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173288
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-27
**Patch 5/5: test: allow setting random seed for tests**
**Warning: documentation does not match interactive-mode behaviour**
The documentation says the generator is reseeded "before each test command is run":
```
+Setting ``DPDK_TEST_SEED`` to an integer seeds the generator with that
+value before each test command is run, so that a test gets the same input
+data no matter what ran before it::
```
In interactive mode the code seeds only once, before entering the command loop:
```
+ if (use_test_seed)
+ rte_srand(test_seed);
+
cmdline_interact(cl);
```
As a result, the second and later commands typed at the prompt continue the sequence left by the earlier ones. That is exactly the order dependence the documentation says is avoided.
Fix either of these:
- Reseed per command in interactive mode as well, for example in the command dispatch path.
- Narrow the documentation to say that reseeding per test applies only to tests passed on the command line or via `DPDK_TEST`.
**Info: `strtoull()` accepts negative input**
The parser uses:
```
+ test_seed = strtoull(env, &end, 0);
```
`strtoull()` accepts a leading `-` and negates the value, so `DPDK_TEST_SEED=-1` is silently accepted as `UINT64_MAX`. Reject a leading `-` if only non-negative seeds are intended.
Review-Result: WARNING
More information about the test-report
mailing list