test: validate test names in non interactive mode
authorBruce Richardson <bruce.richardson@intel.com>
Fri, 10 Jun 2022 14:24:06 +0000 (15:24 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 13 Jun 2022 09:18:39 +0000 (11:18 +0200)
commitf940a2e333e3c65ffb53b76bd7b3536084b1acbf
treed41da85ccab4c62b47f4f390a57cfd9da4cedc1e
parent758d92795b1c4794f04b463c18bb29d82ea46283
test: validate test names in non interactive mode

When passing in test names to run via either the DPDK_TEST environment
variable or via extra argv parameters, the checks run on those commands
can miss valid commands that are registered with the cmdline library in
the initial context used to set it up. This is seen in the fact that the
"dump_*" set of commands are not callable via argv parameters, but can
be called manually.

To fix this, just use the commandline library to validate each command
before executing it, stopping execution when an error is encountered.
This also has the benefit of not having the test binary drop to
interactive mode if all commandline parameters given are invalid.

Bugzilla ID: 1002
Fixes: 9b848774a5dc ("test: use env variable to run tests")
Fixes: ace2f054ed43 ("test: take test names from command line")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test/commands.c
app/test/test.c