[PATCH i-g-t 1/1] lib/igt_ktap: fix parsing problems for parametrized tests with no params
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Fri May 23 10:16:00 UTC 2025
On Friday, 23 May 2025 10:35:44 CEST Jan Sokolowski wrote:
> In some cases, parametrized test might have no params and therefore no
> results to be reported, which causes parser failures.
Please add an excerpt from an error report and a related KTAP report from
dmesg to your commit description for reference.
>
> Add a condition that checks for that in the parser.
>
> Signed-off-by: Jan Sokolowski <jan.sokolowski at intel.com>
> Suggested-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Please provide a reference to a real issue, if there is one tracked publicly.
> ---
> lib/igt_ktap.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/igt_ktap.c b/lib/igt_ktap.c
> index 300fb2bb5..34306a1a0 100644
> --- a/lib/igt_ktap.c
> +++ b/lib/igt_ktap.c
> @@ -250,6 +250,10 @@ int igt_ktap_parse(const char *buf, struct igt_ktap_results *ktap)
> return -EINPROGRESS;
> }
>
> + /* in case of parametrized test having no params and hence no results */
> + if (igt_debug_on(ktap->expect == SUB_RESULT && code == IGT_EXIT_SKIP))
> + ktap->expect = CASE_RESULT;
NAK.
That looks like you are trying to address a case when a test case opens a
parametrized subtest section but returns no results from parametrized
subtests. If that case is now recognized by the parser as protocol violation
while it should not, i.e., empty parametrized results section should be
allowed, then that should be fixed in the input parser section, not in a next
section that evaluates parsing results.
After the parser detects a KTAP parametrized test case header and a KTAP
parametrized test case name, it shouldn't expect any parametrized subtest
results like it does now but should just expect a test case result. KTAP
parametrized subtest result lines detected when the KTAP test case result line
is expected should still be accepted. Please find relevant steps in the
parser code and fix them. Then, as soon as the current requirement of at
lease one result of a parametrised subtest expected is killed, the SUB_RESULT
phase may be dropped from the list of parsing phases as no longer needed.
Please also add a corresponding test case, based on the now problematic KTAP
output, to lib/tests/igt_ktap_parser.c
Thanks,
Janusz
> +
> /* neither a test case name nor result */
> if (ktap->expect != SUB_RESULT && code == IGT_EXIT_INVALID)
> return -EINPROGRESS;
>
More information about the igt-dev
mailing list